-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[RELAY] Remove kCompiler attr from ext mod #5028
Conversation
Functions in external modules kept their kCompiler attribute which means UseDefaultCompiler returns false. This prevents you from being able to run any passes on these external modules. By setting this attribute to 'default' when we add the function to the external module, we allow for passes to be run external modules. Change-Id: Ia60de3f0b0db9101738eac407aca4913fad9525a
cc @zhiics |
Sorry. I totally missed this PR. |
@@ -627,6 +627,7 @@ class CompileEngineImpl : public CompileEngineNode { | |||
const tvm::tir::StringImmNode* symbol_name = ext_symbol.as<tvm::tir::StringImmNode>(); | |||
CHECK(symbol_name) << "No external symbol is set for:\n" << AsText(src_func, false); | |||
auto gv = GlobalVar(symbol_name->value); | |||
src_func = WithAttr(src_func, attr::kCompiler, tir::StringImmNode::make("default")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now you should not give it "default" but a null string ObjectRef, so that the returned value is not defined
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, inorder to use CoW, you may want to use src_func = WithAttr(std::move(src_func), ...)
please followup, or close the PR if it is superseded by the later ones |
Let's close it. I think it is not needed now. |
Functions in external modules kept their kCompiler attribute which means UseDefaultCompiler returns false. This prevents you from being able to run any passes on these external modules. By setting this attribute to 'default' when we add the function to the external module, we allow for passes to be run external modules.