[BYOC] RelayToTIR custom codegen passes can still depend on dynamic shape functions#11619
Merged
masahi merged 1 commit intoapache:mainfrom Jun 10, 2022
Merged
Conversation
Contributor
Author
|
(Will give this a run through ci in draft form). |
areusch
reviewed
Jun 8, 2022
Contributor
areusch
left a comment
There was a problem hiding this comment.
thanks @mbs-octoml a couple questions for my understanding
345b9db to
210e2c0
Compare
Contributor
Author
|
Thanks @areusch , I've added a large intro comment to capture what I've reverse engineered. |
Contributor
Author
|
As discussed offline I'm going to pay down some testing tech debt and ping back. |
210e2c0 to
db09ba6
Compare
Contributor
Author
|
@areusch PTAL, added a bare-bones-but-at-least-it's-a-start unit test in test_pass_lower_te.py. Spent way too much time trying to make the tests of the form assert_equals(output, parse("...")) but gave up due to difficulties with matching GlobalVars. |
…hape functions In apache#11474 I got ready to switch CUTLASS from function-at-a-time to IRModule-at-a-time compilation. However my approach didn't handle dynamic shape functions, so I adjust it here. The idea is still that such passes will leave behind calls to 'extern' functions. However, converting those calls to 'call_lowered' form in MarkCompilerFunctionsAsExtern is too soon since only the TECompiler knows how to capture all the attributes necessary to support dynamic shape functions. So stop doing that in MarkCompilerFunctionsAsExtern and instead support this case properly in the TECompiler. While there try to chip away at the chronic lack of structure in te_compiler.cc. Every little bit helps. Add a basic unit test.
feea55c to
78d92c8
Compare
areusch
approved these changes
Jun 10, 2022
|
|
||
| main = actual_mod["main"] | ||
| call = main.body | ||
| assert call.op.name == "call_lowered" |
Contributor
|
tagging issue describing test challenges to cross-reference it. #11661 |
Contributor
Author
|
@tvm-bot merge |
Contributor
|
Cannot merge, these CI jobs are not successful on 78d92c8: |
Kathryn-cat
pushed a commit
to Kathryn-cat/tvm
that referenced
this pull request
Jun 10, 2022
…hape functions (apache#11619) In apache#11474 I got ready to switch CUTLASS from function-at-a-time to IRModule-at-a-time compilation. However my approach didn't handle dynamic shape functions, so I adjust it here. The idea is still that such passes will leave behind calls to 'extern' functions. However, converting those calls to 'call_lowered' form in MarkCompilerFunctionsAsExtern is too soon since only the TECompiler knows how to capture all the attributes necessary to support dynamic shape functions. So stop doing that in MarkCompilerFunctionsAsExtern and instead support this case properly in the TECompiler. While there try to chip away at the chronic lack of structure in te_compiler.cc. Every little bit helps. Add a basic unit test.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
In #11474 I got ready to switch CUTLASS from function-at-a-time to IRModule-at-a-time compilation.
However my approach didn't handle dynamic shape functions, so I adjust it here.
The idea is still that such passes will leave behind
calls to 'extern' functions. However, converting those
calls to 'call_lowered' form in
MarkCompilerFunctionsAsExtern is too soon since only
the TECompiler knows how to capture all the attributes
necessary to support dynamic shape functions.
So stop doing that in MarkCompilerFunctionsAsExtern and
instead support this case properly in the TECompiler.
While there try to chip away at the chronic lack of structure in te_compiler.cc. Every little bit helps.
Added a bare-bones unit test to exercise the main lowering/call-rewrite flavors, but much more is needed.