Skip to content

[Codegen] Migrate MapStoreOp to VectorizableOpInterface#23662

Merged
hanhanW merged 1 commit intomainfrom
users/hanhanW/vec-iface-c2c
Mar 11, 2026
Merged

[Codegen] Migrate MapStoreOp to VectorizableOpInterface#23662
hanhanW merged 1 commit intomainfrom
users/hanhanW/vec-iface-c2c

Conversation

@hanhanW
Copy link
Copy Markdown
Contributor

@hanhanW hanhanW commented Mar 5, 2026

The revision also deletes VectorizeIREELinalgExtOps, because it is already covered in GenericVectorization pass. The tests from vectorize_iree_linalg_ext_ops.mlir are migrated to generic_vectorization.mlir.

The map_store vectorization is only handled on LLVMGPU, which requires DecomposeMapStoreOp pass, so the vectorization is only enabled on LLVMGPU for now -- which matches the current behavior in IREE.

It is a step towards https://lists.lfaidata.foundation/g/iree-technical-discussion/message/15

Assisted-by: Claude

ci-extra: test_torch

@hanhanW hanhanW force-pushed the users/hanhanW/vec-iface-c2c branch 5 times, most recently from 2579a16 to 766f652 Compare March 6, 2026 19:47
Copy link
Copy Markdown
Contributor

@Max191 Max191 left a comment

Choose a reason for hiding this comment

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

Nice! I'm glad we're getting rid of all the ad-hoc vectorization passes

options.enableCleanup = false;
options.foldCastIntoContract = true;
options.enableVectorMasking = enableMasking;
options.vectorizeMapStore = true;
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.

FYI, we probably don't need the pass option, but it may still be good to keep to avoid untested code paths. The main reason this wasn't enabled elsewhere is that we don't see map_store anywhere else, so it should be fine to have on in other pipelines, but just not really used/tested. We would also need to add the decomposition pass to the other pipelines for it to work e2e.

To be clear, no action item here. Just providing some context. Maybe you can add a comment in case someone wants to enable it on other pipelines in the future.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the context, I tried that before (including adding DecomposeMapStoreOp to CPU pipeline). The performance is the same for one of the tracking models but the binary size regresses. Given that the op is not fully developed in other backend, I end up with having the flag for now; we can do the flip when other backends catch up.

@hanhanW hanhanW force-pushed the users/hanhanW/vec-iface-c2b branch from c1ebfc1 to e5cd0c0 Compare March 10, 2026 17:46
@hanhanW hanhanW force-pushed the users/hanhanW/vec-iface-c2c branch from 37cef0e to 5aa5b62 Compare March 10, 2026 17:46
@hanhanW hanhanW force-pushed the users/hanhanW/vec-iface-c2b branch from e5cd0c0 to efd99c5 Compare March 10, 2026 19:33
Base automatically changed from users/hanhanW/vec-iface-c2b to main March 10, 2026 22:28
The revision also deletes VectorizeIREELinalgExtOps, because it is already covered in GenericVectorization pass. The tests from `vectorize_iree_linalg_ext_ops.mlir` are migrated to `generic_vectorization.mlir`.

The map_store vectorization is only handled on LLVMGPU, which requires DecomposeMapStoreOp pass, so the vectorization is only enabled on LLVMGPU for now -- which matches the current behavior in IREE.

It is a step towards https://lists.lfaidata.foundation/g/iree-technical-discussion/message/15

Assisted-by: Claude

ci-extra: test_torch

Signed-off-by: hanhanW <hanhan0912@gmail.com>
@hanhanW hanhanW force-pushed the users/hanhanW/vec-iface-c2c branch from 5aa5b62 to a84722f Compare March 10, 2026 22:56
@hanhanW hanhanW merged commit b5d4a76 into main Mar 11, 2026
65 of 66 checks passed
@hanhanW hanhanW deleted the users/hanhanW/vec-iface-c2c branch March 11, 2026 01:11
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