This is an archive of the discontinued LLVM Phabricator instance.

[mlir][sparse] Implement insertion sort for the stable sort operator.
ClosedPublic

Authored by bixia on Oct 4 2022, 10:53 AM.

Diff Detail

Event Timeline

bixia created this revision.Oct 4 2022, 10:53 AM
Herald added a project: Restricted Project. · View Herald Transcript
bixia requested review of this revision.Oct 4 2022, 10:53 AM
bixia updated this revision to Diff 465424.Oct 5 2022, 9:03 AM

Rebase.

Peiming added inline comments.Oct 5 2022, 9:51 AM
mlir/lib/Dialect/SparseTensor/Transforms/SparseBufferRewriting.cpp
583–590

Would it be better to wrap the function name generation into util functions (same for other function created above), it should make it easier to adjust the name later? or you can define a set of marcos for the string constant.

bixia updated this revision to Diff 465450.Oct 5 2022, 10:19 AM
bixia marked an inline comment as done.

Replace literal filenames with constants.

mlir/lib/Dialect/SparseTensor/Transforms/SparseBufferRewriting.cpp
583–590

Replace this with string constants.

bixia updated this revision to Diff 465454.Oct 5 2022, 10:24 AM

Add the one missing filename constant.

bixia updated this revision to Diff 465554.Oct 5 2022, 2:18 PM

Fix a problem in the test.

aartbik accepted this revision.Oct 5 2022, 4:34 PM

Nice and concise? Any performance data already on the two versions?

mlir/lib/Dialect/SparseTensor/Transforms/SparseBufferRewriting.cpp
586

Shall we name this createUnstableSortFunc for symmetry with the other one, or does that sound too ominous? ;-)

mlir/test/Dialect/SparseTensor/buffer_rewriting.mlir
159

supporting functions (plural?)

169

extra newline?

This revision is now accepted and ready to land.Oct 5 2022, 4:34 PM
bixia updated this revision to Diff 465761.Oct 6 2022, 9:03 AM
bixia marked 3 inline comments as done.

Rename sort to sortNonstable.

bixia updated this revision to Diff 465770.Oct 6 2022, 9:22 AM

Fix test.