This is an archive of the discontinued LLVM Phabricator instance.

[mlir][sparse] add ability for sparse tensor output
ClosedPublic

Authored by aartbik on Jan 20 2022, 5:53 PM.

Details

Summary

Rationale:
Although file I/O is a bit alien to MLIR itself, we provide two convenient ways
for sparse tensor I/O. The input part was already there (behind the swiss army
knife sparse_tensor.new). Now we have a sparse_tensor.out to write out data. As
before, the ops are kept vague and may change in the future. For now this
allows us to compare TACO vs MLIR very easily.

Diff Detail

Event Timeline

aartbik created this revision.Jan 20 2022, 5:53 PM
aartbik requested review of this revision.Jan 20 2022, 5:53 PM
aartbik updated this revision to Diff 402076.Jan 21 2022, 12:40 PM

rebased with main

wrengr added inline comments.Jan 21 2022, 12:56 PM
mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorOps.td
394

typo?

mlir/lib/ExecutionEngine/SparseTensorUtils.cpp
720

Should be reference rather than pointer

bixia added inline comments.Jan 21 2022, 1:49 PM
mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorOps.td
394

"{" at the end is not needed.

mlir/lib/ExecutionEngine/SparseTensorUtils.cpp
720

Yes, it looks to me that we should use reference, similar to toCOO, as this parameter can't be nullptr.

bixia accepted this revision.Jan 21 2022, 1:51 PM
This revision is now accepted and ready to land.Jan 21 2022, 1:51 PM
aartbik marked 4 inline comments as done.Jan 21 2022, 1:58 PM
aartbik added inline comments.
mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorOps.td
394

Yeah, good catch. Not even sure how that ended up there. Thanks!

aartbik updated this revision to Diff 402108.Jan 21 2022, 2:13 PM
aartbik marked an inline comment as done.

addressed comments

This revision was landed with ongoing or failed builds.Jan 21 2022, 3:43 PM
This revision was automatically updated to reflect the committed changes.