Skip to content
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

[TIR] Add schedule primitive SetAxisSeparator #11225

Merged
merged 3 commits into from
May 6, 2022

Conversation

vinx13
Copy link
Member

@vinx13 vinx13 commented May 5, 2022

This PR added a schedule primitive set_axis_separator, it modifies axis_separators attribute of the target buffer, which affects the physical dimension after flattening.

cc @Lunderberg @csullivan @junrushao1994

@vinx13 vinx13 force-pushed the feat/axis_sep branch 2 times, most recently from d4d31d5 to e59b977 Compare May 5, 2022 23:41
Copy link
Contributor

@Lunderberg Lunderberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fantastic! I really like the ReplaceBufferMutator utility, and look forward to using it elsewhere as well!

@tmoreau89
Copy link
Contributor

cc @quic-sanirudh

@quic-sanirudh
Copy link
Contributor

quic-sanirudh commented May 6, 2022

@Lunderberg @vinx13 This is great, thanks a lot, I would love to start using this.

I do have a small doubt however. Is there a reason why we're introducing a new schedule primitive instead of allowing the user to pass something similar to te.AXIS_SEPARATOR to layout_transform and internally call both ScheduleTransformLayout and SetAxisSeparator as done for te?

The reason for this question is that the list to be passed to axis_separators argument seems like an internal detail and might confuse users. Also it might make it difficult for us to modify how axis_separators are handled internally later if needed once we expose this detail into user facing API.

Copy link
Contributor

@csullivan csullivan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for adding axis separator support to TIR scheduling! I also really love ReplaceBufferMutator, not only very useful but edifying as a concise description of all the places buffer rewrites may need to occur. Just a few comments, only one really needs addressing.

src/tir/schedule/transform.h Outdated Show resolved Hide resolved
src/tir/schedule/transform.h Outdated Show resolved Hide resolved
src/tir/schedule/transform.h Show resolved Hide resolved
src/tir/schedule/transform.h Outdated Show resolved Hide resolved
@vinx13
Copy link
Member Author

vinx13 commented May 6, 2022

@quic-sanirudh Thanks for the comments. The motivation to have a separate schedule primitive is to decouple the logical-physical mapping from generic layout transformation which doesn't have to deal with physical layout. @Lunderberg suggested that we can have a user convenience API backed by these two schedule primitives

@quic-sanirudh
Copy link
Contributor

we can have a user convenience API backed by these two schedule primitives

Ah okay, thanks for the reply @vinx13

@csullivan csullivan merged commit 31be300 into apache:main May 6, 2022
@csullivan
Copy link
Contributor

Many thanks @vinx13 @quic-sanirudh @junrushao1994 @Lunderberg, this is merged!

shtinsa pushed a commit to Deelvin/tvm that referenced this pull request May 17, 2022
* [TIR] Add schedule primitive SetAxisSeparator

* remove unused include

* Move ReplaceBufferMutator impl to cc file
SebastianBoblest pushed a commit to SebastianBoblest/tvm that referenced this pull request May 27, 2022
* [TIR] Add schedule primitive SetAxisSeparator

* remove unused include

* Move ReplaceBufferMutator impl to cc file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants