[mlir][sparse] Migrate more tests to new syntax (#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: #66146
This commit is contained in:
Yinying Li 2023-09-14 16:21:13 +00:00 committed by GitHub
parent 1db6b127a1
commit e2e429d994
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
68 changed files with 99 additions and 124 deletions

View File

@ -2,7 +2,7 @@
// RUN: mlir-opt %s --mlir-print-op-generic | mlir-opt | FileCheck %s
#CSR = #sparse_tensor.encoding<{
lvlTypes = ["dense", "compressed"]
map = (d0, d1) -> (d0 : dense, d1 : compressed)
}>
// CHECK-LABEL: func @test_clone

View File

@ -854,7 +854,7 @@ func.func @input_stays_same(%arg0 : memref<?x1x?xf32, strided<[?, 1, 1]>>, %arg1
iterator_types = ["parallel", "reduction"]
}
#CSR = #sparse_tensor.encoding<{ lvlTypes = ["dense", "compressed"] }>
#CSR = #sparse_tensor.encoding<{ map = (d0, d1) -> (d0 : dense, d1 : compressed) }>
func.func @sparse_case(%arg0: tensor<8x8xf32, #CSR>, %arg1: tensor<8xf32>) -> tensor<8xf32> {
%0 = tensor.empty() : tensor<8xf32>

View File

@ -3,7 +3,7 @@
// RUN: --sparsification="parallelization-strategy=dense-outer-loop" \
// RUN: --sparse-gpu-codegen | FileCheck %s
#CSR = #sparse_tensor.encoding<{ lvlTypes = [ "dense", "compressed" ] }>
#CSR = #sparse_tensor.encoding<{ map = (d0, d1) -> (d0 : dense, d1 : compressed) }>
//
// CHECK-LABEL: gpu.module @sparse_kernels

View File

@ -3,7 +3,7 @@
// RUN: --sparsification="parallelization-strategy=dense-outer-loop" \
// RUN: --sparse-gpu-codegen | FileCheck %s
#CSR = #sparse_tensor.encoding<{ lvlTypes = [ "dense", "compressed" ] }>
#CSR = #sparse_tensor.encoding<{ map = (d0, d1) -> (d0 : dense, d1 : compressed) }>
//
// Compute matrix matrix C = AB

View File

@ -1,7 +1,7 @@
// RUN: mlir-opt %s --linalg-generalize-named-ops \
// RUN: --sparsification="enable-gpu-libgen" | FileCheck %s
#CSR = #sparse_tensor.encoding<{ lvlTypes = [ "dense", "compressed" ] }>
#CSR = #sparse_tensor.encoding<{ map = (d0, d1) -> (d0 : dense, d1 : compressed) }>
//
// Compute matrix matrix C = AB

View File

@ -3,7 +3,7 @@
// RUN: --sparsification="parallelization-strategy=dense-outer-loop" \
// RUN: --sparse-gpu-codegen | FileCheck %s
#CSR = #sparse_tensor.encoding<{ lvlTypes = [ "dense", "compressed" ] }>
#CSR = #sparse_tensor.encoding<{ map = (d0, d1) -> (d0 : dense, d1 : compressed) }>
//
// Compute matrix vector y = Ax

View File

@ -19,7 +19,7 @@
iterator_types = ["parallel", "parallel"]
}
#CSR = #sparse_tensor.encoding<{ lvlTypes = [ "dense", "compressed" ] }>
#CSR = #sparse_tensor.encoding<{ map = (d0, d1) -> (d0 : dense, d1 : compressed) }>
// CHECK-LABEL: func.func @sparse_sampled_dd(
// CHECK-SAME: %[[VAL_0:.*]]: tensor<8x8xf64, #sparse_tensor.encoding<{ lvlTypes = [ "dense", "compressed" ] }>>,

View File

@ -1,7 +1,7 @@
// RUN: mlir-opt %s --linalg-generalize-named-ops \
// RUN: --sparsification="enable-gpu-libgen" | FileCheck %s
#CSR = #sparse_tensor.encoding<{ lvlTypes = [ "dense", "compressed" ] }>
#CSR = #sparse_tensor.encoding<{ map = (d0, d1) -> (d0 : dense, d1 : compressed) }>
// CHECK-LABEL: func.func @matmulCSR(
// CHECK-SAME: %[[VAL_0:.*0]]: tensor<8x8xf32, #{{.*}}>,

View File

@ -21,7 +21,7 @@
}>
#CSR = #sparse_tensor.encoding<{
lvlTypes = [ "dense", "compressed" ],
map = (d0, d1) -> (d0 : dense, d1 : compressed),
crdWidth = 64,
posWidth = 32
}>
@ -31,8 +31,7 @@
}>
#CSC = #sparse_tensor.encoding<{
lvlTypes = [ "dense", "compressed" ],
dimToLvl = affine_map<(i, j) -> (j, i)>
map = (d0, d1) -> (d1 : dense, d0 : compressed)
}>
#DCSR = #sparse_tensor.encoding<{

View File

@ -1,6 +1,6 @@
// RUN: mlir-opt %s --sparse-tensor-codegen --canonicalize --cse | FileCheck %s
#CSR = #sparse_tensor.encoding<{ lvlTypes = ["dense", "compressed"]}>
#CSR = #sparse_tensor.encoding<{ map = (d0, d1) -> (d0 : dense, d1 : compressed)}>
#COO = #sparse_tensor.encoding<{ lvlTypes = ["compressed_nu", "singleton"]}>
// CHECK-LABEL: func.func @sparse_alloc_copy_CSR(

View File

@ -6,10 +6,9 @@
// RUN: --sparse-tensor-codegen=create-sparse-deallocs=true \
// RUN: --canonicalize --cse | FileCheck %s -check-prefix=CHECK-DEALLOC
#CSR = #sparse_tensor.encoding<{ lvlTypes = ["dense", "compressed"]}>
#CSR = #sparse_tensor.encoding<{ map = (d0, d1) -> (d0 : dense, d1 : compressed)}>
#CSC = #sparse_tensor.encoding<{
lvlTypes = ["dense", "compressed"],
dimToLvl = affine_map<(i,j) -> (j,i)>
map = (d0, d1) -> (d1 : dense, d0 : compressed),
}>
//

View File

@ -17,12 +17,11 @@
}>
#CSR = #sparse_tensor.encoding<{
lvlTypes = ["dense", "compressed"]
map = (d0, d1) -> (d0 : dense, d1 : compressed)
}>
#CSC = #sparse_tensor.encoding<{
lvlTypes = ["dense", "compressed"],
dimToLvl = affine_map<(i,j) -> (j,i)>
map = (d0, d1) -> (d1 : dense, d0 : compressed)
}>
#SparseTensor = #sparse_tensor.encoding<{

View File

@ -7,12 +7,11 @@
}>
#CSR = #sparse_tensor.encoding<{
lvlTypes = ["dense", "compressed"]
map = (d0, d1) -> (d0 : dense, d1 : compressed)
}>
#CSC = #sparse_tensor.encoding<{
lvlTypes = [ "dense", "compressed" ],
dimToLvl = affine_map<(i, j) -> (j, i)>
map = (d0, d1) -> (d1 : dense, d0 : compressed)
}>
#SparseTensor = #sparse_tensor.encoding<{

View File

@ -8,7 +8,7 @@
}>
#SparseMatrix = #sparse_tensor.encoding<{
lvlTypes = ["dense", "compressed"]
map = (d0, d1) -> (d0 : dense, d1 : compressed)
}>
#SparseTensor = #sparse_tensor.encoding<{

View File

@ -44,7 +44,7 @@ func.func @invalid_pack_type(%values: tensor<6xf64>, %pos: tensor<2xi32>, %coord
// -----
#CSR = #sparse_tensor.encoding<{lvlTypes = ["dense", "compressed"], posWidth=32, crdWidth=32}>
#CSR = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : dense, d1 : compressed), posWidth=32, crdWidth=32}>
func.func @invalid_pack_mis_position(%values: tensor<6xf64>, %coordinates: tensor<6xi32>)
-> tensor<2x100xf64, #CSR> {
@ -80,7 +80,7 @@ func.func @invalid_unpack_type(%sp: tensor<100x2xf64, #SparseVector>, %values: t
// -----
#CSR = #sparse_tensor.encoding<{lvlTypes = ["dense", "compressed"], posWidth=32, crdWidth=32}>
#CSR = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : dense, d1 : compressed), posWidth=32, crdWidth=32}>
func.func @invalid_unpack_mis_position(%sp: tensor<2x100xf64, #CSR>, %values: tensor<6xf64>, %coordinates: tensor<6xi32>) {
// expected-error@+1 {{inconsistent number of fields between input/output}}
@ -297,7 +297,7 @@ func.func @sparse_unannotated_insert(%arg0: tensor<128xf64>, %arg1: index, %arg2
// -----
#CSR = #sparse_tensor.encoding<{lvlTypes = ["dense", "compressed"]}>
#CSR = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : dense, d1 : compressed)}>
func.func @sparse_wrong_arity_insert(%arg0: tensor<128x64xf64, #CSR>, %arg1: index, %arg2: f64) {
// expected-error@+1 {{'sparse_tensor.insert' op incorrect number of coordinates}}
@ -347,7 +347,7 @@ func.func @sparse_unannotated_compression(%arg0: memref<?xf64>,
// -----
#CSR = #sparse_tensor.encoding<{lvlTypes = ["dense", "compressed"]}>
#CSR = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : dense, d1 : compressed)}>
func.func @sparse_wrong_arity_compression(%arg0: memref<?xf64>,
%arg1: memref<?xi1>,
@ -381,7 +381,7 @@ func.func @sparse_convert_rank_mismatch(%arg0: tensor<10x10xf64, #DCSR>) -> tens
// -----
#CSR = #sparse_tensor.encoding<{lvlTypes = ["dense", "compressed"]}>
#CSR = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : dense, d1 : compressed)}>
func.func @sparse_convert_dim_mismatch(%arg0: tensor<10x?xf32>) -> tensor<10x10xf32, #CSR> {
// expected-error@+1 {{unexpected conversion mismatch in dimension 1}}
@ -632,7 +632,7 @@ func.func @invalid_select_wrong_yield(%arg0: f64) -> f64 {
// -----
#DC = #sparse_tensor.encoding<{lvlTypes = ["dense", "compressed"]}>
#DC = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : dense, d1 : compressed)}>
func.func @invalid_concat_less_inputs(%arg: tensor<9x4xf64, #DC>) -> tensor<9x4xf64, #DC> {
// expected-error@+1 {{Need at least two tensors to concatenate.}}
%0 = sparse_tensor.concatenate %arg {dimension = 1 : index}
@ -642,7 +642,7 @@ func.func @invalid_concat_less_inputs(%arg: tensor<9x4xf64, #DC>) -> tensor<9x4x
// -----
#DC = #sparse_tensor.encoding<{lvlTypes = ["dense", "compressed"]}>
#DC = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : dense, d1 : compressed)}>
func.func @invalid_concat_dim(%arg0: tensor<2x4xf64, #DC>,
%arg1: tensor<3x4xf64, #DC>,
%arg2: tensor<4x4xf64, #DC>) -> tensor<9x4xf64, #DC> {
@ -657,7 +657,7 @@ func.func @invalid_concat_dim(%arg0: tensor<2x4xf64, #DC>,
// -----
#C = #sparse_tensor.encoding<{map = (d0) -> (d0 : compressed)}>
#DC = #sparse_tensor.encoding<{lvlTypes = ["dense", "compressed"]}>
#DC = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : dense, d1 : compressed)}>
#DCC = #sparse_tensor.encoding<{lvlTypes = ["dense", "compressed", "compressed"]}>
func.func @invalid_concat_rank_mismatch(%arg0: tensor<2xf64, #C>,
%arg1: tensor<3x4xf64, #DC>,
@ -672,7 +672,7 @@ func.func @invalid_concat_rank_mismatch(%arg0: tensor<2xf64, #C>,
// -----
#DC = #sparse_tensor.encoding<{lvlTypes = ["dense", "compressed"]}>
#DC = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : dense, d1 : compressed)}>
func.func @invalid_concat_size_mismatch_dyn(%arg0: tensor<?x4xf64, #DC>,
%arg1: tensor<5x4xf64, #DC>,
%arg2: tensor<4x4xf64, #DC>) -> tensor<9x4xf64, #DC> {
@ -686,7 +686,7 @@ func.func @invalid_concat_size_mismatch_dyn(%arg0: tensor<?x4xf64, #DC>,
// -----
#DC = #sparse_tensor.encoding<{lvlTypes = ["dense", "compressed"]}>
#DC = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : dense, d1 : compressed)}>
func.func @invalid_concat_size_mismatch(%arg0: tensor<3x4xf64, #DC>,
%arg1: tensor<5x4xf64, #DC>,
%arg2: tensor<4x4xf64, #DC>) -> tensor<9x4xf64, #DC> {
@ -700,7 +700,7 @@ func.func @invalid_concat_size_mismatch(%arg0: tensor<3x4xf64, #DC>,
// -----
#DC = #sparse_tensor.encoding<{lvlTypes = ["dense", "compressed"]}>
#DC = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : dense, d1 : compressed)}>
func.func @invalid_concat_size_mismatch(%arg0: tensor<2x4xf64, #DC>,
%arg1: tensor<3x3xf64, #DC>,
%arg2: tensor<4x4xf64, #DC>) -> tensor<9x4xf64, #DC> {
@ -844,7 +844,7 @@ func.func @sparse_sort_coo_y_too_small(%arg0: memref<60xindex>, %arg1: memref<10
// -----
#CSR = #sparse_tensor.encoding<{lvlTypes = ["dense", "compressed"]}>
#CSR = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : dense, d1 : compressed)}>
func.func @sparse_alloc_escapes(%arg0: index) -> tensor<10x?xf64, #CSR> {
// expected-error@+1 {{sparse tensor allocation should not escape function}}

View File

@ -7,13 +7,13 @@ func.func private @scalar(%arg0: tensor<f64, #a>) -> ()
// -----
// expected-error@+2 {{dimension-rank mismatch between encoding and tensor shape: 2 != 1}}
#a = #sparse_tensor.encoding<{lvlTypes = ["dense", "compressed"]}>
#a = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : dense, d1 : compressed)}>
func.func private @tensor_dimlevel_size_mismatch(%arg0: tensor<8xi32, #a>) -> ()
// -----
// expected-error@+1 {{level-rank mismatch between dimToLvl and lvlTypes: 1 != 2}}
#a = #sparse_tensor.encoding<{lvlTypes = ["dense", "compressed"], dimToLvl = affine_map<(i) -> (i)>}>
// expected-error@+1 {{use of undeclared identifier}}
#a = #sparse_tensor.encoding<{map = (d0) -> (d0 : dense, d1 : compressed)}>
func.func private @tensor_sizes_mismatch(%arg0: tensor<8xi32, #a>) -> ()
// -----
@ -34,7 +34,7 @@ func.func private @tensor_dimtolvl_mismatch(%arg0: tensor<8xi32, #a>) -> ()
// -----
// expected-error@+1 {{expected a permutation affine map for dimToLvl}}
#a = #sparse_tensor.encoding<{lvlTypes = ["dense", "compressed"], dimToLvl = affine_map<(i,j) -> (i,i)>}>
#a = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : dense, d0 : compressed)}>
func.func private @tensor_no_permutation(%arg0: tensor<16x32xf32, #a>) -> ()
// -----

View File

@ -1,8 +1,7 @@
// RUN: mlir-opt %s --sparsification-and-bufferization | FileCheck %s
#CSR = #sparse_tensor.encoding<{
lvlTypes = ["dense","compressed"],
dimToLvl = affine_map<(i,j) -> (i,j)>,
map = (d0, d1) -> (d0 : dense, d1 : compressed),
crdWidth = 32,
posWidth = 32
}>

View File

@ -2,12 +2,11 @@
// RUN: FileCheck %s
#CSR = #sparse_tensor.encoding<{
lvlTypes = ["dense", "compressed"]
map = (d0, d1) -> (d0 : dense, d1 : compressed)
}>
#CSC = #sparse_tensor.encoding<{
lvlTypes = [ "dense", "compressed" ],
dimToLvl = affine_map<(i, j) -> (j, i)>
map = (d0, d1) -> (d1 : dense, d0 : compressed)
}>
#COO = #sparse_tensor.encoding<{

View File

@ -1,6 +1,6 @@
// RUN: mlir-opt %s -sparsification | FileCheck %s
#SM = #sparse_tensor.encoding<{ lvlTypes = [ "dense", "compressed" ] }>
#SM = #sparse_tensor.encoding<{ map = (d0, d1) -> (d0 : dense, d1 : compressed) }>
#trait = {
indexing_maps = [

View File

@ -2,7 +2,7 @@
// RUN: mlir-opt %s -sparsification | FileCheck %s
#Tdd = #sparse_tensor.encoding<{ lvlTypes = [ "dense", "dense" ] }>
#Tds = #sparse_tensor.encoding<{ lvlTypes = [ "dense", "compressed" ] }>
#Tds = #sparse_tensor.encoding<{ map = (d0, d1) -> (d0 : dense, d1 : compressed) }>
#Tsd = #sparse_tensor.encoding<{ lvlTypes = [ "compressed", "dense" ] }>
#Tss = #sparse_tensor.encoding<{ lvlTypes = [ "compressed", "compressed" ] }>

View File

@ -2,7 +2,7 @@
// RUN: mlir-opt %s -sparsification | FileCheck %s
#SpVec = #sparse_tensor.encoding<{ map = (d0) -> (d0 : compressed) }>
#CSR = #sparse_tensor.encoding<{ lvlTypes = [ "dense", "compressed" ] }>
#CSR = #sparse_tensor.encoding<{ map = (d0, d1) -> (d0 : dense, d1 : compressed) }>
#Row = #sparse_tensor.encoding<{ lvlTypes = [ "compressed", "dense" ] }>
#EncDenseVec = #sparse_tensor.encoding<{ map = (d0) -> (d0 : dense) }>

View File

@ -8,12 +8,11 @@
// RUN: FileCheck %s --check-prefix=CHECK-CONVERT
#CSR = #sparse_tensor.encoding<{
lvlTypes = [ "dense", "compressed" ]
map = (d0, d1) -> (d0 : dense, d1 : compressed)
}>
#CSC = #sparse_tensor.encoding<{
lvlTypes = [ "dense", "compressed" ],
dimToLvl = affine_map<(i,j) -> (j,i)>
map = (d0, d1) -> (d1 : dense, d0 : compressed)
}>
#DCSC = #sparse_tensor.encoding<{

View File

@ -1,7 +1,7 @@
// RUN: mlir-opt %s --sparse-tensor-codegen --cse | FileCheck %s
#CSR = #sparse_tensor.encoding<{
lvlTypes = [ "dense", "compressed" ]
map = (d0, d1) -> (d0 : dense, d1 : compressed)
}>
#CSR_SLICE = #sparse_tensor.encoding<{

View File

@ -8,7 +8,7 @@
// RUN: --tensor-bufferize --finalizing-bufferize | \
// RUN: FileCheck %s --check-prefix=CHECK-LIR
#CSR = #sparse_tensor.encoding<{lvlTypes = [ "dense", "compressed" ]}>
#CSR = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : dense, d1 : compressed)}>
#trait_matvec = {
indexing_maps = [

View File

@ -9,8 +9,7 @@
// RUN: FileCheck %s --check-prefix=CHECK-LIR
#CSC = #sparse_tensor.encoding<{
lvlTypes = [ "dense", "compressed" ],
dimToLvl = affine_map<(i,j) -> (j,i)>
map = (d0, d1) -> (d1 : dense, d0 : compressed)
}>
#trait_matvec = {

View File

@ -8,7 +8,7 @@
// RUN: --tensor-bufferize --finalizing-bufferize | \
// RUN: FileCheck %s --check-prefix=CHECK-LIR
#CSR = #sparse_tensor.encoding<{lvlTypes = [ "dense", "compressed" ]}>
#CSR = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : dense, d1 : compressed)}>
#trait_matvec = {
indexing_maps = [

View File

@ -5,8 +5,7 @@
// RUN: --canonicalize --cse | FileCheck %s
#CSR = #sparse_tensor.encoding<{
lvlTypes = [ "dense", "compressed" ],
dimToLvl = affine_map<(i,j) -> (i,j)>
map = (d0, d1) -> (d0 : dense, d1 : compressed)
}>
//

View File

@ -1,8 +1,7 @@
// RUN: mlir-opt %s -sparsification | FileCheck %s
#CSR = #sparse_tensor.encoding<{
lvlTypes = [ "dense", "compressed" ],
dimToLvl = affine_map<(i,j) -> (i,j)>
map = (d0, d1) -> (d0 : dense, d1 : compressed),
}>
#DCSR = #sparse_tensor.encoding<{

View File

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

View File

@ -2,7 +2,7 @@
// RUN: FileCheck %s
#CSR = #sparse_tensor.encoding<{
lvlTypes = [ "dense", "compressed" ]
map = (d0, d1) -> (d0 : dense, d1 : compressed)
}>
#trait_matvec = {

View File

@ -309,7 +309,7 @@ func.func @reduction_d(%arga: tensor<1024xf32, #DenseVector>,
// -----
#SparseMatrix = #sparse_tensor.encoding<{
lvlTypes = [ "dense", "compressed" ],
map = (d0, d1) -> (d0 : dense, d1 : compressed),
posWidth = 32,
crdWidth = 32
}>
@ -448,7 +448,7 @@ func.func @mul_ds(%arga: tensor<512x1024xf32, #SparseMatrix>,
// -----
#SparseMatrix = #sparse_tensor.encoding<{lvlTypes = ["dense","compressed"]}>
#SparseMatrix = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : dense, d1 : compressed)}>
#trait_affine = {
indexing_maps = [

View File

@ -1,7 +1,7 @@
// RUN: mlir-opt %s -sparsification -cse -sparse-vectorization="vl=8" -cse | \
// RUN: FileCheck %s
#SparseMatrix = #sparse_tensor.encoding<{lvlTypes = ["dense","compressed"]}>
#SparseMatrix = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : dense, d1 : compressed)}>
#trait = {
indexing_maps = [

View File

@ -1,7 +1,7 @@
// RUN: mlir-opt %s --sparse-compiler="enable-runtime-library=false vl=2 reassociate-fp-reductions=true enable-index-optimizations=true"
#MAT_D_C = #sparse_tensor.encoding<{
lvlTypes = ["dense", "compressed"]
map = (d0, d1) -> (d0 : dense, d1 : compressed)
}>
#MAT_C_C_P = #sparse_tensor.encoding<{

View File

@ -1,6 +1,6 @@
// RUN: mlir-opt %s -sparse-storage-specifier-to-llvm --cse --canonicalize | FileCheck %s
#CSR = #sparse_tensor.encoding<{lvlTypes = ["dense", "compressed"]}>
#CSR = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : dense, d1 : compressed)}>
// CHECK-LABEL: func.func @sparse_metadata_init() -> !llvm.struct<(array<2 x i64>, array<3 x i64>)> {
// CHECK: %[[VAL_0:.*]] = arith.constant 0 : i64

View File

@ -5,7 +5,7 @@
// in-place update of the sampling sparse matrix.
//
#SM = #sparse_tensor.encoding<{ lvlTypes = [ "dense", "compressed" ] }>
#SM = #sparse_tensor.encoding<{ map = (d0, d1) -> (d0 : dense, d1 : compressed) }>
#trait_sampled_dense_dense = {
indexing_maps = [

View File

@ -25,7 +25,7 @@ module attributes { transform.with_named_sequence } {
}
}
#CSR = #sparse_tensor.encoding<{lvlTypes = ["dense", "compressed"]}>
#CSR = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : dense, d1 : compressed)}>
func.func @payload(%lhs: tensor<10x20xf16>,
%sp_lhs: tensor<10x20xf16, #CSR>,

View File

@ -7,7 +7,7 @@
// compiler still generates the correct loop nest for this case.
//
#SM = #sparse_tensor.encoding<{ lvlTypes = [ "dense", "compressed" ] }>
#SM = #sparse_tensor.encoding<{ map = (d0, d1) -> (d0 : dense, d1 : compressed) }>
#trait = {
indexing_maps = [

View File

@ -31,7 +31,7 @@
// RUN: %if mlir_arm_sve_tests %{ %{compile_sve} | %{run_sve} | FileCheck %s %}
#MAT_C_C = #sparse_tensor.encoding<{lvlTypes = ["compressed", "compressed"]}>
#MAT_D_C = #sparse_tensor.encoding<{lvlTypes = ["dense", "compressed"]}>
#MAT_D_C = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : dense, d1 : compressed)}>
#MAT_C_D = #sparse_tensor.encoding<{lvlTypes = ["compressed", "dense"]}>
#MAT_D_D = #sparse_tensor.encoding<{
lvlTypes = ["dense", "dense"],
@ -49,8 +49,7 @@
}>
#MAT_D_C_P = #sparse_tensor.encoding<{
lvlTypes = [ "dense", "compressed" ],
dimToLvl = affine_map<(i,j) -> (j,i)>
map = (d0, d1) -> (d1 : dense, d0 : compressed)
}>
module {

View File

@ -31,7 +31,7 @@
// RUN: %if mlir_arm_sve_tests %{ %{compile_sve} | %{run_sve} | FileCheck %s %}
#MAT_C_C = #sparse_tensor.encoding<{lvlTypes = ["compressed", "compressed"]}>
#MAT_D_C = #sparse_tensor.encoding<{lvlTypes = ["dense", "compressed"]}>
#MAT_D_C = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : dense, d1 : compressed)}>
#MAT_C_D = #sparse_tensor.encoding<{lvlTypes = ["compressed", "dense"]}>
#MAT_D_D = #sparse_tensor.encoding<{
lvlTypes = ["dense", "dense"],
@ -49,8 +49,7 @@
}>
#MAT_D_C_P = #sparse_tensor.encoding<{
lvlTypes = [ "dense", "compressed" ],
dimToLvl = affine_map<(i,j) -> (j,i)>
map = (d0, d1) -> (d1 : dense, d0 : compressed)
}>
module {

View File

@ -28,7 +28,7 @@
// RUN: %{compile} | %{run} | FileCheck %s
#MAT_C_C = #sparse_tensor.encoding<{lvlTypes = ["compressed", "compressed"]}>
#MAT_D_C = #sparse_tensor.encoding<{lvlTypes = ["dense", "compressed"]}>
#MAT_D_C = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : dense, d1 : compressed)}>
#MAT_C_D = #sparse_tensor.encoding<{lvlTypes = ["compressed", "dense"]}>
#MAT_D_D = #sparse_tensor.encoding<{
lvlTypes = ["dense", "dense"],
@ -46,8 +46,7 @@
}>
#MAT_D_C_P = #sparse_tensor.encoding<{
lvlTypes = [ "dense", "compressed" ],
dimToLvl = affine_map<(i,j) -> (j,i)>
map = (d0, d1) -> (d1 : dense, d0 : compressed)
}>
module {

View File

@ -31,7 +31,7 @@
// RUN: %if mlir_arm_sve_tests %{ %{compile_sve} | %{run_sve} | FileCheck %s %}
#MAT_C_C = #sparse_tensor.encoding<{lvlTypes = ["compressed", "compressed"]}>
#MAT_D_C = #sparse_tensor.encoding<{lvlTypes = ["dense", "compressed"]}>
#MAT_D_C = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : dense, d1 : compressed)}>
#MAT_C_D = #sparse_tensor.encoding<{lvlTypes = ["compressed", "dense"]}>
#MAT_D_D = #sparse_tensor.encoding<{
lvlTypes = ["dense", "dense"],
@ -49,8 +49,7 @@
}>
#MAT_D_C_P = #sparse_tensor.encoding<{
lvlTypes = [ "dense", "compressed" ],
dimToLvl = affine_map<(i,j) -> (j,i)>
map = (d0, d1) -> (d1 : dense, d0 : compressed)
}>
module {

View File

@ -39,8 +39,7 @@
}>
#SparseMatrix = #sparse_tensor.encoding<{
lvlTypes = [ "dense", "compressed" ],
dimToLvl = affine_map<(i,j) -> (i,j)>
map = (d0, d1) -> (d0 : dense, d1 : compressed),
}>
#trait_assign = {

View File

@ -31,11 +31,10 @@
// RUN: %if mlir_arm_sve_tests %{ %{compile_sve} | %{run_sve} | FileCheck %s %}
#DCSR = #sparse_tensor.encoding<{ lvlTypes = [ "compressed", "compressed" ] }>
#CSR = #sparse_tensor.encoding<{lvlTypes = ["dense", "compressed"]}>
#CSR = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : dense, d1 : compressed)}>
#CDR = #sparse_tensor.encoding<{lvlTypes = ["compressed", "dense"]}>
#CSC = #sparse_tensor.encoding<{
lvlTypes = [ "dense", "compressed" ],
dimToLvl = affine_map<(i,j) -> (j,i)>
map = (d0, d1) -> (d1 : dense, d0 : compressed)
}>
// An example of a 2D convolution with a sparse filter.

View File

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

View File

@ -31,11 +31,10 @@
// RUN: %if mlir_arm_sve_tests %{ %{compile_sve} | %{run_sve} | FileCheck %s %}
#DCSR = #sparse_tensor.encoding<{ lvlTypes = [ "compressed", "compressed" ] }>
#CSR = #sparse_tensor.encoding<{lvlTypes = ["dense", "compressed"]}>
#CSR = #sparse_tensor.encoding<{ map = (d0, d1) -> (d0 : dense, d1 : compressed) }>
#CDR = #sparse_tensor.encoding<{lvlTypes = ["compressed", "dense"]}>
#CSC = #sparse_tensor.encoding<{
lvlTypes = [ "dense", "compressed" ],
dimToLvl = affine_map<(i,j) -> (j,i)>
map = (d0, d1) -> (d1 : dense, d0 : compressed)
}>
// An example of a 2D convolution with a sparse filter.

View File

@ -44,8 +44,7 @@
}>
#CSC = #sparse_tensor.encoding<{
lvlTypes = [ "dense", "compressed" ],
dimToLvl = affine_map<(i,j) -> (j,i)>,
map = (d0, d1) -> (d1 : dense, d0 : compressed),
posWidth = 16,
crdWidth = 32
}>

View File

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

View File

@ -31,8 +31,7 @@
// RUN: %if mlir_arm_sve_tests %{ %{compile_sve} | %{run_sve} | FileCheck %s %}
#CSC = #sparse_tensor.encoding<{
lvlTypes = [ "dense", "compressed" ],
dimToLvl = affine_map<(i,j) -> (j,i)>
map = (d0, d1) -> (d1 : dense, d0 : compressed)
}>
module {

View File

@ -24,7 +24,7 @@
// TODO: support slices on lib path
#CSR = #sparse_tensor.encoding<{
lvlTypes = [ "dense", "compressed" ]
map = (d0, d1) -> (d0 : dense, d1 : compressed)
}>
#CSR_SLICE = #sparse_tensor.encoding<{

View File

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

View File

@ -41,8 +41,7 @@
// TODO: Investigate the output generated for SVE, see https://github.com/llvm/llvm-project/issues/60626
#CSR = #sparse_tensor.encoding<{
lvlTypes = [ "dense", "compressed" ],
dimToLvl = affine_map<(i,j) -> (i,j)>
map = (d0, d1) -> (d0 : dense, d1 : compressed)
}>
#DCSR = #sparse_tensor.encoding<{

View File

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

View File

@ -43,7 +43,7 @@
!Filename = !llvm.ptr<i8>
#SparseMatrix = #sparse_tensor.encoding<{
lvlTypes = [ "dense", "compressed" ],
map = (d0, d1) -> (d0 : dense, d1 : compressed),
posWidth = 8,
crdWidth = 8
}>

View File

@ -37,7 +37,7 @@
}>
#CSR = #sparse_tensor.encoding<{
lvlTypes = [ "dense", "compressed" ],
map = (d0, d1) -> (d0 : dense, d1 : compressed),
posWidth = 32,
crdWidth = 32
}>

View File

@ -37,7 +37,7 @@
}>
#CSR = #sparse_tensor.encoding<{
lvlTypes = [ "dense", "compressed" ],
map = (d0, d1) -> (d0 : dense, d1 : compressed),
posWidth = 32,
crdWidth = 32
}>

View File

@ -33,10 +33,9 @@
// Reduction in this file _are_ supported by the AArch64 SVE backend
#SparseVector = #sparse_tensor.encoding<{map = (d0) -> (d0 : compressed)}>
#CSR = #sparse_tensor.encoding<{lvlTypes = ["dense", "compressed"]}>
#CSR = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : dense, d1 : compressed)}>
#CSC = #sparse_tensor.encoding<{
lvlTypes = [ "dense", "compressed" ],
dimToLvl = affine_map<(i,j) -> (j,i)>
map = (d0, d1) -> (d1 : dense, d0 : compressed)
}>
//

View File

@ -32,10 +32,9 @@
// sparse_reducitons.mlir)
#SparseVector = #sparse_tensor.encoding<{map = (d0) -> (d0 : compressed)}>
#CSR = #sparse_tensor.encoding<{lvlTypes = ["dense", "compressed"]}>
#CSR = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : dense, d1 : compressed)}>
#CSC = #sparse_tensor.encoding<{
lvlTypes = [ "dense", "compressed" ],
dimToLvl = affine_map<(i,j) -> (j,i)>
map = (d0, d1) -> (d1 : dense, d0 : compressed)
}>
//

View File

@ -30,7 +30,7 @@
// Do the same run, but now with VLA vectorization.
// RUN: %if mlir_arm_sve_tests %{ %{compile_sve} | %{run_sve} | FileCheck %s %}
#CSR = #sparse_tensor.encoding<{ lvlTypes = [ "dense", "compressed" ] }>
#CSR = #sparse_tensor.encoding<{ map = (d0, d1) -> (d0 : dense, d1 : compressed) }>
#trait_scale = {
indexing_maps = [

View File

@ -31,10 +31,9 @@
// RUN: %if mlir_arm_sve_tests %{ %{compile_sve} | %{run_sve} | FileCheck %s %}
#SparseVector = #sparse_tensor.encoding<{map = (d0) -> (d0 : compressed)}>
#CSR = #sparse_tensor.encoding<{lvlTypes = ["dense", "compressed"]}>
#CSR = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : dense, d1 : compressed)}>
#CSC = #sparse_tensor.encoding<{
lvlTypes = [ "dense", "compressed" ],
dimToLvl = affine_map<(i,j) -> (j,i)>
map = (d0, d1) -> (d1 : dense, d0 : compressed)
}>
//

View File

@ -34,7 +34,7 @@
!Filename = !llvm.ptr<i8>
#SparseMatrix = #sparse_tensor.encoding<{
lvlTypes = [ "dense", "compressed" ]
map = (d0, d1) -> (d0 : dense, d1 : compressed)
}>
#spmm = {

View File

@ -39,7 +39,7 @@
}>
#CSR = #sparse_tensor.encoding<{
lvlTypes = [ "dense", "compressed" ]
map = (d0, d1) -> (d0 : dense, d1 : compressed)
}>
#DCSR = #sparse_tensor.encoding<{
@ -47,8 +47,7 @@
}>
#CSC = #sparse_tensor.encoding<{
lvlTypes = [ "dense", "compressed" ],
dimToLvl = affine_map<(i,j) -> (j,i)>
map = (d0, d1) -> (d1 : dense, d0 : compressed)
}>
#DCSC = #sparse_tensor.encoding<{

View File

@ -22,7 +22,7 @@
// RUN: | FileCheck %s
#CSR = #sparse_tensor.encoding<{
lvlTypes = [ "dense", "compressed" ],
map = (d0, d1) -> (d0 : dense, d1 : compressed),
posWidth = 32,
crdWidth = 32
}>

View File

@ -29,7 +29,7 @@
}>
#CSR = #sparse_tensor.encoding<{
lvlTypes = [ "dense", "compressed" ],
map = (d0, d1) -> (d0 : dense, d1 : compressed),
posWidth = 32,
crdWidth = 32
}>

View File

@ -9,7 +9,7 @@
// RUN: --e main --entry-point-result=void \
// RUN: | FileCheck %s
#CSR = #sparse_tensor.encoding<{ lvlTypes = [ "dense", "compressed" ] }>
#CSR = #sparse_tensor.encoding<{ map = (d0, d1) -> (d0 : dense, d1 : compressed) }>
module {
// Compute matrix vector y = Ax

View File

@ -29,7 +29,7 @@
}>
#CSR = #sparse_tensor.encoding<{
lvlTypes = [ "dense", "compressed" ],
map = (d0, d1) -> (d0 : dense, d1 : compressed),
posWidth = 32,
crdWidth = 32
}>

View File

@ -9,7 +9,7 @@
// RUN: --e main --entry-point-result=void \
// RUN: | FileCheck %s
#CSR = #sparse_tensor.encoding<{ lvlTypes = [ "dense", "compressed" ] }>
#CSR = #sparse_tensor.encoding<{ map = (d0, d1) -> (d0 : dense, d1 : compressed) }>
module {
// Compute matrix vector y = Ax

View File

@ -28,7 +28,7 @@
!Filename = !llvm.ptr<i8>
#CSR = #sparse_tensor.encoding<{
lvlTypes = ["dense", "compressed"]
map = (d0, d1) -> (d0 : dense, d1 : compressed)
}>
#trait_sampled_dense_dense = {

View File

@ -56,8 +56,7 @@ def testEncodingAttr2D():
with Context() as ctx:
parsed = Attribute.parse(
"#sparse_tensor.encoding<{"
' lvlTypes = [ "dense", "compressed" ],'
" dimToLvl = affine_map<(d0, d1) -> (d1, d0)>,"
" map = (d0, d1) -> (d1 : dense, d0 : compressed),"
" posWidth = 8,"
" crdWidth = 32"
"}>"