We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
It seems there is a problem in the VM compiler for indirect calls to global functions that aren't used elsewhere.
I have a simple code block that reproduces it:
import tvm from tvm import relay ctx = tvm.ndarray.context('cpu', 0) mod = relay.Module({}) fn1 = relay.Function([], relay.const(1)) fn2 = relay.Function([], relay.const(2)) g1 = relay.GlobalVar('g1') g2 = relay.GlobalVar('g2') mod[g1] = fn1 mod[g2] = fn2 p = relay.var('p', 'bool') mod['main'] = relay.Function([p], relay.Call(relay.If(p, g1, g2), [])) print(str(mod)) vm = relay.create_executor(mod=mod, ctx=ctx, target='llvm', kind="vm") relay_out = vm.evaluate()(True) print("Relay result:\n", relay_out)
This errors at the relay.create_executor line saying there is no definition for g1.
relay.create_executor
fn1
fn2
Call
If
So it seems that because g1 and g2 don't get directly called they get removed at some point.
The text was updated successfully, but these errors were encountered:
@abergeron Thanks for reporting this. There is pass in VM that removes the "unused" global functions. It probably removed these functions.
Sorry, something went wrong.
@abergeron #4700 fixes this.
No branches or pull requests
It seems there is a problem in the VM compiler for indirect calls to global functions that aren't used elsewhere.
I have a simple code block that reproduces it:
This errors at the
relay.create_executor
line saying there is no definition for g1.fn1
andfn2
instead of the global variables, it works.Call
inside theIf
it works.So it seems that because g1 and g2 don't get directly called they get removed at some point.
The text was updated successfully, but these errors were encountered: