-
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
[Refactor][Relay Build] refactor build module to take IRModule #4988
Conversation
5d662d1
to
8376093
Compare
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.
LGTM. Just a miner point: We might consider accepting the Function for a while like build
if we expect users to call BuildModule.build
and BuildModule.optimize
directly. Otherwise, please ignore this comment.
Yeah, Python side still accepts |
I see. That makes sense. |
LGTM. Should we also update the tutorials? |
@wweic Its okay. Tutorials have already used module. |
@zhiics seems this change breaks the master ci, please look into it |
Okay. I will. Thanks for reminding. |
hmm, this actually revealed that the gcn tutorial didn't pass mod. We need to bind params when adding the function to the mod. Interestingly, it didn't fail for the last two runs before merging. #4994 |
This PR refactors relay build_module interfaces to accept IRModules instead of Function. This can help external codegen that may need to lift functions into the global scope.
Many tests in the codebase have already passed IRModule to
relay.build
, so no additional unit test is added in this PR.A follow up PR will be sent to add the outlining and inlining of subgraphs/sub-functions that are supported by external codegen.
cc @comaniac @icemelon9 @jroesch @tqchen @wweic