This is an archive of the discontinued LLVM Phabricator instance.

[mlir][sparse] Modify the pivot selection method for quick sort.
ClosedPublic

Authored by bixia on Mar 7 2023, 5:46 PM.

Details

Summary

Previously, we choose the median of three values. We now choose the median of
five values when the number of values being sorted exceed a threshold
(currently 100). This is similar to std::sort.

Diff Detail

Event Timeline

bixia created this revision.Mar 7 2023, 5:46 PM
Herald added a project: Restricted Project. · View Herald Transcript
bixia requested review of this revision.Mar 7 2023, 5:46 PM
aartbik accepted this revision.Mar 14 2023, 10:12 AM

We should perhaps start thinking about moving all sorted related codegen to a more general place and in its own file.
(not know, but this is becoming a powerful utility that others may want to use too)

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

The new insertion point is right ....

This revision is now accepted and ready to land.Mar 14 2023, 10:12 AM
bixia updated this revision to Diff 505313.Mar 14 2023, 4:17 PM
bixia marked an inline comment as done.

Fixed comment. Rebased. Fixed FileCheck test.

bixia updated this revision to Diff 505538.Mar 15 2023, 9:44 AM

Fix a comment.