-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Bugfix][Relax] Remove call to tvm.build for empty TIR module (#16561)
Prior to this commit, if a lowered `IRModule` does not contain any TIR functions, `tvm.relax.build` provided an empty `tir_mod`, which caused a segfault during TIR compilation. This could occur when `tvm.relax.build` is called without an explicit target argument, for a module that does not define any virtual devices. This commit updates the `_filter_tir` utility function to return `None` if there are no TIR functions, rather than an empty `IRModule`. In addition, checks for an empty `IRModule` are added to `tvm.build` and `TIRToRuntime`, so that a similar failure mode would raise an exception rather than producing a segfault.
- Loading branch information
1 parent
c5aaa99
commit 7336deb
Showing
4 changed files
with
32 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters