This is an archive of the discontinued LLVM Phabricator instance.

[mlir][sparse] Introduce new sparse_tensor.storage_get/set to access memory that stores the handle of a sparse tensor
ClosedPublic

Authored by Peiming on Aug 31 2022, 1:45 PM.

Details

Summary

Introduce new sparse_tensor.storage_get/set to access memory that stores the handle of a sparse tensor. The sparse tensor storage are represented as a tuple, these operation will later be eliminated and the tuple will be flattened after sparse tensor codegen

Diff Detail

Event Timeline

Peiming created this revision.Aug 31 2022, 1:45 PM
Herald added a project: Restricted Project. · View Herald Transcript
Peiming requested review of this revision.Aug 31 2022, 1:45 PM
aartbik added inline comments.Aug 31 2022, 2:03 PM
mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorOps.td
627

I would call this

Sparse Tensor Storage Operation. ....

635

no empty line (see other ops)

659

no empty line

672

suggestion, instead of at 0

shall we use

[0] syntax?

This seems a bit more consistent with things seen in e.g. vector dialect,
so

%0 = sparse_tensor.storage_set %arg0[0], %arg1

mlir/lib/Dialect/SparseTensor/IR/SparseTensorDialect.cpp
486

same, Storage

492

no { } in single return if

499

same

511

same

520

same

Peiming updated this revision to Diff 457099.Aug 31 2022, 2:46 PM
Peiming marked 9 inline comments as done.

address comments from Aart

aartbik accepted this revision.Aug 31 2022, 3:13 PM
This revision is now accepted and ready to land.Aug 31 2022, 3:13 PM