This repository has been archived by the owner on May 22, 2023. It is now read-only.
[BYOC] Fix FuseOpsByPattern and RunCodegen for calling the same extern multiple times #441
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The two passes have a bug when calling the same extern function multiple times:
FuseOpsByPattern
: The second call fails atbuilder_->GetContextIRModule()->Lookup(gvar)
, since the gvar is removed during the visit to the first call atrelax/src/relax/transform/fuse_ops.cc
Line 1008 in 02f1ca7
RunCodegen
: The second call tofused_relax_nn_conv2d_tensorrt
doesn't get replaced with the extern func created during the first call, since thekCodegen
attribute is removed atrelax/src/relax/transform/run_codegen.cc
Line 91 in 02f1ca7
relax/src/relax/transform/run_codegen.cc
Lines 107 to 108 in 02f1ca7
Both issues have been fixed and a new test case is added for CUTLASS that demonstrates kernel sharing between multiple
call_tir
with the same callee kernel.@vinx13 @yelite