Skip to content

[TIR] Add schedule primitive SetAxisSeparator#11225

Merged
csullivan merged 3 commits into
apache:mainfrom
vinx13:feat/axis_sep
May 6, 2022
Merged

[TIR] Add schedule primitive SetAxisSeparator#11225
csullivan merged 3 commits into
apache:mainfrom
vinx13:feat/axis_sep

Conversation

@vinx13

@vinx13 vinx13 commented May 5, 2022

Copy link
Copy Markdown
Member

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
Comment thread src/tir/schedule/primitive/layout_transformation.cc Outdated

@Lunderberg Lunderberg left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

cc @quic-sanirudh

@quic-sanirudh

quic-sanirudh commented May 6, 2022

Copy link
Copy Markdown
Contributor

@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.

@csullivan csullivan left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread src/tir/schedule/transform.h Outdated
Comment thread src/tir/schedule/transform.h Outdated
Comment thread src/tir/schedule/transform.h
Comment thread src/tir/schedule/transform.h Outdated
@vinx13

vinx13 commented May 6, 2022

Copy link
Copy Markdown
Member Author

@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
Copy Markdown
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
Copy Markdown
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