[TIR] Schedule Primitive: Add-Unit-Loop#11575
Merged
junrushao merged 2 commits intoapache:mainfrom Jun 5, 2022
Merged
Conversation
vinx13
approved these changes
Jun 4, 2022
spectrometerHBH
approved these changes
Jun 5, 2022
junrushao
added a commit
to junrushao/tvm
that referenced
this pull request
Jun 5, 2022
Following apache#11575, this PR allows CUDA thread binding for TIR programs like ```python @T.prim_func def zero_dim_add( A: T.Buffer[(), "float32"], B: T.Buffer[(), "float32"], C: T.Buffer[(), "float32"], ) -> None: with T.block("C"): vi = T.axis.spatial(1, 0) C[()] = A[()] + B[()] ``` where there is no loop available to be bound to threadIdx/blockIdx.
spectrometerHBH
pushed a commit
that referenced
this pull request
Jun 5, 2022
Following #11575, this PR allows CUDA thread binding for TIR programs like ```python @T.prim_func def zero_dim_add( A: T.Buffer[(), "float32"], B: T.Buffer[(), "float32"], C: T.Buffer[(), "float32"], ) -> None: with T.block("C"): vi = T.axis.spatial(1, 0) C[()] = A[()] + B[()] ``` where there is no loop available to be bound to threadIdx/blockIdx.
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 TE, a unit loop could be introduced by fusing an empty list of loops on a stage. This PR adds its counterpart in TIR, while being a bit more explicit with a new schedule primitive which adds a unit loop without impacting any existing functionalities.