This is an archive of the discontinued LLVM Phabricator instance.

[mlir][sparse] support foreach on dense tensor.
ClosedPublic

Authored by Peiming on Oct 20 2022, 3:05 PM.

Diff Detail

Event Timeline

Peiming created this revision.Oct 20 2022, 3:05 PM
Herald added a project: Restricted Project. · View Herald Transcript
Peiming requested review of this revision.Oct 20 2022, 3:05 PM
bixia added inline comments.Oct 20 2022, 3:22 PM
mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorOps.td
837–838

This is not correct anymore

839–845

need to add description about dense tensor

Peiming updated this revision to Diff 469377.Oct 20 2022, 3:28 PM

update doc.

Peiming updated this revision to Diff 469378.Oct 20 2022, 3:29 PM
Peiming marked 2 inline comments as done.

fix typo.

wrengr added inline comments.Oct 20 2022, 3:30 PM
mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorOps.td
839–840

Should say instead that this iterates over the stored elements/values (with a parenthetical remark that these are typically the non-zero elements but can also include any stored zeros; à la the new NOE op).

Peiming updated this revision to Diff 469380.Oct 20 2022, 3:38 PM

update doc.

Peiming marked an inline comment as done.Oct 20 2022, 3:38 PM
aartbik accepted this revision.Oct 20 2022, 4:17 PM
aartbik added inline comments.
mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorOps.td
838

Perhaps: Iterates over stored elements in a tensor
as the shorthand?

mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp
494

val = rewriter.create<memref::LoadOp>(op.getLoc(), vals, enc ? loopEmitter.getLastLevelTensorPointerIndex(0) : coords)

(you can use a local, but move the largely shared part of creating the LoadOp out of the if, assuming the types allow)

This revision is now accepted and ready to land.Oct 20 2022, 4:17 PM
Peiming updated this revision to Diff 469416.Oct 20 2022, 5:05 PM
Peiming marked 2 inline comments as done.

address comments.

This revision was landed with ongoing or failed builds.Oct 20 2022, 5:12 PM
This revision was automatically updated to reflect the committed changes.