-
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
[RELAX][PASS] Annotate Custom Scope layout pass for Adreno GPU #17599
base: main
Are you sure you want to change the base?
Conversation
Texture scope annotation is handled by - Layout conversion from 4D to 5D with convert_layout pass - Legalization of ops with Adreno specific legalization - FuseOps & FuseTIR - Now, over the fused TIR annotate the scopes by hint_on_device - RealizeVDevice will take care of injecting to_device as needed. - Also, introduced SpecializeTIRParams to update the fused TIR the prim function buffer var map with new scope information. Changes in FuseOps and FuseTIR are to forward op attr and op pattern info. This info is used for Texture specific scoping decisions.
fe15d5b
to
1549733
Compare
@tvm-bot rerun |
@Hzfengsy do you mind take a look given it touches FuseOps/TIR |
@@ -1092,6 +1095,10 @@ def LegalizeOps( | |||
legalization function is not registered. By default we don't print | |||
warnings. | |||
|
|||
add_attributes : bool |
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.
is it possible to compose instead? e.g. run attribute attach pass after.
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.
After legalization pass we don't have any trace of operator specific attributes.
also cc @yongwww for memory scope related changes |
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.
some initial comments
@tvm-bot rerun |
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
Thanks @srkreddy1238 for updates. I take a closer look and now understands the motivation behind However, attaching op attributes into the I also now understand the demand is to enable the finally fused I think it is more cleaner to try a different approach. Instead of relying on legalize pass, let us introduce an adreno specific Now the remaining question is where the schedule can appear
To further enable fusion, one can try adopt the following customized legalize sequence |
Off late realized, I could have drafted an RFC to describe the approach. Have done now https://discuss.tvm.apache.org/t/rfc-annotate-custom-scope-layout-relax-pass-for-adreno-gpu/18052 @tqchen thanks for the thoughts. Few concerns I have in this approach
Pls advice. |
Texture scope annotation is handled by
hint_on_device
Changes in FuseOps and FuseTIR are to forward op attr and op pattern info. This info is used for Texture specific scoping decisions.