This is an archive of the discontinued LLVM Phabricator instance.

[mlir][sparse] Introduce sparse_tensor.storage operator to create a sparse tensor storage tuple
ClosedPublic

Authored by Peiming on Sep 2 2022, 1:31 PM.

Diff Detail

Event Timeline

Peiming created this revision.Sep 2 2022, 1:31 PM
Herald added a project: Restricted Project. · View Herald Transcript
Peiming requested review of this revision.Sep 2 2022, 1:31 PM
Peiming updated this revision to Diff 457689.Sep 2 2022, 1:32 PM

format code...

Peiming added a reviewer: anlunx.

Super nit pick, but important to me

mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorOps.td
632

nitpick: Since we are just materializing an SSA value, can we use something other than "new' here, like .make_storage(a,b,c) or, or .pack(ab,c) just .storage(a,b,c) or something like that. The term "new" is too much associated with heap allocation, imho, so anything that avoids that confusion seems a bit better.

aartbik added inline comments.Sep 2 2022, 3:16 PM
mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorOps.td
646

What do you think of a syntax with brackets?

%0 = sparse_tensor.storage(%1, %2) : memref<?xf64>, memref<?xf64>

Peiming updated this revision to Diff 457731.Sep 2 2022, 4:31 PM
Peiming marked an inline comment as done.

address comments from Aart.

Peiming marked an inline comment as done.Sep 2 2022, 4:31 PM
Peiming added inline comments.
mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorOps.td
632

Okay, I chose it so that it has the same number of characters as storage_get.

I will use .storage(a, b, c)

Peiming retitled this revision from [mlir][sparse] Introduce sparse_tensor.storage_new operator to create a sparse tensor storage tuple to [mlir][sparse] Introduce sparse_tensor.storage operator to create a sparse tensor storage tuple.Sep 2 2022, 5:02 PM
aartbik accepted this revision.Sep 2 2022, 5:04 PM

Beautiful! Thanks!

This revision is now accepted and ready to land.Sep 2 2022, 5:04 PM
This revision was landed with ongoing or failed builds.Sep 2 2022, 5:08 PM
This revision was automatically updated to reflect the committed changes.
Peiming marked an inline comment as done.