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

[ETHOSU] Add early simplify to fix LoopPartition #9387

Merged
merged 2 commits into from
Nov 1, 2021

Conversation

mbaret
Copy link
Contributor

@mbaret mbaret commented Oct 28, 2021

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.

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
@mbaret
Copy link
Contributor Author

mbaret commented Oct 28, 2021

@ekalda
Copy link
Contributor

ekalda commented Oct 29, 2021

Just for enlightenment, what's a "non-factor" and what does the Simplify pass do to help us? Otherwise, LGTM!

@mbaret
Copy link
Contributor Author

mbaret commented Oct 29, 2021

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.

Copy link
Contributor

@leandron leandron left a comment

Choose a reason for hiding this comment

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

LGTM

@manupak
Copy link
Contributor

manupak commented Oct 29, 2021

Thanks for the PR! @mbaret .
nit : the TVMScript test input is formatted with black. Is that expected ?

Change-Id: I9c9dc2ee2c679861866b23531e88584b94198e51
@mbaret
Copy link
Contributor Author

mbaret commented Oct 29, 2021

Good spot, forgot the fmt off :) I've fixed that now.

@leandron leandron merged commit e807743 into apache:main 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
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.

4 participants