[ETHOSU] Add early simplify to fix LoopPartition#9387
Merged
leandron merged 2 commits intoapache:mainfrom Nov 1, 2021
Merged
Conversation
Certain loops aren't correctly partitioned if the loop condition hasn't been simplified. This can happen when a copy loop is split by a non-factor. To fix this, an additional simplify pass is added to the TIR pipeline prior to LoopPartition. Change-Id: Icd4ff14648ccaed41384da50c6d183a122b30048
Contributor
Author
Contributor
|
Just for enlightenment, what's a "non-factor" and what does the Simplify pass do to help us? Otherwise, LGTM! |
Contributor
Author
|
A non-factor split would be one where, for instance, we want to split an axis of length 16 into stripes of length 7, so we'd get two stripes of 7 plus a residual of 2. This contrasts with a factor split which would be something like 8. In handling the edge case behaviour, some 'if' statements get inserted into TIR, and for I reason I don't fully understand these confuse LoopPartition unless their condition is simplified with the Simplify pass. |
Contributor
|
Thanks for the PR! @mbaret . |
Change-Id: I9c9dc2ee2c679861866b23531e88584b94198e51
a12715e to
7ec99a7
Compare
Contributor
Author
|
Good spot, forgot the fmt off :) I've fixed that now. |
leandron
approved these changes
Nov 1, 2021
ylc
pushed a commit
to ylc/tvm
that referenced
this pull request
Jan 7, 2022
* [ETHOSU] Add early simplify to fix LoopPartition Certain loops aren't correctly partitioned if the loop condition hasn't been simplified. This can happen when a copy loop is split by a non-factor. To fix this, an additional simplify pass is added to the TIR pipeline prior to LoopPartition. Change-Id: Icd4ff14648ccaed41384da50c6d183a122b30048 * Fix linting again Change-Id: I9c9dc2ee2c679861866b23531e88584b94198e51
ylc
pushed a commit
to ylc/tvm
that referenced
this pull request
Jan 13, 2022
* [ETHOSU] Add early simplify to fix LoopPartition Certain loops aren't correctly partitioned if the loop condition hasn't been simplified. This can happen when a copy loop is split by a non-factor. To fix this, an additional simplify pass is added to the TIR pipeline prior to LoopPartition. Change-Id: Icd4ff14648ccaed41384da50c6d183a122b30048 * Fix linting again Change-Id: I9c9dc2ee2c679861866b23531e88584b94198e51
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.
Certain loops aren't correctly partitioned if the loop condition hasn't been simplified. This can happen when a copy loop is split by a non-factor. To fix this, an additional simplify pass is added to the TIR pipeline prior to LoopPartition.