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

[LLVMGPU] Add im2col pipeline for convolution codegen #18086

Merged
merged 3 commits into from
Aug 2, 2024

Conversation

Max191
Copy link
Contributor

@Max191 Max191 commented Aug 1, 2024

This PR adds the remaining needed passes for the IGEMM pipeline using the im2col op. It adds the Conv2DToIm2colOp pass with a flag --iree-codegen-llvmgpu-use-igemm, and it adds the im2col decomposition pass before vectorization passes.

--iree-codegen-llvmgpu-use-igemm will be false by default until the IGEMM pipeline is more robust and performant.

Signed-off-by: Max Dawkins <max.dawkins@gmail.com>
Signed-off-by: Max Dawkins <max.dawkins@gmail.com>
Signed-off-by: Max Dawkins <max.dawkins@gmail.com>
Copy link
Contributor

@hanhanW hanhanW left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +201 to +202
// CHECK: %[[LHS_RD:.+]] = vector.transfer_read %[[B0]]{{.*}} vector<8xf16>
// CHECK: vector.transfer_write %[[LHS_RD]]
Copy link
Contributor

Choose a reason for hiding this comment

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

This part is from im2col op, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it should ultimately look the same as the normal matmul pipeline with different indexing on the LHS (im2col side). I don't bother checking the indexing here because the maps will likely get jumbled through canonicalizations and loop fusions throughout the pipeline.

@Max191 Max191 merged commit ba9ea85 into iree-org:main Aug 2, 2024
42 checks passed
@Max191 Max191 deleted the im2col-llvmgpu-pipeline branch October 25, 2024 14:17
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.

2 participants