Skip to content

[mlir][Vector] Make vector.contract work with scalable vectors #65724

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

Merged
merged 1 commit into from
Sep 11, 2023

Conversation

banach-space
Copy link
Contributor

This is just a small fix that makes sure that vector.contract works with scalable vectors.

Rather than duplicating all the roundtrip tests for vector.contract, I'm treating scalable vectors as an edge case and just adding a couple to verify that this works.

@c-rhodes
Copy link
Collaborator

c-rhodes commented Sep 8, 2023

LGTM at a glance but I wonder if it's worth adding integration tests? Perhaps copying mlir/test/Integration/Dialect/Vector/CPU/test-contraction.mlir for mlir/test/Integration/Dialect/Vector/CPU/ArmSVE/test-contraction.mlir?

@banach-space
Copy link
Contributor Author

banach-space commented Sep 8, 2023

Thanks for taking a look!

LGTM at a glance but I wonder if it's worth adding integration tests? Perhaps copying mlir/test/Integration/Dialect/Vector/CPU/test-contraction.mlir for mlir/test/Integration/Dialect/Vector/CPU/ArmSVE/test-contraction.mlir?

Big +1 :)

However, I'm discovering quite a few subtle bits like this one while integrating things in IREE. Mindful that vector.contract is rather complex, I prefer doing this incrementally. But yes, we should be adding integration tests for vector.contract for SVE ASAP.

@c-rhodes
Copy link
Collaborator

c-rhodes commented Sep 8, 2023

Thanks for taking a look!

LGTM at a glance but I wonder if it's worth adding integration tests? Perhaps copying mlir/test/Integration/Dialect/Vector/CPU/test-contraction.mlir for mlir/test/Integration/Dialect/Vector/CPU/ArmSVE/test-contraction.mlir?

Big +1 :)

However, I'm discovering quite a few subtle bits like this one while integrating things in IREE. Mindful that vector.contract is rather complex, I prefer doing this incrementally. But yes, we should be adding integration tests for vector.contract for SVE ASAP.

Ok that's fine but please update the title of the commit / pull request to clarify this is simply fixing scalable dims being dropped in vector.contract lowering, because it currently implies the scope is grander than it is, and like you say this is a complex op so I doubt scalable vector support ends here?

This is just a small fix that makes sure that `vector.contract` works
with scalable vectors.

Rather than duplicating all the roundtrip tests for vector.contract, I'm
treating scalable vectors as an edge case and just adding a couple of
test cases to verify that this works.
@banach-space banach-space force-pushed the andrzej/make_contract_scalable branch from 21542ce to 9d07ee7 Compare September 11, 2023 08:05
@banach-space banach-space merged commit 7ec8fd4 into llvm:main Sep 11, 2023
banach-space added a commit that referenced this pull request Sep 11, 2023
Make sure that when calculating the expected mask for `vector.contract`,
scalable sizes are correctly taken into account.

Depends on: #65724
ZijunZhaoCCK pushed a commit to ZijunZhaoCCK/llvm-project that referenced this pull request Sep 19, 2023
…m#65724)

This is just a small fix that makes sure that `vector.contract` works
with scalable vectors.

Rather than duplicating all the roundtrip tests for vector.contract, I'm
treating scalable vectors as an edge case and just adding a couple to
verify that this works.
ZijunZhaoCCK pushed a commit to ZijunZhaoCCK/llvm-project that referenced this pull request Sep 19, 2023
Make sure that when calculating the expected mask for `vector.contract`,
scalable sizes are correctly taken into account.

Depends on: llvm#65724
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.

4 participants