This is an archive of the discontinued LLVM Phabricator instance.

[mlir][sparse] fuse collapse_shape on sparse tensor with GenericOp.
ClosedPublic

Authored by Peiming on Feb 28 2023, 3:43 PM.

Details

Summary

Instead of always materializing a new sparse tensor after reshape, this patch tries to fuses the reshape (currently only on COO) with GenericOp and coiterates with the reshaped tensors without allocating a new sparse tensor.

Diff Detail

Event Timeline

Peiming created this revision.Feb 28 2023, 3:43 PM
Herald added a project: Restricted Project. · View Herald Transcript
Peiming requested review of this revision.Feb 28 2023, 3:43 PM
Peiming edited the summary of this revision. (Show Details)
Peiming updated this revision to Diff 501321.Feb 28 2023, 3:50 PM

add a check test.

Peiming edited the summary of this revision. (Show Details)Feb 28 2023, 4:10 PM
aartbik added inline comments.Feb 28 2023, 5:07 PM
mlir/lib/Dialect/SparseTensor/Transforms/LoopEmitter.h
307

is this still supposed to be "experimental"?

311

document what this does ;-)

Peiming updated this revision to Diff 501557.Mar 1 2023, 9:58 AM

address comments.

Peiming marked 2 inline comments as done.Mar 1 2023, 9:59 AM
Peiming updated this revision to Diff 501560.Mar 1 2023, 10:02 AM

rename variable

aartbik accepted this revision.Mar 1 2023, 10:15 AM
aartbik added inline comments.
mlir/lib/Dialect/SparseTensor/Transforms/LoopEmitter.h
288

typo: collapse

This revision is now accepted and ready to land.Mar 1 2023, 10:15 AM
Peiming updated this revision to Diff 501575.Mar 1 2023, 10:37 AM

fix memory leak in tests

Peiming updated this revision to Diff 501590.Mar 1 2023, 11:05 AM

fix test.

This revision was landed with ongoing or failed builds.Mar 1 2023, 11:05 AM
This revision was automatically updated to reflect the committed changes.