-
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] Replace compile engine with TE compiler in the VM #8501
Merged
Merged
Changes from 21 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
b9c95fd
[VM] Add imports to new TE in VM compiler
mikepapadim 451d838
[VM] Add comments to compile engine usages
mikepapadim 11ff63b
Merge branch 'main' of https://github.com/apache/tvm into vm_te_migra…
mikepapadim 07947cc
Merge branch 'main' of https://github.com/apache/tvm into vm_te_migra…
mikepapadim d53fd1e
[VM] Replace depreceated CachedFunc of compile_engine with TE_compiler
mikepapadim 37f344e
[VM] rm compiler engine compiler.cc
mikepapadim 0f428cf
[VM] Replace compile engine with TECompiler in memory allocator
mikepapadim 88707fa
[VM] Add relay interface to te_compiler
mikepapadim ea022e1
Merge branch 'main' of https://github.com/apache/tvm into vm_te_migra…
mikepapadim a33e069
Merge branch 'main' of https://github.com/apache/tvm into vm_te_migra…
mikepapadim 9fd6552
Merge branch 'vm_te_migration' of github.com:mikepapadim/tvm into vm_…
mikepapadim 452815d
[Relay] Fix linting errors
mikepapadim c4d08d2
Merge branch 'main' of https://github.com/apache/tvm into vm_te_migra…
mikepapadim aed5d3b
Merge branch 'main' of https://github.com/apache/tvm into vm_te_migra…
mikepapadim a30cf6a
Move TEcompiler to VMCompilerContext; add global func into IRmodule w…
YuchenJin 7dd9282
add back the check
YuchenJin 3234a77
skip the check for ext func in tecompiler
YuchenJin 9ca3ffe
skip tvm::build for external functions
YuchenJin 0e823ce
trigger ci
YuchenJin c6f7d26
retrigger ci
YuchenJin 03d1fdf
retrigger ci
YuchenJin 2aa3114
remove the unnecessary loop in tecompiler
YuchenJin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
Just querying, when is this untrue for an external function that's gone via
Lower
?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.
Hi @Mousius, After calling
TECompilerImpl::Lower()
on an external function, the TECompiler will just encapsulate it intoCachedFunc
and return, and the external function is not lowered. It will be lowered by the external codegen with theTECompilerNode::LowerExternalFunctions()
later. I added a lineir_module->Add(global_var, key->source_func);
toLowerInternal
, so this is untrue when some function in thefuncs
of theCachedFuncNode
is not lowered yet.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.
Hi @YuchenJin, thanks for getting back to me, the reason I asked was because this loop is gated by the
kCompiler
attribute:And then when it goes into
LowerInternal
it'll end up in this block (with your alterations):Which means when we enter this loop, the only function in the
IRModule
should be a function taken fromkey->source_func
which has the attr on it?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.
Thanks @Mousius for elaborating it! I think you are right, and we can probably remove this loop because the
IRModule
should not contain a PrimFunc anyway for external functions, and we don't need to check it. What do you think?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.
Let's try removing the loop, if tests still pass we should be confident it wasn't necessary 😸
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.
Yeah, tests still pass after removing it. @jroesch, could you review this PR? :)