This is an archive of the discontinued LLVM Phabricator instance.

[mlir][sparse] Extend convertToMLIRSparseTensor to support permutation and more general sparsity values.
ClosedPublic

Authored by bixia on Feb 27 2022, 8:53 PM.

Details

Summary

Previously, convertToMLIRSparseTensor assumes identity storage ordering and all
compressed dimensions. This change extends the function with two parameters for
users to specify the storage ordering and the sparsity of each dimension.

Modify PyTACO to reflect this change.

Diff Detail

Event Timeline

bixia created this revision.Feb 27 2022, 8:53 PM
bixia requested review of this revision.Feb 27 2022, 8:53 PM

How about adding one test for this too?

mlir/lib/ExecutionEngine/SparseTensorUtils.cpp
755–762

Even though the rank is small, I would prefer that we move this kind of verification under assert code only.
In general, we can assume that compiler generated code is correct, so we can avoid the overhead of sorting.

WDYT?

1220–1221

a large part of this TODO can now be removed! ;-)

bixia updated this revision to Diff 411900.Feb 28 2022, 2:24 PM

Moved verification code to #ifndef NDEBUG. Fixed TODO description.

mlir/lib/ExecutionEngine/SparseTensorUtils.cpp
755–762

Agreed. Moved verification to #ifndef NDEBUG

1220–1221

Simplified the TODO description.

aartbik accepted this revision.Mar 1 2022, 10:24 AM
This revision is now accepted and ready to land.Mar 1 2022, 10:24 AM