Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bugfix][Relax] Remove call to tvm.build for empty TIR module #16561

Merged

Commits on Feb 13, 2024

  1. [Bugfix][Relax] Remove call to tvm.build for empty TIR module

    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.
    Lunderberg committed Feb 13, 2024
    Configuration menu
    Copy the full SHA
    dafe411 View commit details
    Browse the repository at this point in the history