This is an archive of the discontinued LLVM Phabricator instance.

[mlir][sparse] update doc for sparse_tensor.foreach operator.
ClosedPublic

Authored by Peiming on Oct 20 2022, 5:28 PM.

Details

Summary

Clarify that sparse_tensor.foreach iterates sparse_tensor in stored dim order.

Diff Detail

Event Timeline

Peiming created this revision.Oct 20 2022, 5:28 PM
Herald added a project: Restricted Project. · View Herald Transcript
Peiming requested review of this revision.Oct 20 2022, 5:28 PM
Peiming updated this revision to Diff 469426.Oct 20 2022, 5:30 PM

remove spaces.

Peiming edited the summary of this revision. (Show Details)Oct 20 2022, 5:31 PM
Peiming added reviewers: bixia, wrengr.
aartbik accepted this revision.Oct 20 2022, 5:32 PM
aartbik added inline comments.
mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorOps.td
850

I would say that the "loop iterates over the stored elements in the storage order" or something like htat (since stored dimension order still implies some order, but for unsorted versions, all is lost

and add:

No matter what storage order is used, however, the indices passed to the block always obey the original dimension order.

This revision is now accepted and ready to land.Oct 20 2022, 5:32 PM
Peiming updated this revision to Diff 469429.Oct 20 2022, 5:35 PM

update doc.

Peiming marked an inline comment as done.Oct 20 2022, 5:36 PM
This revision was landed with ongoing or failed builds.Oct 20 2022, 5:36 PM
This revision was automatically updated to reflect the committed changes.
wrengr added inline comments.Oct 20 2022, 5:41 PM
mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorOps.td
850

I would say that the "loop iterates over the stored elements in the storage order"

+1. "Stored dimension order" will become more and more of a misnomer as we start adding support for more unique sparsity formats. (E.g., the storage levels of formats like DIA don't really have anything to do with "dimensions" anymore)

and add:

No matter what storage order is used, however, the indices passed to the block always obey the original dimension order.

+1. That's very well phrased