Skip to content

Commit 098ad0d

Browse files
yinying-lisa-liZijunZhaoCCK
authored andcommitted
[mlir][sparse] Migrate more tests to new syntax (llvm#66309)
CSR: `lvlTypes = [ "dense", "compressed" ]` to `map = (d0, d1) -> (d0 : dense, d1 : compressed)` CSC: `lvlTypes = [ "dense", "compressed" ], dimToLvl = affine_map<(d0, d1) -> (d1, d0)>` to `map = (d0, d1) -> (d1 : dense, d0 : compressed)` This is an ongoing effort: llvm#66146
1 parent bb5ac38 commit 098ad0d

File tree

68 files changed

+99
-124
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+99
-124
lines changed

mlir/test/Dialect/Bufferization/ops.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: mlir-opt %s --mlir-print-op-generic | mlir-opt | FileCheck %s
33

44
#CSR = #sparse_tensor.encoding<{
5-
lvlTypes = ["dense", "compressed"]
5+
map = (d0, d1) -> (d0 : dense, d1 : compressed)
66
}>
77

88
// CHECK-LABEL: func @test_clone

mlir/test/Dialect/Linalg/drop-unit-extent-dims.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,7 @@ func.func @input_stays_same(%arg0 : memref<?x1x?xf32, strided<[?, 1, 1]>>, %arg1
854854
iterator_types = ["parallel", "reduction"]
855855
}
856856

857-
#CSR = #sparse_tensor.encoding<{ lvlTypes = ["dense", "compressed"] }>
857+
#CSR = #sparse_tensor.encoding<{ map = (d0, d1) -> (d0 : dense, d1 : compressed) }>
858858

859859
func.func @sparse_case(%arg0: tensor<8x8xf32, #CSR>, %arg1: tensor<8xf32>) -> tensor<8xf32> {
860860
%0 = tensor.empty() : tensor<8xf32>

mlir/test/Dialect/SparseTensor/GPU/gpu_combi.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// RUN: --sparsification="parallelization-strategy=dense-outer-loop" \
44
// RUN: --sparse-gpu-codegen | FileCheck %s
55

6-
#CSR = #sparse_tensor.encoding<{ lvlTypes = [ "dense", "compressed" ] }>
6+
#CSR = #sparse_tensor.encoding<{ map = (d0, d1) -> (d0 : dense, d1 : compressed) }>
77

88
//
99
// CHECK-LABEL: gpu.module @sparse_kernels

mlir/test/Dialect/SparseTensor/GPU/gpu_matmul.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// RUN: --sparsification="parallelization-strategy=dense-outer-loop" \
44
// RUN: --sparse-gpu-codegen | FileCheck %s
55

6-
#CSR = #sparse_tensor.encoding<{ lvlTypes = [ "dense", "compressed" ] }>
6+
#CSR = #sparse_tensor.encoding<{ map = (d0, d1) -> (d0 : dense, d1 : compressed) }>
77

88
//
99
// Compute matrix matrix C = AB

mlir/test/Dialect/SparseTensor/GPU/gpu_matmul_lib.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: mlir-opt %s --linalg-generalize-named-ops \
22
// RUN: --sparsification="enable-gpu-libgen" | FileCheck %s
33

4-
#CSR = #sparse_tensor.encoding<{ lvlTypes = [ "dense", "compressed" ] }>
4+
#CSR = #sparse_tensor.encoding<{ map = (d0, d1) -> (d0 : dense, d1 : compressed) }>
55

66
//
77
// Compute matrix matrix C = AB

mlir/test/Dialect/SparseTensor/GPU/gpu_matvec.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// RUN: --sparsification="parallelization-strategy=dense-outer-loop" \
44
// RUN: --sparse-gpu-codegen | FileCheck %s
55

6-
#CSR = #sparse_tensor.encoding<{ lvlTypes = [ "dense", "compressed" ] }>
6+
#CSR = #sparse_tensor.encoding<{ map = (d0, d1) -> (d0 : dense, d1 : compressed) }>
77

88
//
99
// Compute matrix vector y = Ax

mlir/test/Dialect/SparseTensor/GPU/gpu_sampled_matmul_lib.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
iterator_types = ["parallel", "parallel"]
2020
}
2121

22-
#CSR = #sparse_tensor.encoding<{ lvlTypes = [ "dense", "compressed" ] }>
22+
#CSR = #sparse_tensor.encoding<{ map = (d0, d1) -> (d0 : dense, d1 : compressed) }>
2323

2424
// CHECK-LABEL: func.func @sparse_sampled_dd(
2525
// CHECK-SAME: %[[VAL_0:.*]]: tensor<8x8xf64, #sparse_tensor.encoding<{ lvlTypes = [ "dense", "compressed" ] }>>,

mlir/test/Dialect/SparseTensor/GPU/gpu_spgemm_lib.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: mlir-opt %s --linalg-generalize-named-ops \
22
// RUN: --sparsification="enable-gpu-libgen" | FileCheck %s
33

4-
#CSR = #sparse_tensor.encoding<{ lvlTypes = [ "dense", "compressed" ] }>
4+
#CSR = #sparse_tensor.encoding<{ map = (d0, d1) -> (d0 : dense, d1 : compressed) }>
55

66
// CHECK-LABEL: func.func @matmulCSR(
77
// CHECK-SAME: %[[VAL_0:.*0]]: tensor<8x8xf32, #{{.*}}>,

mlir/test/Dialect/SparseTensor/codegen.mlir

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
}>
2222

2323
#CSR = #sparse_tensor.encoding<{
24-
lvlTypes = [ "dense", "compressed" ],
24+
map = (d0, d1) -> (d0 : dense, d1 : compressed),
2525
crdWidth = 64,
2626
posWidth = 32
2727
}>
@@ -31,8 +31,7 @@
3131
}>
3232

3333
#CSC = #sparse_tensor.encoding<{
34-
lvlTypes = [ "dense", "compressed" ],
35-
dimToLvl = affine_map<(i, j) -> (j, i)>
34+
map = (d0, d1) -> (d1 : dense, d0 : compressed)
3635
}>
3736

3837
#DCSR = #sparse_tensor.encoding<{

mlir/test/Dialect/SparseTensor/codegen_sparse_alloc.mlir

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

3-
#CSR = #sparse_tensor.encoding<{ lvlTypes = ["dense", "compressed"]}>
3+
#CSR = #sparse_tensor.encoding<{ map = (d0, d1) -> (d0 : dense, d1 : compressed)}>
44
#COO = #sparse_tensor.encoding<{ lvlTypes = ["compressed_nu", "singleton"]}>
55

66
// CHECK-LABEL: func.func @sparse_alloc_copy_CSR(

0 commit comments

Comments
 (0)