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

[Vectorization][ObjectFifo] Enable larger Matmul + Truncf #856

Merged
merged 17 commits into from
Nov 5, 2024

Conversation

Abhishek-Varma
Copy link
Contributor

@Abhishek-Varma Abhishek-Varma commented Oct 23, 2024

-- This PR adds the following pieces to enable working of larger Matmul + Truncf.

  1. Updates insert-loops-for-vectorization to work on bufferized inputs, collapse unit dimensions and coalesce the generated loops for tiling.
  2. Makes the pipeline as IREEComprehensiveBufferization -> insert-cores -> insert-loops-for-vectorization -> vectorization.
  3. Creates and adds a new pass function-outlining - which is invoked right after insert-cores pass.
  4. Adds two canonicalization patterns that canonicalizes away trivial read/write access patterns to enable other dependent canonicalizations in aievec.
  5. Adds e2e CI test for 128x128x256 Matmul + Truncf bf16 -> bf16.

Signed-off-by: Abhishek Varma abhvarma@amd.com

@Abhishek-Varma Abhishek-Varma changed the base branch from main to avarma_test_buffer_then_vectorize October 23, 2024 13:02
@Abhishek-Varma Abhishek-Varma force-pushed the avarma_test_buffer_then_vectorize branch from 50f009b to 4f6698f Compare October 28, 2024 05:31
@Abhishek-Varma Abhishek-Varma changed the base branch from avarma_test_buffer_then_vectorize to main October 28, 2024 07:35
@Abhishek-Varma Abhishek-Varma changed the title Add function outlining pass + e2e larger Matmul + Truncf [Vectorization][ObjectFifo] Enable larger Matmul + Truncf Oct 28, 2024
@Abhishek-Varma Abhishek-Varma marked this pull request as ready for review October 28, 2024 10:58
Copy link
Contributor

@newling newling left a comment

Choose a reason for hiding this comment

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

I think this should be at divided into multiple PRs, one containing just the function outlining.

Nice to see this approach working!

Copy link
Contributor

@yzhang93 yzhang93 left a comment

Choose a reason for hiding this comment

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

Nice progress! This PR needs a bit more polish. Also please talk with @erwei-xilinx and see if he would help to make AIR tests work with the changes.

@erwei-xilinx
Copy link
Contributor

Nice progress! This PR needs a bit more polish. Also please talk with @erwei-xilinx and see if he would help to make AIR tests work with the changes.

Thanks for the heads up, @yzhang93! WiP on AIR support: #857.

@Abhishek-Varma
Copy link
Contributor Author

Nice progress! This PR needs a bit more polish. Also please talk with @erwei-xilinx and see if he would help to make AIR tests work with the changes.

Thanks for the heads up, @yzhang93! WiP on AIR support: #857.

Thank you so much @erwei-xilinx for the fix! ❤️

I took the changes from Xilinx/mlir-air#752 (created by Erwei) and applied to local mlir-air submodule.

I confirm all the tests I commented in this PR works with Erwei's fix.

@Abhishek-Varma Abhishek-Varma changed the base branch from main to avarma_create_func_outline November 4, 2024 14:07
@Abhishek-Varma Abhishek-Varma force-pushed the avarma_create_func_outline branch from 1158090 to d0c0c34 Compare November 4, 2024 14:08
@Abhishek-Varma
Copy link
Contributor Author

Hi @jtuyls @yzhang93 @newling - could you please re-review this PR now that #862 is close to being merged ?

@Abhishek-Varma Abhishek-Varma requested a review from jtuyls November 5, 2024 09:36
Abhishek-Varma added a commit that referenced this pull request Nov 5, 2024
…#862)

This PR creates a standalone `iree-amdaie-linalg-function-outlining`
pass which will be used to later enable the [larger Matmul + Truncf
e2e](#856).

Signed-off-by: Abhishek Varma <abhvarma@amd.com>
Base automatically changed from avarma_create_func_outline to main November 5, 2024 11:44
Copy link
Collaborator

@jtuyls jtuyls left a comment

Choose a reason for hiding this comment

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

LGTM

-- This commit makes the following updates to insert-loops-for-vectorization
   pass.
-- It makes it to work on bufferized inputs.
-- It also involves update pertaining to collapsing unit dimensions of
   a candidate generic op.
-- Also involves coalescing of the loops generated for tiles.
-- This is the first logically grouped PR needed to make Matmul + Truncf work
   for larger shape, and also unblock other outstanding/dependent PR like
   #846

Signed-off-by: Abhishek Varma <abhvarma@amd.com>
@newling
Copy link
Contributor

newling commented Nov 5, 2024

@Abhishek-Varma PR looks good other than my small remaining comments. My main concern is that vectorization is being disabled for convolution, hopefully that's not necessary after rebasing?

@Abhishek-Varma
Copy link
Contributor Author

@Abhishek-Varma PR looks good other than my small remaining comments. My main concern is that vectorization is being disabled for convolution, hopefully that's not necessary after rebasing?

Hi @newling - yes, this was an err because of rebasing - I've removed the disabling of vectorization for conv now.

@Abhishek-Varma Abhishek-Varma merged commit 12f0502 into main Nov 5, 2024
5 checks passed
@Abhishek-Varma Abhishek-Varma deleted the avarma_func_outline_pr branch November 5, 2024 20:05
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.

5 participants