14 Commits

Author SHA1 Message Date
Aliia Khasanova
399638f98c Merge kDynamicSize and kDynamicSentinel into one constant.
resolve conflicts

Differential Revision: https://reviews.llvm.org/D138282
2022-11-21 13:01:26 +00:00
Aart Bik
c4f1af2bdf [mlir][sparse] avoid single small vector, set exact number 3
Reviewed By: wrengr

Differential Revision: https://reviews.llvm.org/D138071
2022-11-15 21:04:43 -08:00
Aart Bik
0e1708ff64 [mlir][sparse] cleanup small vector constant hints
Following advise from

https://llvm.org/docs/ProgrammersManual.html#llvm-adt-smallvector-h

This revision removes the size hints from SmallVector (unless we are
certain of the resulting number of elements). Also, this replaces
SmallVector references with SmallVectorImpl references.

Reviewed By: Peiming

Differential Revision: https://reviews.llvm.org/D138063
2022-11-15 15:09:06 -08:00
bixia1
4f729d5a70 [mlir][sparse] Add rewriting rules for sparse_tensor.sort_coo.
Refactor the rewriting of sparse_tensor.sort to support the implementation of
sparse_tensor.sort_coo.

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D137522
2022-11-14 08:48:53 -08:00
bixia1
5618d2bea9 [mlir][sparse] Add option enable-buffer-initialization to initialize the memory buffers for sparse tensors to support debugging.
Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D137592
2022-11-08 09:54:33 -08:00
bixia1
9b800bf79d [mlir][sparse] Improve the non-stable sort implementation.
Replace the quick sort partition method with one that is more similar to the
method used by C++ std quick sort. This improves the runtime for sorting
sk_2005.mtx by more than 10x.

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D137290
2022-11-07 07:38:42 -08:00
bixia1
d45be88736 [mlir][sparse] Implement the rewrite for sparse_tensor.push_back a value n times.
Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D136654
2022-10-31 08:19:12 -07:00
Mehdi Amini
9b170d126f Apply clang-tidy fixes for readability-identifier-naming in SparseBufferRewriting.cpp (NFC) 2022-10-13 02:58:34 +00:00
Mehdi Amini
f628d6c3e8 Apply clang-tidy fixes for modernize-use-using in SparseBufferRewriting.cpp (NFC) 2022-10-12 16:22:43 +00:00
bixia1
9409bbb2e0 [mlir][sparse] Implement insertion sort for the stable sort operator.
Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D135182
2022-10-06 09:48:39 -07:00
bixia1
1c835b5a8e [mlir][sparse] Allow the push_back operator to skip capacity check and reallocation.
Add UnitAttr `inbounds` for this purpose.

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D134913
2022-09-29 16:38:06 -07:00
bixia1
654bbbde55 [mlir][sparse] Move the implementation of sparse_tensor.push_back to the buffer rewriter.
Reviewed By: aartbik, Peiming

Differential Revision: https://reviews.llvm.org/D134777
2022-09-29 15:06:00 -07:00
Aart Bik
bfbf3bcb37 [mlir][sparse] fix build breakage due to Arith name change
Reviewed By: Peiming

Differential Revision: https://reviews.llvm.org/D134899
2022-09-29 12:12:43 -07:00
bixia1
062e515b70 [mlir][sparse] Add rewrite rule for the sort operator.
Add sparse-buffer-rewrite pass to rewrite sparse primitives on buffers to MLIR
implementation.

Add sparse rewrite rule for the sort operator.

Add FileCheck test and integration test.

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D134627
2022-09-29 11:38:19 -07:00