Skip to content

Commit 51ebecf

Browse files
[mlir][sparse] Changed sparsity properties to use _ instead of -
Example: compressed-no -> compressed_no Reviewed By: aartbik Differential Revision: https://reviews.llvm.org/D158567
1 parent 8a77917 commit 51ebecf

35 files changed

+113
-113
lines changed

mlir/include/mlir/Dialect/SparseTensor/IR/Enums.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -207,27 +207,27 @@ constexpr const char *toMLIRString(DimLevelType dlt) {
207207
case DimLevelType::Compressed:
208208
return "compressed";
209209
case DimLevelType::CompressedNu:
210-
return "compressed-nu";
210+
return "compressed_nu";
211211
case DimLevelType::CompressedNo:
212-
return "compressed-no";
212+
return "compressed_no";
213213
case DimLevelType::CompressedNuNo:
214-
return "compressed-nu-no";
214+
return "compressed_nu_no";
215215
case DimLevelType::Singleton:
216216
return "singleton";
217217
case DimLevelType::SingletonNu:
218-
return "singleton-nu";
218+
return "singleton_nu";
219219
case DimLevelType::SingletonNo:
220-
return "singleton-no";
220+
return "singleton_no";
221221
case DimLevelType::SingletonNuNo:
222-
return "singleton-nu-no";
222+
return "singleton_nu_no";
223223
case DimLevelType::CompressedWithHi:
224-
return "compressed-hi";
224+
return "compressed_hi";
225225
case DimLevelType::CompressedWithHiNu:
226-
return "compressed-hi-nu";
226+
return "compressed_hi_nu";
227227
case DimLevelType::CompressedWithHiNo:
228-
return "compressed-hi-no";
228+
return "compressed_hi_no";
229229
case DimLevelType::CompressedWithHiNuNo:
230-
return "compressed-hi-nu-no";
230+
return "compressed_hi_nu_no";
231231
case DimLevelType::TwoOutOfFour:
232232
return "compressed24";
233233
}

mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorAttrDefs.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ def SparseTensorEncodingAttr : SparseTensor_Attr<"SparseTensorEncoding",
200200

201201
// Sorted Coordinate Scheme.
202202
#SortedCOO = #sparse_tensor.encoding<{
203-
lvlTypes = [ "compressed-nu", "singleton" ]
203+
lvlTypes = [ "compressed_nu", "singleton" ]
204204
}>
205205
... tensor<?x?xf64, #SortedCOO> ...
206206

mlir/include/mlir/ExecutionEngine/SparseTensor/Storage.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1205,15 +1205,15 @@ SparseTensorStorage<P, C, V>::SparseTensorStorage(
12051205
uint64_t trailCOOLen = 0, parentSz = 1, bufIdx = 0;
12061206
for (uint64_t l = 0; l < lvlRank; l++) {
12071207
if (!isUniqueLvl(l) && isCompressedLvl(l)) {
1208-
// A `compressed-nu` level marks the start of trailing COO start level.
1208+
// A `compressed_nu` level marks the start of trailing COO start level.
12091209
// Since the coordinate buffer used for trailing COO are passed in as AoS
12101210
// scheme, and SparseTensorStorage uses a SoA scheme, we can not simply
12111211
// copy the value from the provided buffers.
12121212
trailCOOLen = lvlRank - l;
12131213
break;
12141214
}
12151215
assert(!isSingletonLvl(l) &&
1216-
"Singleton level not following a compressed-nu level");
1216+
"Singleton level not following a compressed_nu level");
12171217
if (isCompressedLvl(l)) {
12181218
P *posPtr = reinterpret_cast<P *>(lvlBufs[bufIdx++]);
12191219
C *crdPtr = reinterpret_cast<C *>(lvlBufs[bufIdx++]);

mlir/lib/Bindings/Python/DialectSparseTensor.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,19 @@ static void populateDialectSparseTensorSubmodule(const py::module &m) {
2121
.value("dense", MLIR_SPARSE_TENSOR_DIM_LEVEL_DENSE)
2222
.value("compressed24", MLIR_SPARSE_TENSOR_DIM_LEVEL_TWO_OUT_OF_FOUR)
2323
.value("compressed", MLIR_SPARSE_TENSOR_DIM_LEVEL_COMPRESSED)
24-
.value("compressed-nu", MLIR_SPARSE_TENSOR_DIM_LEVEL_COMPRESSED_NU)
25-
.value("compressed-no", MLIR_SPARSE_TENSOR_DIM_LEVEL_COMPRESSED_NO)
26-
.value("compressed-nu-no", MLIR_SPARSE_TENSOR_DIM_LEVEL_COMPRESSED_NU_NO)
24+
.value("compressed_nu", MLIR_SPARSE_TENSOR_DIM_LEVEL_COMPRESSED_NU)
25+
.value("compressed_no", MLIR_SPARSE_TENSOR_DIM_LEVEL_COMPRESSED_NO)
26+
.value("compressed_nu_no", MLIR_SPARSE_TENSOR_DIM_LEVEL_COMPRESSED_NU_NO)
2727
.value("singleton", MLIR_SPARSE_TENSOR_DIM_LEVEL_SINGLETON)
28-
.value("singleton-nu", MLIR_SPARSE_TENSOR_DIM_LEVEL_SINGLETON_NU)
29-
.value("singleton-no", MLIR_SPARSE_TENSOR_DIM_LEVEL_SINGLETON_NO)
30-
.value("singleton-nu-no", MLIR_SPARSE_TENSOR_DIM_LEVEL_SINGLETON_NU_NO)
31-
.value("compressed-hi", MLIR_SPARSE_TENSOR_DIM_LEVEL_COMPRESSED_WITH_HI)
32-
.value("compressed-hi-nu",
28+
.value("singleton_nu", MLIR_SPARSE_TENSOR_DIM_LEVEL_SINGLETON_NU)
29+
.value("singleton_no", MLIR_SPARSE_TENSOR_DIM_LEVEL_SINGLETON_NO)
30+
.value("singleton_nu_no", MLIR_SPARSE_TENSOR_DIM_LEVEL_SINGLETON_NU_NO)
31+
.value("compressed_hi", MLIR_SPARSE_TENSOR_DIM_LEVEL_COMPRESSED_WITH_HI)
32+
.value("compressed_hi_nu",
3333
MLIR_SPARSE_TENSOR_DIM_LEVEL_COMPRESSED_WITH_HI_NU)
34-
.value("compressed-hi-no",
34+
.value("compressed_hi_no",
3535
MLIR_SPARSE_TENSOR_DIM_LEVEL_COMPRESSED_WITH_HI_NO)
36-
.value("compressed-hi-nu-no",
36+
.value("compressed_hi_nu_no",
3737
MLIR_SPARSE_TENSOR_DIM_LEVEL_COMPRESSED_WITH_HI_NU_NO);
3838

3939
mlir_attribute_subclass(m, "EncodingAttr",

mlir/lib/Dialect/SparseTensor/IR/SparseTensorDialect.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,7 @@ Level mlir::sparse_tensor::toStoredDim(RankedTensorType type, Dimension d) {
824824
//===----------------------------------------------------------------------===//
825825

826826
/// We normalized sparse tensor encoding attribute by always using
827-
/// ordered/unique DLT such that "compressed-nu-no" and "compressed-nu" (as well
827+
/// ordered/unique DLT such that "compressed_nu_no" and "compressed_nu" (as well
828828
/// as other variants) lead to the same storage specifier type, and stripping
829829
/// irrelevant fields that do not alter the sparse tensor memory layout.
830830
static SparseTensorEncodingAttr

mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorCodegen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1183,7 +1183,7 @@ class SparseNumberOfEntriesConverter
11831183
ConversionPatternRewriter &rewriter) const override {
11841184
// Query memSizes for the actually stored values.
11851185
// FIXME: the nse value computed in this way might be wrong when there is
1186-
// any "compressed-hi" level.
1186+
// any "compressed_hi" level.
11871187
rewriter.replaceOp(
11881188
op, genValMemSize(rewriter, op.getLoc(), adaptor.getTensor()));
11891189
return success();

mlir/test/Dialect/SparseTensor/GPU/gpu_matvec_lib.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: --sparsification="enable-gpu-libgen" | FileCheck %s
33

44
#SortedCOO = #sparse_tensor.encoding<{
5-
lvlTypes = [ "compressed-nu", "singleton" ]
5+
lvlTypes = [ "compressed_nu", "singleton" ]
66
}>
77

88
module {

mlir/test/Dialect/SparseTensor/codegen.mlir

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
}>
2828

2929
#UCSR = #sparse_tensor.encoding<{
30-
lvlTypes = [ "dense", "compressed-no" ]
30+
lvlTypes = [ "dense", "compressed_no" ]
3131
}>
3232

3333
#CSC = #sparse_tensor.encoding<{
@@ -47,16 +47,16 @@
4747
}>
4848

4949
#Coo = #sparse_tensor.encoding<{
50-
lvlTypes = [ "compressed-nu", "singleton" ]
50+
lvlTypes = [ "compressed_nu", "singleton" ]
5151
}>
5252

5353
#CooPNo = #sparse_tensor.encoding<{
54-
lvlTypes = [ "compressed-nu", "singleton-no" ],
54+
lvlTypes = [ "compressed_nu", "singleton_no" ],
5555
dimToLvl = affine_map<(i, j) -> (j, i)>
5656
}>
5757

5858
#ccoo = #sparse_tensor.encoding<{
59-
lvlTypes = [ "compressed", "compressed-nu", "singleton" ]
59+
lvlTypes = [ "compressed", "compressed_nu", "singleton" ]
6060
}>
6161

6262
// CHECK-LABEL: func @sparse_nop(
@@ -523,7 +523,7 @@ func.func @sparse_compression(%tensor: tensor<8x8xf64, #CSR>,
523523
return %1 : tensor<8x8xf64, #CSR>
524524
}
525525

526-
// CHECK-LABEL: func.func private @"_insert_dense_compressed-no_8_8_f64_0_0"(
526+
// CHECK-LABEL: func.func private @_insert_dense_compressed_no_8_8_f64_0_0(
527527
// CHECK-SAME: %[[A1:.*0]]: memref<?xindex>,
528528
// CHECK-SAME: %[[A2:.*1]]: memref<?xindex>,
529529
// CHECK-SAME: %[[A3:.*2]]: memref<?xf64>,
@@ -549,7 +549,7 @@ func.func @sparse_compression(%tensor: tensor<8x8xf64, #CSR>,
549549
// CHECK: %[[A13:.*]]:4 = scf.for %[[A14:.*]] = %[[A11]] to %[[A7]] step %[[A12]] iter_args(%[[A15:.*]] = %[[A0]], %[[A16:.*]] = %[[A1]], %[[A17:.*]] = %[[A2]], %[[A18:.*]] = %[[A3]]) -> (memref<?xindex>, memref<?xindex>, memref<?xf64>, !sparse_tensor.storage_specifier
550550
// CHECK: %[[A19:.*]] = memref.load %[[A6]]{{\[}}%[[A14]]] : memref<?xindex>
551551
// CHECK: %[[A20:.*]] = memref.load %[[A4]]{{\[}}%[[A19]]] : memref<?xf64>
552-
// CHECK: %[[A21:.*]]:4 = func.call @"_insert_dense_compressed-no_8_8_f64_0_0"(%[[A15]], %[[A16]], %[[A17]], %[[A18]], %[[A8]], %[[A19]], %[[A20]]) : (memref<?xindex>, memref<?xindex>, memref<?xf64>, !sparse_tensor.storage_specifier
552+
// CHECK: %[[A21:.*]]:4 = func.call @_insert_dense_compressed_no_8_8_f64_0_0(%[[A15]], %[[A16]], %[[A17]], %[[A18]], %[[A8]], %[[A19]], %[[A20]]) : (memref<?xindex>, memref<?xindex>, memref<?xf64>, !sparse_tensor.storage_specifier
553553
// CHECK: memref.store %[[A10]], %[[A4]]{{\[}}%[[A19]]] : memref<?xf64>
554554
// CHECK: memref.store %[[A9]], %[[A5]]{{\[}}%[[A19]]] : memref<?xi1>
555555
// CHECK: scf.yield %[[A21]]#0, %[[A21]]#1, %[[A21]]#2, %[[A21]]#3 : memref<?xindex>, memref<?xindex>, memref<?xf64>, !sparse_tensor.storage_specifier
@@ -627,7 +627,7 @@ func.func @sparse_insert_typed(%arg0: tensor<128xf64, #SparseVector>, %arg1: ind
627627
return %1 : tensor<128xf64, #SparseVector>
628628
}
629629

630-
// CHECK-LABEL: func.func private @"_insert_compressed-nu_singleton_5_6_f64_0_0"(
630+
// CHECK-LABEL: func.func private @_insert_compressed_nu_singleton_5_6_f64_0_0(
631631
// CHECK-SAME: %[[A1:.*0]]: memref<?xindex>,
632632
// CHECK-SAME: %[[A2:.*1]]: memref<?xindex>,
633633
// CHECK-SAME: %[[A3:.*2]]: memref<?xf64>,
@@ -643,7 +643,7 @@ func.func @sparse_insert_typed(%arg0: tensor<128xf64, #SparseVector>, %arg1: ind
643643
// CHECK-SAME: %[[A3:.*3]]: !sparse_tensor.storage_specifier
644644
// CHECK-SAME: %[[A4:.*4]]: index,
645645
// CHECK-SAME: %[[A5:.*5]]: f64)
646-
// CHECK: %[[R:.*]]:4 = call @"_insert_compressed-nu_singleton_5_6_f64_0_0"(%[[A0]], %[[A1]], %[[A2]], %[[A3]], %[[A4]], %[[A4]], %[[A5]])
646+
// CHECK: %[[R:.*]]:4 = call @_insert_compressed_nu_singleton_5_6_f64_0_0(%[[A0]], %[[A1]], %[[A2]], %[[A3]], %[[A4]], %[[A4]], %[[A5]])
647647
// CHECK: return %[[R]]#0, %[[R]]#1, %[[R]]#2, %[[R]]#3
648648
func.func @sparse_insert_coo(%arg0: tensor<5x6xf64, #Coo>, %arg1: index, %arg2: f64) -> tensor<5x6xf64, #Coo> {
649649
%0 = sparse_tensor.insert %arg2 into %arg0[%arg1, %arg1] : tensor<5x6xf64, #Coo>

mlir/test/Dialect/SparseTensor/codegen_sparse_alloc.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: mlir-opt %s --sparse-tensor-codegen --canonicalize --cse | FileCheck %s
22

33
#CSR = #sparse_tensor.encoding<{ lvlTypes = ["dense", "compressed"]}>
4-
#COO = #sparse_tensor.encoding<{ lvlTypes = ["compressed-nu", "singleton"]}>
4+
#COO = #sparse_tensor.encoding<{ lvlTypes = ["compressed_nu", "singleton"]}>
55

66
// CHECK-LABEL: func.func @sparse_alloc_copy_CSR(
77
// CHECK-SAME: %[[VAL_0:.*0]]: memref<?xindex>,

mlir/test/Dialect/SparseTensor/convert_sparse2sparse.mlir

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@
2626
}>
2727

2828
#SortedCOO2D = #sparse_tensor.encoding<{
29-
lvlTypes = [ "compressed-nu", "singleton" ],
29+
lvlTypes = [ "compressed_nu", "singleton" ],
3030
}>
3131

3232
#SortedCOO3D = #sparse_tensor.encoding<{
33-
lvlTypes = [ "compressed-nu", "singleton-nu", "singleton" ]
33+
lvlTypes = [ "compressed_nu", "singleton_nu", "singleton" ]
3434

3535
}>
3636

@@ -40,7 +40,7 @@
4040
}>
4141

4242
#COOSlice = #sparse_tensor.encoding<{
43-
lvlTypes = [ "compressed-nu", "singleton" ],
43+
lvlTypes = [ "compressed_nu", "singleton" ],
4444
dimSlices = [ (2, 2, 1), (12, 13, 1) ]
4545
}>
4646

mlir/test/Dialect/SparseTensor/invalid.mlir

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func.func @invalid_pack_type(%values: tensor<6xf64>, %pos: tensor<2xi32>, %coord
3232

3333
// -----
3434

35-
#SparseVector = #sparse_tensor.encoding<{lvlTypes = ["compressed-nu", "singleton"], posWidth=32, crdWidth=32}>
35+
#SparseVector = #sparse_tensor.encoding<{lvlTypes = ["compressed_nu", "singleton"], posWidth=32, crdWidth=32}>
3636

3737
func.func @invalid_pack_type(%values: tensor<6xf64>, %pos: tensor<2xi32>, %coordinates: tensor<6x3xi32>)
3838
-> tensor<100x2xf64, #SparseVector> {
@@ -68,7 +68,7 @@ func.func @invalid_unpack_type(%sp: tensor<100xf32, #SparseVector>, %values: ten
6868

6969
// -----
7070

71-
#SparseVector = #sparse_tensor.encoding<{lvlTypes = ["compressed-nu", "singleton"], posWidth=32, crdWidth=32}>
71+
#SparseVector = #sparse_tensor.encoding<{lvlTypes = ["compressed_nu", "singleton"], posWidth=32, crdWidth=32}>
7272

7373
func.func @invalid_unpack_type(%sp: tensor<100x2xf64, #SparseVector>, %values: tensor<6xf64>, %pos: tensor<2xi32>, %coordinates: tensor<6x3xi32>) {
7474
// expected-error@+1 {{input/output trailing COO level-ranks don't match}}
@@ -270,7 +270,7 @@ func.func @sparse_get_md(%arg0: !sparse_tensor.storage_specifier<#SparseVector>)
270270

271271
// -----
272272

273-
#COO = #sparse_tensor.encoding<{lvlTypes = ["compressed-nu", "singleton"]}>
273+
#COO = #sparse_tensor.encoding<{lvlTypes = ["compressed_nu", "singleton"]}>
274274

275275
func.func @sparse_get_md(%arg0: !sparse_tensor.storage_specifier<#COO>) -> index {
276276
// expected-error@+1 {{requested position memory size on a singleton level}}

mlir/test/Dialect/SparseTensor/pre_rewriting.mlir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
}>
66

77
#SortedCOO = #sparse_tensor.encoding<{
8-
lvlTypes = [ "compressed-nu", "singleton" ]
8+
lvlTypes = [ "compressed_nu", "singleton" ]
99
}>
1010

1111
#DCSR = #sparse_tensor.encoding<{
1212
lvlTypes = ["compressed", "compressed"]
1313
}>
1414

1515
#Slice = #sparse_tensor.encoding<{
16-
lvlTypes = [ "compressed-nu", "singleton" ],
16+
lvlTypes = [ "compressed_nu", "singleton" ],
1717
dimSlices = [ (?, 1, 1), (?, 3, 1) ]
1818
}>
1919

mlir/test/Dialect/SparseTensor/rewriting_for_codegen.mlir

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
}>
1212

1313
#COO = #sparse_tensor.encoding<{
14-
lvlTypes = [ "compressed-nu", "singleton" ]
14+
lvlTypes = [ "compressed_nu", "singleton" ]
1515
}>
1616

1717
// CHECK-LABEL: func.func @sparse_new(
1818
// CHECK-SAME: %[[A:.*]]: !llvm.ptr<i8>) -> tensor<?x?xf32, #sparse_tensor.encoding<{ lvlTypes = [ "dense", "compressed" ] }>> {
19-
// CHECK: %[[COO:.*]] = sparse_tensor.new %[[A]] : !llvm.ptr<i8> to tensor<?x?xf32, #sparse_tensor.encoding<{ lvlTypes = [ "compressed-nu", "singleton" ] }>>
19+
// CHECK: %[[COO:.*]] = sparse_tensor.new %[[A]] : !llvm.ptr<i8> to tensor<?x?xf32, #sparse_tensor.encoding<{ lvlTypes = [ "compressed_nu", "singleton" ] }>>
2020
// CHECK: %[[R:.*]] = sparse_tensor.convert %[[COO]]
2121
// CHECK: bufferization.dealloc_tensor %[[COO]]
2222
// CHECK: return %[[R]]
@@ -27,7 +27,7 @@ func.func @sparse_new(%arg0: !llvm.ptr<i8>) -> tensor<?x?xf32, #CSR> {
2727

2828
// CHECK-LABEL: func.func @sparse_new_csc(
2929
// CHECK-SAME: %[[A:.*]]: !llvm.ptr<i8>) -> tensor<?x?xf32, #sparse_tensor.encoding<{ lvlTypes = [ "dense", "compressed" ], dimToLvl = affine_map<(d0, d1) -> (d1, d0)> }>> {
30-
// CHECK: %[[COO:.*]] = sparse_tensor.new %[[A]] : !llvm.ptr<i8> to tensor<?x?xf32, #sparse_tensor.encoding<{ lvlTypes = [ "compressed-nu", "singleton" ], dimToLvl = affine_map<(d0, d1) -> (d1, d0)> }>>
30+
// CHECK: %[[COO:.*]] = sparse_tensor.new %[[A]] : !llvm.ptr<i8> to tensor<?x?xf32, #sparse_tensor.encoding<{ lvlTypes = [ "compressed_nu", "singleton" ], dimToLvl = affine_map<(d0, d1) -> (d1, d0)> }>>
3131
// CHECK: %[[R:.*]] = sparse_tensor.convert %[[COO]]
3232
// CHECK: bufferization.dealloc_tensor %[[COO]]
3333
// CHECK: return %[[R]]
@@ -37,8 +37,8 @@ func.func @sparse_new_csc(%arg0: !llvm.ptr<i8>) -> tensor<?x?xf32, #CSC> {
3737
}
3838

3939
// CHECK-LABEL: func.func @sparse_new_coo(
40-
// CHECK-SAME: %[[A:.*]]: !llvm.ptr<i8>) -> tensor<?x?xf32, #sparse_tensor.encoding<{ lvlTypes = [ "compressed-nu", "singleton" ] }>> {
41-
// CHECK: %[[COO:.*]] = sparse_tensor.new %[[A]] : !llvm.ptr<i8> to tensor<?x?xf32, #sparse_tensor.encoding<{ lvlTypes = [ "compressed-nu", "singleton" ] }>>
40+
// CHECK-SAME: %[[A:.*]]: !llvm.ptr<i8>) -> tensor<?x?xf32, #sparse_tensor.encoding<{ lvlTypes = [ "compressed_nu", "singleton" ] }>> {
41+
// CHECK: %[[COO:.*]] = sparse_tensor.new %[[A]] : !llvm.ptr<i8> to tensor<?x?xf32, #sparse_tensor.encoding<{ lvlTypes = [ "compressed_nu", "singleton" ] }>>
4242
// CHECK: return %[[COO]]
4343
func.func @sparse_new_coo(%arg0: !llvm.ptr<i8>) -> tensor<?x?xf32, #COO> {
4444
%0 = sparse_tensor.new %arg0 : !llvm.ptr<i8> to tensor<?x?xf32, #COO>

mlir/test/Dialect/SparseTensor/roundtrip.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ func.func @sparse_positions(%arg0: tensor<128xf64, #SparseVector>) -> memref<?xi
103103

104104
// -----
105105

106-
#COO = #sparse_tensor.encoding<{lvlTypes = ["compressed-nu", "singleton"]}>
106+
#COO = #sparse_tensor.encoding<{lvlTypes = ["compressed_nu", "singleton"]}>
107107

108108
// CHECK-LABEL: func @sparse_indices_buffer(
109109
// CHECK-SAME: %[[A:.*]]: tensor<?x?xf64, #{{.*}}>)

mlir/test/Dialect/SparseTensor/roundtrip_encoding.mlir

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,31 +55,31 @@ func.func private @sparse_dcsc(tensor<?x?xf32, #DCSC>)
5555
// -----
5656

5757
#COO = #sparse_tensor.encoding<{
58-
lvlTypes = [ "compressed-nu-no", "singleton-no" ]
58+
lvlTypes = [ "compressed_nu_no", "singleton_no" ]
5959
}>
6060

6161
// CHECK-LABEL: func private @sparse_coo(
62-
// CHECK-SAME: tensor<?x?xf32, #sparse_tensor.encoding<{ lvlTypes = [ "compressed-nu-no", "singleton-no" ] }>>)
62+
// CHECK-SAME: tensor<?x?xf32, #sparse_tensor.encoding<{ lvlTypes = [ "compressed_nu_no", "singleton_no" ] }>>)
6363
func.func private @sparse_coo(tensor<?x?xf32, #COO>)
6464

6565
// -----
6666

6767
#BCOO = #sparse_tensor.encoding<{
68-
lvlTypes = [ "dense", "compressed-hi-nu", "singleton" ]
68+
lvlTypes = [ "dense", "compressed_hi_nu", "singleton" ]
6969
}>
7070

7171
// CHECK-LABEL: func private @sparse_bcoo(
72-
// CHECK-SAME: tensor<?x?x?xf32, #sparse_tensor.encoding<{ lvlTypes = [ "dense", "compressed-hi-nu", "singleton" ] }>>)
72+
// CHECK-SAME: tensor<?x?x?xf32, #sparse_tensor.encoding<{ lvlTypes = [ "dense", "compressed_hi_nu", "singleton" ] }>>)
7373
func.func private @sparse_bcoo(tensor<?x?x?xf32, #BCOO>)
7474

7575
// -----
7676

7777
#SortedCOO = #sparse_tensor.encoding<{
78-
lvlTypes = [ "compressed-nu", "singleton" ]
78+
lvlTypes = [ "compressed_nu", "singleton" ]
7979
}>
8080

8181
// CHECK-LABEL: func private @sparse_sorted_coo(
82-
// CHECK-SAME: tensor<10x10xf64, #sparse_tensor.encoding<{ lvlTypes = [ "compressed-nu", "singleton" ] }>>)
82+
// CHECK-SAME: tensor<10x10xf64, #sparse_tensor.encoding<{ lvlTypes = [ "compressed_nu", "singleton" ] }>>)
8383
func.func private @sparse_sorted_coo(tensor<10x10xf64, #SortedCOO>)
8484

8585
// -----

0 commit comments

Comments
 (0)