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

[examples][MLIRSparseTensor] Add example to show how sparse vectoriza… #179

Merged
merged 1 commit into from
Oct 17, 2023

Conversation

Avimitin
Copy link
Contributor

…tion rewrite ForOp

@Avimitin
Copy link
Contributor Author

I am writing a blog post to describe how MLIR vectorizes sparse operation: https://blog.sh1mar.in/post/mlir/sparse-vectorization/. It is still WIP, but I think it can explain some of the rewrite details for this PR.

@Avimitin Avimitin force-pushed the sparse-vectorization branch 2 times, most recently from 1d244da to 6113171 Compare July 12, 2023 10:16
@linuxlonelyeagle linuxlonelyeagle self-requested a review July 29, 2023 10:35
func.func @sparse_mul(%arga: tensor<1024xf32, #SparseVector>,
%argb: tensor<1024xf32>,
%argx: tensor<1024xf32>) -> tensor<1024xf32> {
%0 = linalg.generic #trait_mul
Copy link
Member

Choose a reason for hiding this comment

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

%arga ,%argb, %argx should be aligned.

// Example for reduction loop vectorization
func.func @sparse_reduction(%arga: tensor<1024xf32, #SparseVector>,
%argb: tensor<1024xf32>,
%argx: tensor<f32>) -> tensor<f32> {
Copy link
Member

Choose a reason for hiding this comment

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

Same as above

@zhanghb97
Copy link
Member

@Avimitin Please modify the format according to the comments above.

@Avimitin Avimitin force-pushed the sparse-vectorization branch from 6113171 to b7fbe2b Compare October 16, 2023 09:46
@Avimitin
Copy link
Contributor Author

Fixed and rebased.

@zhanghb97 zhanghb97 merged commit 4d5445c into buddy-compiler:main Oct 17, 2023
1 check passed
@zhanghb97
Copy link
Member

Thanks!

ShiHaoGao pushed a commit to ShiHaoGao/buddy-mlir that referenced this pull request Oct 18, 2024
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