This is an archive of the discontinued LLVM Phabricator instance.

[mlir][sparse] index support in sparse compiler codegen
ClosedPublic

Authored by aartbik on Mar 8 2022, 1:36 PM.

Details

Summary

This revision adds support for the linalg.index to the sparse compiler
pipeline. In essence, this adds the ability to refer to indices in
the tensor index expression, as illustrated below:

Y[i, j, k, l, m] = T[i, j, k, l, m] * i * j

Diff Detail

Event Timeline

aartbik created this revision.Mar 8 2022, 1:36 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 8 2022, 1:36 PM
aartbik requested review of this revision.Mar 8 2022, 1:36 PM
bixia accepted this revision.Mar 8 2022, 3:00 PM
bixia added inline comments.
mlir/lib/Dialect/SparseTensor/Transforms/Sparsification.cpp
1055

Can you put a comment to help understand this?
I can see codegen.sparseOut is moved from the callsite to here, so not a real functional change.
But "isreduction" is added in the PR.

mlir/test/Dialect/SparseTensor/sparse_index.mlir
18

Shall we add doc = "X(i,j) = A(i,j) * i * j" ?

This revision is now accepted and ready to land.Mar 8 2022, 3:00 PM
aartbik marked 2 inline comments as done.Mar 8 2022, 4:55 PM
aartbik added inline comments.
mlir/lib/Dialect/SparseTensor/Transforms/Sparsification.cpp
1055

Ah, this was still in my workspace and should not really be part of this change. Sorry about that.
The change is very minor, but has not test yet, I will add one later. I have added a comment for now.

aartbik updated this revision to Diff 413976.Mar 8 2022, 4:56 PM
aartbik marked an inline comment as done.

added doc string, comments

This revision was automatically updated to reflect the committed changes.