cchung100m opened a new pull request, #20267: URL: https://github.com/apache/tvm/pull/20267
Hi Committers, This PR addresses issue https://github.com/apache/tvm/issues/20200. Any suggestions would be appreciated if you are available. ### Root Cause `KillAfterLastUse` decides whether a variable is a legal `R.vm.kill_object` target via `stored_in_vm_register`, which only excludes constants and FuncType/ShapeType/PrimType vars. A variable bound to `R.null_value()` has type `AnyType` - not in that exclusion list - so the pass wrongly treats it as killable. But both `CodeGenVM` and `CodeGenVMTIR` special-case `null_value` to bypass real VM register/anylist-slot allocation entirely. In `CodeGenVMTIR`, this mismatch hits an `ICHECK` requiring the kill target to resolve to an `anylist_getitem()` call, causing a hard crash (`CodeGenVM`'s bytecode backend happens to swallow it silently via a sentinel "void register," which is why only `exec_mode="compiled"` crashes). ### Solution Track variables bound to `relax.null_value` in `CollectLastUsage` (mirroring the existing constant_tensors_ pattern) and add them to the `stored_in_vm_register` exclusion, so the pass never emits a kill for them - closing the gap at its sources rather than patching either codegen. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
