tvm
tvm copied to clipboard
[Relax] Update GlobalVar name in AttachGlobalSymbol
Prior to this commit, the relax.transform.AttachGlobalSymbol pass could produce a PrimFunc whose "global_symbol" attribute does not match the name of the GlobalVar. As a result, the PackedFunc that is provided by the compiled module (defined by the "global_symbol") does not match the PackedFunc that is required by the Relax VM (defined by the GlobalVar name).
This commit updates AttachGlobalSymbol to replace the GlobalVar of any function whose "global_symbol" is updated.
Closes https://github.com/apache/tvm/issues/17176