Skip to content

[Codegen] Harden yielding logic in TileDispatchUsingForall - #19212

Merged
qedawkins merged 2 commits into
iree-org:mainfrom
qedawkins:harden_yield_and_do_producer_fusion
Nov 21, 2024
Merged

qedawkins merged 2 commits into
iree-org:mainfrom
qedawkins:harden_yield_and_do_producer_fusion

Conversation

@qedawkins

Copy link
Copy Markdown
Contributor

Currently the TileDispatchUsingForall pass chooses to yield replacements for fused producers based on dominance relative to the tiling root. Now that this pass includes consumer fusion, this can create situations where a single operation is consuming two loop yielded values, blocking fusion.

This patch disables yielding of values when there is more than one tilable consumer. As a result, it's common to have remaining producer fusion opportunities after fusing in consumers, so we add another iteration of producer fusion. In the future the fusion worklist needs to include both producer and consumer fusions to enable covering all cases.

@qedawkins

Copy link
Copy Markdown
Contributor Author

fixes #19189

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

Minor nit. LGTM!

@qedawkins
qedawkins force-pushed the harden_yield_and_do_producer_fusion branch from 6ba2b2b to 8b556cf Compare November 21, 2024 16:07
Currently the TileDispatchUsingForall pass chooses to yield replacements
for fused producers based on dominance relative to the tiling root. Now
that this pass includes consumer fusion, this can create situations
where a single operation is consuming two loop yielded values, blocking
fusion.

This patch disables yielding of values when there is more than one
tilable consumer. As a result, it's common to have remaining producer
fusion opportunities after fusing in consumers, so we add another
iteration of producer fusion. In the future the fusion worklist needs to
include both producer and consumer fusions to enable covering all cases.
@qedawkins
qedawkins force-pushed the harden_yield_and_do_producer_fusion branch from 8b556cf to 78fd00f Compare November 21, 2024 16:09
@qedawkins
qedawkins merged commit 81ca183 into iree-org:main Nov 21, 2024
@qedawkins
qedawkins deleted the harden_yield_and_do_producer_fusion branch November 21, 2024 17:53
Groverkss pushed a commit to Groverkss/iree that referenced this pull request Dec 1, 2024
…19212)

Currently the TileDispatchUsingForall pass chooses to yield replacements
for fused producers based on dominance relative to the tiling root. Now
that this pass includes consumer fusion, this can create situations
where a single operation is consuming two loop yielded values, blocking
fusion.

This patch disables yielding of values when there is more than one
tilable consumer. As a result, it's common to have remaining producer
fusion opportunities after fusing in consumers, so we add another
iteration of producer fusion. In the future the fusion worklist needs to
include both producer and consumer fusions to enable covering all cases.
giacs-epic pushed a commit to giacs-epic/iree that referenced this pull request Dec 4, 2024
…19212)

Currently the TileDispatchUsingForall pass chooses to yield replacements
for fused producers based on dominance relative to the tiling root. Now
that this pass includes consumer fusion, this can create situations
where a single operation is consuming two loop yielded values, blocking
fusion.

This patch disables yielding of values when there is more than one
tilable consumer. As a result, it's common to have remaining producer
fusion opportunities after fusing in consumers, so we add another
iteration of producer fusion. In the future the fusion worklist needs to
include both producer and consumer fusions to enable covering all cases.

Signed-off-by: Giacomo Serafini <[email protected]>
pashu123 added a commit to pashu123/iree that referenced this pull request Jan 27, 2025
pashu123 added a commit to pashu123/iree that referenced this pull request Jan 27, 2025
pashu123 added a commit to pashu123/iree that referenced this pull request Jan 27, 2025
pashu123 added a commit to pashu123/iree that referenced this pull request Jan 27, 2025
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.

2 participants