-
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
[BYOC] RelayToTIR custom codegen passes can still depend on dynamic shape functions #11619
Conversation
(Will give this a run through ci in draft form). |
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 @mbs-octoml a couple questions for my understanding
345b9db
to
210e2c0
Compare
Thanks @areusch , I've added a large intro comment to capture what I've reverse engineered. |
As discussed offline I'm going to pay down some testing tech debt and ping back. |
210e2c0
to
db09ba6
Compare
@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
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 @mbs-octoml !
|
||
main = actual_mod["main"] | ||
call = main.body | ||
assert call.op.name == "call_lowered" |
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.
i am sad :(
tagging issue describing test challenges to cross-reference it. #11661 |
@tvm-bot merge |
Cannot merge, these CI jobs are not successful on 78d92c8: |
…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.
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.