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

[mlir][vector] Add scalable vectors to tests for vector.contract #70039

Merged

Conversation

banach-space
Copy link
Contributor

@banach-space banach-space commented Oct 24, 2023

Update the remaining tests for matrix multiplication (matmul) in:

  • vector-contract-to-outerproduct-transforms.mlir

with cases for scalable vectors.

Note that in order for the "vector.contract -> vector.outerproduct"
patterns to work, only the non-reduction dimension can be scalable (*).
For Matmul operations that is set to be the N dimension (i.e. rows of
the output matrix), which matches how matrix multiplication are normally
implemented for e.g. Arm's SVE. However, making the M dimension scalable
(i.e. columns of the output matrix) should work as well.

Making both parellel dimensions scalable is left as a TODO for when
support for 2-D scalable vectors is more established (this is
work-in-progress as part of the effort to support Arm's SME in MLIR).

The change in:

  • UnrolledOuterProductGenerator

is a "bug fix" to make sure that the conversion pattern correctly
propagates scalability when creating arith.extf operations.

(*) The conversion tested in this file unrolls along the reduction
dimension, which is not supported for scalable vectors.

@banach-space banach-space changed the title andrzej/extend vec cont to op tests [mlir][vector] Add scalable vectors to tests for vector.contract Oct 24, 2023
@banach-space
Copy link
Contributor Author

NOTE: Only review the last commit. Other commits are dependencies.

@banach-space banach-space force-pushed the andrzej/extend_vec_cont_to_op_tests branch from b5f879a to 065af62 Compare October 26, 2023 12:15
Copy link
Member

@MacDue MacDue left a comment

Choose a reason for hiding this comment

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

These LGTM, thanks!

@banach-space banach-space force-pushed the andrzej/extend_vec_cont_to_op_tests branch 2 times, most recently from 3f8efb7 to 92bd07f Compare October 27, 2023 08:28
Update the remaining tests for matrix multiplication (_matmul_) in:

  * vector-contract-to-outerproduct-transforms.mlir

with cases for scalable vectors.

Note that in order for the "vector.contract -> vector.outerproduct"
patterns to work, only the non-reduction dimension can be scalable (*).
For Matmul operations that is set to be the N dimension (i.e. rows of
the output matrix), which matches how matrix multiplication are normally
implemented for e.g. Arm's SVE. However, making the M dimension scalable
(i.e. columns of the output matrix) should work as well.

Making both parellel dimensions scalable is left as a TODO for when
support for 2-D scalable vectors is more established (this is
work-in-progress as part of the effort to support Arm's SME in MLIR).

The change in:

  * `UnrolledOuterProductGenerator`

is a "bug fix" to make sure that the conversion pattern correctly
propagates scalability when creating `arith.extf` operations.

(*) The conversion tested in this file unrolls along the reduction
dimension, which is not supported for scalable vectors.
@banach-space banach-space force-pushed the andrzej/extend_vec_cont_to_op_tests branch from 92bd07f to 49c7d2e Compare October 27, 2023 08:36
@banach-space banach-space merged commit 5270df3 into llvm:main Oct 27, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants