This is an archive of the discontinued LLVM Phabricator instance.

[mlir][sparse] introduce sparse_tensor.pack operation
ClosedPublic

Authored by Peiming on Feb 2 2023, 3:34 PM.

Diff Detail

Event Timeline

Peiming created this revision.Feb 2 2023, 3:34 PM
Herald added a project: Restricted Project. · View Herald Transcript
Peiming requested review of this revision.Feb 2 2023, 3:34 PM
Peiming updated this revision to Diff 494451.Feb 2 2023, 3:36 PM

revert unintended changes

aartbik added inline comments.Feb 3 2023, 10:36 AM
mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorOps.td
65

use brackets for readability

.... for the given (data, indices) pair.

68

Describe data/indices in more detail

data : array wit the value of each stored element
indices: array with the indices of each stored element, in AOS format

Perhaps even give example like matrix with elements a_00, a_41 is stored as
data a_00 a_41
indices 0 0 4 1

69

shall not exceed (no s)

75

do we allow ?x?xf64 as return format

probably not, since we cannot guess size from just data, since matrix may not be filled

so we probably need to check that and document that

EDIT: I see below you enforce that, so just document that

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

period at end

640

ranke -> rank

671

As first glance, it did not feel right to have rewriting in IR, shouldn't this be in transforms somehow? But looking around, all other dialects define canonicaliazation in this file, so good to go ;-)

Peiming updated this revision to Diff 494697.Feb 3 2023, 11:33 AM
Peiming marked 6 inline comments as done.

address comments.

Peiming updated this revision to Diff 494710.Feb 3 2023, 12:42 PM

only accept COO as the result encoding.

Peiming updated this revision to Diff 494731.Feb 3 2023, 2:07 PM

update doc.

aartbik added inline comments.Feb 3 2023, 2:14 PM
mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorOps.td
89

COO?

aartbik accepted this revision.Feb 3 2023, 2:14 PM
This revision is now accepted and ready to land.Feb 3 2023, 2:14 PM
Peiming updated this revision to Diff 494735.Feb 3 2023, 2:14 PM

update doc

Peiming marked an inline comment as done.Feb 3 2023, 2:19 PM
This revision was landed with ongoing or failed builds.Feb 3 2023, 2:31 PM
This revision was automatically updated to reflect the committed changes.