Skip to content

[VectorDistribution] Plumb the VectorDistribute pipeline to support reduction operations (3/4) - #18822

Closed
bangtianliu wants to merge 9 commits into
iree-org:mainfrom
bangtianliu:reduction_vd_patch_3rd
Closed

bangtianliu wants to merge 9 commits into
iree-org:mainfrom
bangtianliu:reduction_vd_patch_3rd

Conversation

@bangtianliu

@bangtianliu bangtianliu commented Oct 17, 2024 •

Copy link
Copy Markdown
Contributor

Splitting #18519 into four patches.

Depends #18784 and #18800.

This is the third patch, including changes along the VectorDistribute pipeline to support reduction operations.

Additionally, a relevant test has been added, demonstrating how the reduction IR can be transformed through the VectorDistribute pipeline using the provided translation information and lowering configurations.

A separate patch #18952 about supporting vector.contract is created to avoid the hacks on pipeline option.

The upcoming and final patch will focus on setting configurations required by VectorDistribute pipeline for the reduction ops.

@kuhar kuhar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why do we need the new pipeline option?

@bangtianliu

Copy link
Copy Markdown
Contributor Author

Why do we need the new pipeline option?

A temporary solution to support reductions in the VectorDistribute pipeline, where reductions are currently converted to contractions by default in the linalg vectorization part.

@kuhar

kuhar commented Oct 18, 2024

Copy link
Copy Markdown
Member

What would it take to detect this automatically so that we don't need the new option?

@bangtianliu

Copy link
Copy Markdown
Contributor Author

Two possible solutions:

  1. Within the generic vectorization pass, add additional logic to detect reductions and automatically disable their conversion to contractions.

  2. Alternatively, after the vectorization pass, introduce a pattern match that recognizes contractions (previously converted from reductions) and reverts them back to reductions.

@kuhar

kuhar commented Oct 18, 2024

Copy link
Copy Markdown
Member

I'd strongly prefer not to add new options -- these tend to explode in complexity over time

@bangtianliu

Copy link
Copy Markdown
Contributor Author

I'd strongly prefer not to add new options -- these tend to explode in complexity over time

Sure, I will see how to avoid this.

@bangtianliu

Copy link
Copy Markdown
Contributor Author

I added the implementation to distribute the vector.contract operation, thereby eliminating the need for the extract pipeline option.

@Groverkss

Copy link
Copy Markdown
Contributor

This is looking much nicer with the vector.contract distribution. Can you move that to a seperate patch if possible?

@bangtianliu
bangtianliu force-pushed the reduction_vd_patch_3rd branch from ba80d40 to 43c865b Compare November 3, 2024 19:50
Groverkss pushed a commit that referenced this pull request Nov 6, 2024
…Op (#18952)

Depends on #18822 

This patch adds support for distributing vector::ContractionOp when
contraction op is generated from reduction and mfma instruction is not
used.

---------

Signed-off-by: Bangtian Liu <[email protected]>
Groverkss pushed a commit to Groverkss/iree that referenced this pull request Dec 1, 2024
…Op (iree-org#18952)

Depends on iree-org#18822 

This patch adds support for distributing vector::ContractionOp when
contraction op is generated from reduction and mfma instruction is not
used.

---------

Signed-off-by: Bangtian Liu <[email protected]>
giacs-epic pushed a commit to giacs-epic/iree that referenced this pull request Dec 4, 2024
…Op (iree-org#18952)

Depends on iree-org#18822

This patch adds support for distributing vector::ContractionOp when
contraction op is generated from reduction and mfma instruction is not
used.

---------

Signed-off-by: Bangtian Liu <[email protected]>
Signed-off-by: Giacomo Serafini <[email protected]>
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.

3 participants