Skip to content

Commit

Permalink
[mlir][sparse] Migrate more tests to use new syntax (#66443)
Browse files Browse the repository at this point in the history
**Dense**
`lvlTypes = [ "dense", "dense" ]` to `map = (d0, d1) -> (d0 : dense, d1
: dense)`
`lvlTypes = [ "dense", "dense" ], dimToLvl = affine_map<(i,j) -> (j,i)>`
to `map = (d0, d1) -> (d1 : dense, d0 : dense)`

**DCSR**
`lvlTypes = [ "compressed", "compressed" ]` to `map = (d0, d1) -> (d0 :
compressed, d1 : compressed)`

**DCSC**
`lvlTypes = [ "compressed", "compressed" ], dimToLvl = affine_map<(i,j)
-> (j,i)>` to `map = (d0, d1) -> (d1 : compressed, d0 : compressed)`

**Block Row**
`lvlTypes = [ "compressed", "dense" ]` to `map = (d0, d1) -> (d0 :
compressed, d1 : dense)`

**Block Column**
`lvlTypes = [ "compressed", "dense" ], dimToLvl = affine_map<(i,j) ->
(j,i)>` to `map = (d0, d1) -> (d1 : compressed, d0 : dense)`

This is an ongoing effort: #66146, #66309
  • Loading branch information
yinying-lisa-li authored Sep 14, 2023
1 parent 4db6803 commit 2a07f0f
Show file tree
Hide file tree
Showing 69 changed files with 128 additions and 165 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,7 @@ def SparseTensorEncodingAttr : SparseTensor_Attr<"SparseTensorEncoding",

// Doubly compressed sparse column storage with specific bitwidths.
#DCSC = #sparse_tensor.encoding<{
lvlTypes = [ "compressed", "compressed" ],
dimToLvl = affine_map<(i, j) -> (j, i)>,
map = (d0, d1) -> (d1 : compressed, d0 : compressed),
posWidth = 32,
crdWidth = 8
}>
Expand Down
3 changes: 1 addition & 2 deletions mlir/lib/Dialect/SparseTensor/Transforms/Sparsification.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,7 @@ static bool findDepIdxSet(Merger &merger, TensorId tensor, Level lvl,
/// Get the total number of compound affine expressions in the
/// `getMatchingIndexingMap` for the given tensor. For the following inputs:
///
/// map = (d0, d1, d2) => (d0 + d1, d2)
/// lvlTypes = ["compressed", "compressed"]
/// map = (d0, d1, d2) => (d0 + d1 : compressed, d2 : compressed)
///
/// Returns 1 (because the first level is compressed and its corresponding
/// indexing-expression is `d0 + d1`)
Expand Down
4 changes: 2 additions & 2 deletions mlir/test/Dialect/Bufferization/invalid.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func.func @escape_attr_non_bufferizable(%m0: memref<?xf32>) {

// -----

#DCSR = #sparse_tensor.encoding<{ lvlTypes = [ "compressed", "compressed" ] }>
#DCSR = #sparse_tensor.encoding<{ map = (d0, d1) -> (d0 : compressed, d1 : compressed) }>

func.func @sparse_alloc_direct_return() -> tensor<20x40xf32, #DCSR> {
// expected-error @+1{{sparse tensor allocation should not escape function}}
Expand All @@ -68,7 +68,7 @@ func.func @sparse_alloc_direct_return() -> tensor<20x40xf32, #DCSR> {

// -----

#DCSR = #sparse_tensor.encoding<{ lvlTypes = [ "compressed", "compressed" ] }>
#DCSR = #sparse_tensor.encoding<{ map = (d0, d1) -> (d0 : compressed, d1 : compressed) }>

func.func private @foo(tensor<20x40xf32, #DCSR>) -> ()

Expand Down
6 changes: 3 additions & 3 deletions mlir/test/Dialect/SparseTensor/codegen.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
}>

#Dense2D = #sparse_tensor.encoding<{
lvlTypes = [ "dense", "dense" ],
map = (d0, d1) -> (d0 : dense, d1 : dense),
crdWidth = 64,
posWidth = 32
}>

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

#DCSR = #sparse_tensor.encoding<{
lvlTypes = [ "compressed", "compressed" ],
map = (d0, d1) -> (d0 : compressed, d1 : compressed),
crdWidth = 64,
posWidth = 32
}>
Expand Down
2 changes: 1 addition & 1 deletion mlir/test/Dialect/SparseTensor/dense.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// latter class is linearized into one-dimensional buffers that are backed
// by the runtime support library.

#DenseMatrix = #sparse_tensor.encoding<{ lvlTypes = [ "dense", "dense" ] }>
#DenseMatrix = #sparse_tensor.encoding<{ map = (d0, d1) -> (d0 : dense, d1 : dense) }>

#trait_2d = {
indexing_maps = [
Expand Down
16 changes: 8 additions & 8 deletions mlir/test/Dialect/SparseTensor/invalid.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ func.func @sparse_convert_unranked(%arg0: tensor<*xf32>) -> tensor<10xf32> {

// -----

#DCSR = #sparse_tensor.encoding<{lvlTypes = ["compressed", "compressed"]}>
#DCSR = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : compressed, d1 : compressed)}>

func.func @sparse_convert_rank_mismatch(%arg0: tensor<10x10xf64, #DCSR>) -> tensor<?xf64> {
// expected-error@+1 {{unexpected conversion mismatch in rank}}
Expand Down Expand Up @@ -714,7 +714,7 @@ func.func @invalid_concat_size_mismatch(%arg0: tensor<2x4xf64, #DC>,

// -----

#DCSR = #sparse_tensor.encoding<{lvlTypes = ["compressed", "compressed"]}>
#DCSR = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : compressed, d1 : compressed)}>
func.func @sparse_tensor_foreach(%arg0: tensor<2x4xf64, #DCSR>) -> () {
// expected-error@+1 {{Unmatched number of arguments in the block}}
sparse_tensor.foreach in %arg0 : tensor<2x4xf64, #DCSR> do {
Expand All @@ -725,7 +725,7 @@ func.func @sparse_tensor_foreach(%arg0: tensor<2x4xf64, #DCSR>) -> () {

// -----

#DCSR = #sparse_tensor.encoding<{lvlTypes = ["compressed", "compressed"]}>
#DCSR = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : compressed, d1 : compressed)}>
func.func @sparse_tensor_foreach(%arg0: tensor<2x4xf64, #DCSR>) -> () {
// expected-error@+1 {{Expecting Index type for argument at index 1}}
sparse_tensor.foreach in %arg0 : tensor<2x4xf64, #DCSR> do {
Expand All @@ -736,7 +736,7 @@ func.func @sparse_tensor_foreach(%arg0: tensor<2x4xf64, #DCSR>) -> () {

// -----

#DCSR = #sparse_tensor.encoding<{lvlTypes = ["compressed", "compressed"]}>
#DCSR = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : compressed, d1 : compressed)}>
func.func @sparse_tensor_foreach(%arg0: tensor<2x4xf64, #DCSR>) -> () {
// expected-error@+1 {{Unmatched element type between input tensor and block argument}}
sparse_tensor.foreach in %arg0 : tensor<2x4xf64, #DCSR> do {
Expand All @@ -747,7 +747,7 @@ func.func @sparse_tensor_foreach(%arg0: tensor<2x4xf64, #DCSR>) -> () {

// -----

#DCSR = #sparse_tensor.encoding<{lvlTypes = ["compressed", "compressed"]}>
#DCSR = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : compressed, d1 : compressed)}>
func.func @sparse_tensor_foreach(%arg0: tensor<2x4xf64, #DCSR>) -> () {
// expected-error@+1 {{Unmatched element type between input tensor and block argument}}
sparse_tensor.foreach in %arg0 : tensor<2x4xf64, #DCSR> do {
Expand All @@ -758,7 +758,7 @@ func.func @sparse_tensor_foreach(%arg0: tensor<2x4xf64, #DCSR>) -> () {

// -----

#DCSR = #sparse_tensor.encoding<{lvlTypes = ["compressed", "compressed"]}>
#DCSR = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : compressed, d1 : compressed)}>
func.func @sparse_tensor_foreach(%arg0: tensor<2x4xf64, #DCSR>, %arg1: f32) -> () {
// expected-error@+1 {{Mismatch in number of init arguments and results}}
sparse_tensor.foreach in %arg0 init(%arg1) : tensor<2x4xf64, #DCSR>, f32 do {
Expand All @@ -769,7 +769,7 @@ func.func @sparse_tensor_foreach(%arg0: tensor<2x4xf64, #DCSR>, %arg1: f32) -> (

// -----

#DCSR = #sparse_tensor.encoding<{lvlTypes = ["compressed", "compressed"]}>
#DCSR = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : compressed, d1 : compressed)}>
func.func @sparse_tensor_foreach(%arg0: tensor<2x4xf64, #DCSR>, %arg1: f32) -> () {
// expected-error@+1 {{Mismatch in types of init arguments and results}}
%1 = sparse_tensor.foreach in %arg0 init(%arg1) : tensor<2x4xf64, #DCSR>, f32 -> i32 do {
Expand All @@ -780,7 +780,7 @@ func.func @sparse_tensor_foreach(%arg0: tensor<2x4xf64, #DCSR>, %arg1: f32) -> (

// -----

#DCSR = #sparse_tensor.encoding<{lvlTypes = ["compressed", "compressed"]}>
#DCSR = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : compressed, d1 : compressed)}>
func.func @sparse_tensor_foreach(%arg0: tensor<2x4xf64, #DCSR>, %arg1: f32) -> () {
// expected-error@+1 {{Mismatch in types of yield values and results}}
%1 = sparse_tensor.foreach in %arg0 init(%arg1) : tensor<2x4xf64, #DCSR>, f32 -> f32 do {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
// RUN: mlir-opt %s -test-tensor-copy-insertion="bufferize-function-boundaries allow-return-allocs" | FileCheck %s --check-prefix=CHECK-FUNC

#DCSR = #sparse_tensor.encoding<{
lvlTypes = [ "compressed", "compressed" ],
dimToLvl = affine_map<(i,j) -> (i,j)>
map = (d0, d1) -> (d0 : compressed, d1 : compressed)
}>

// CHECK-LABEL: func @bufferization_alloc_tensor
Expand Down
2 changes: 1 addition & 1 deletion mlir/test/Dialect/SparseTensor/one_trip.mlir
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// RUN: mlir-opt %s -sparsification -cse | FileCheck %s

#Dense = #sparse_tensor.encoding<{
lvlTypes = [ "dense" , "dense" ]
map = (d0, d1) -> (d0 : dense, d1 : dense)
}>

#trait_scale = {
Expand Down
2 changes: 1 addition & 1 deletion mlir/test/Dialect/SparseTensor/post_rewriting.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
}>

#SparseMatrix = #sparse_tensor.encoding<{
lvlTypes = ["compressed", "compressed"]
map = (d0, d1) -> (d0 : compressed, d1 : compressed)
}>

// CHECK-LABEL: func.func @expand_dense(
Expand Down
2 changes: 1 addition & 1 deletion mlir/test/Dialect/SparseTensor/pre_rewriting.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
}>

#DCSR = #sparse_tensor.encoding<{
lvlTypes = ["compressed", "compressed"]
map = (d0, d1) -> (d0 : compressed, d1 : compressed)
}>

#Slice = #sparse_tensor.encoding<{
Expand Down
26 changes: 13 additions & 13 deletions mlir/test/Dialect/SparseTensor/roundtrip.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ func.func @sparse_noe(%arg0: tensor<128xf64, #SparseVector>) -> index {

// -----

#DenseMatrix = #sparse_tensor.encoding<{lvlTypes = ["dense","dense"]}>
#DenseMatrix = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : dense, d1 : dense)}>

// CHECK-LABEL: func @sparse_load(
// CHECK-SAME: %[[A:.*]]: tensor<16x32xf64, #{{.*}}>)
Expand All @@ -296,7 +296,7 @@ func.func @sparse_load(%arg0: tensor<16x32xf64, #DenseMatrix>) -> tensor<16x32xf

// -----

#DenseMatrix = #sparse_tensor.encoding<{lvlTypes = ["dense","dense"]}>
#DenseMatrix = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : dense, d1 : dense)}>

// CHECK-LABEL: func @sparse_load_ins(
// CHECK-SAME: %[[A:.*]]: tensor<16x32xf64, #{{.*}}>)
Expand Down Expand Up @@ -364,7 +364,7 @@ func.func @sparse_push_back_n(%arg0: index, %arg1: memref<?xf64>, %arg2: f64, %a

// -----

#SparseMatrix = #sparse_tensor.encoding<{lvlTypes = ["compressed", "compressed"]}>
#SparseMatrix = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : compressed, d1 : compressed)}>

// CHECK-LABEL: func @sparse_expansion(
// CHECK-SAME: %[[A:.*]]: tensor<8x8xf64, #sparse_tensor.encoding<{{.*}}>>)
Expand All @@ -378,7 +378,7 @@ func.func @sparse_expansion(%tensor: tensor<8x8xf64, #SparseMatrix>) -> index {

// -----

#SparseMatrix = #sparse_tensor.encoding<{lvlTypes = ["compressed", "compressed"]}>
#SparseMatrix = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : compressed, d1 : compressed)}>

// CHECK-LABEL: func @sparse_compression(
// CHECK-SAME: %[[A0:.*0]]: memref<?xf64>,
Expand All @@ -402,7 +402,7 @@ func.func @sparse_compression(%values: memref<?xf64>,

// -----

#SparseMatrix = #sparse_tensor.encoding<{lvlTypes = ["compressed", "compressed"]}>
#SparseMatrix = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : compressed, d1 : compressed)}>

// CHECK-LABEL: func @sparse_out(
// CHECK-SAME: %[[A:.*]]: tensor<?x?xf64, #sparse_tensor.encoding<{{.*}}>>,
Expand All @@ -416,7 +416,7 @@ func.func @sparse_out(%arg0: tensor<?x?xf64, #SparseMatrix>, %arg1: !llvm.ptr<i8

// -----

#SparseMatrix = #sparse_tensor.encoding<{lvlTypes = ["compressed", "compressed"]}>
#SparseMatrix = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : compressed, d1 : compressed)}>

// CHECK-LABEL: func @sparse_binary(
// CHECK-SAME: %[[A:.*]]: f64, %[[B:.*]]: i64) -> f64 {
Expand Down Expand Up @@ -450,7 +450,7 @@ func.func @sparse_binary(%arg0: f64, %arg1: i64) -> f64 {

// -----

#SparseMatrix = #sparse_tensor.encoding<{lvlTypes = ["compressed", "compressed"]}>
#SparseMatrix = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : compressed, d1 : compressed)}>

// CHECK-LABEL: func @sparse_unary(
// CHECK-SAME: %[[A:.*]]: f64) -> f64 {
Expand Down Expand Up @@ -480,7 +480,7 @@ func.func @sparse_unary(%arg0: f64) -> f64 {

// -----

#SparseMatrix = #sparse_tensor.encoding<{lvlTypes = ["compressed", "compressed"]}>
#SparseMatrix = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : compressed, d1 : compressed)}>

// CHECK-LABEL: func @sparse_unary(
// CHECK-SAME: %[[A:.*]]: f64) -> i64 {
Expand All @@ -507,7 +507,7 @@ func.func @sparse_unary(%arg0: f64) -> i64 {

// -----

#SparseMatrix = #sparse_tensor.encoding<{lvlTypes = ["compressed", "compressed"]}>
#SparseMatrix = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : compressed, d1 : compressed)}>

// CHECK-LABEL: func @sparse_reduce_2d_to_1d(
// CHECK-SAME: %[[A:.*]]: f64, %[[B:.*]]: f64) -> f64 {
Expand All @@ -529,7 +529,7 @@ func.func @sparse_reduce_2d_to_1d(%arg0: f64, %arg1: f64) -> f64 {

// -----

#SparseMatrix = #sparse_tensor.encoding<{lvlTypes = ["compressed", "compressed"]}>
#SparseMatrix = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : compressed, d1 : compressed)}>

// CHECK-LABEL: func @sparse_select(
// CHECK-SAME: %[[A:.*]]: f64) -> f64 {
Expand All @@ -553,7 +553,7 @@ func.func @sparse_select(%arg0: f64) -> f64 {

// -----

#SparseMatrix = #sparse_tensor.encoding<{lvlTypes = ["compressed", "compressed"]}>
#SparseMatrix = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : compressed, d1 : compressed)}>

// CHECK-LABEL: func @concat_sparse_sparse(
// CHECK-SAME: %[[A0:.*]]: tensor<2x4xf64
Expand All @@ -577,7 +577,7 @@ func.func @concat_sparse_sparse(%arg0: tensor<2x4xf64, #SparseMatrix>,

// -----

#DCSR = #sparse_tensor.encoding<{lvlTypes = ["compressed", "compressed"]}>
#DCSR = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : compressed, d1 : compressed)}>

// CHECK-LABEL: func @sparse_tensor_foreach(
// CHECK-SAME: %[[A0:.*]]: tensor<2x4xf64
Expand All @@ -592,7 +592,7 @@ func.func @sparse_tensor_foreach(%arg0: tensor<2x4xf64, #DCSR>) -> () {

// -----

#DCSR = #sparse_tensor.encoding<{lvlTypes = ["compressed", "compressed"]}>
#DCSR = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : compressed, d1 : compressed)}>

// CHECK-LABEL: func @sparse_tensor_foreach(
// CHECK-SAME: %[[A0:.*]]: tensor<2x4xf64, #sparse_tensor.encoding<{{{.*}}}>>,
Expand Down
6 changes: 3 additions & 3 deletions mlir/test/Dialect/SparseTensor/sparse_2d.mlir
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// NOTE: Assertions have been autogenerated by utils/generate-test-checks.py
// RUN: mlir-opt %s -sparsification | FileCheck %s

#Tdd = #sparse_tensor.encoding<{ lvlTypes = [ "dense", "dense" ] }>
#Tdd = #sparse_tensor.encoding<{ map = (d0, d1) -> (d0 : dense, d1 : dense) }>
#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" ] }>
#Tsd = #sparse_tensor.encoding<{ map = (d0, d1) -> (d0 : compressed, d1 : dense) }>
#Tss = #sparse_tensor.encoding<{ map = (d0, d1) -> (d0 : compressed, d1 : compressed) }>

#trait2 = {
indexing_maps = [
Expand Down
2 changes: 1 addition & 1 deletion mlir/test/Dialect/SparseTensor/sparse_affine.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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

#trait1 = {
Expand Down
2 changes: 1 addition & 1 deletion mlir/test/Dialect/SparseTensor/sparse_broadcast.mlir
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: mlir-opt %s --sparsification --canonicalize --cse | FileCheck %s

#DCSR = #sparse_tensor.encoding<{ lvlTypes = [ "compressed", "compressed" ] }>
#DCSR = #sparse_tensor.encoding<{ map = (d0, d1) -> (d0 : compressed, d1 : compressed) }>
#SparseTensor = #sparse_tensor.encoding<{ lvlTypes = [ "compressed", "compressed", "compressed" ] }>

#trait = {
Expand Down
12 changes: 3 additions & 9 deletions mlir/test/Dialect/SparseTensor/sparse_concat.mlir
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
// RUN: mlir-opt %s --sparse-tensor-conversion --canonicalize --cse | FileCheck %s

#SparseMatrix = #sparse_tensor.encoding<{lvlTypes = ["compressed", "compressed"]}>
#SparseMatrix = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : compressed, d1 : compressed)}>

#SparseMatrix_P = #sparse_tensor.encoding<{
lvlTypes = [ "compressed", "compressed" ],
dimToLvl = affine_map<(i,j) -> (j,i)>
}>
#SparseMatrix_P = #sparse_tensor.encoding<{map = (d0, d1) -> (d1 : compressed, d0 : compressed)}>

#SparseMatrix_D_P = #sparse_tensor.encoding<{
lvlTypes = [ "dense", "dense" ],
dimToLvl = affine_map<(i,j) -> (j,i)>
}>
#SparseMatrix_D_P = #sparse_tensor.encoding<{map = (d0, d1) -> (d1 : dense, d0 : dense)}>

// CHECK-LABEL: func.func @concat_mix_dense(
// CHECK-SAME: %[[TMP_arg0:.*]]: tensor<2x4xf64>,
Expand Down
9 changes: 3 additions & 6 deletions mlir/test/Dialect/SparseTensor/sparse_concat_codegen.mlir
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
// RUN: mlir-opt %s --post-sparsification-rewrite="enable-runtime-library=false enable-convert=false" \
// RUN: | FileCheck %s

#DCSR = #sparse_tensor.encoding<{lvlTypes = ["compressed", "compressed"]}>
#DENSE = #sparse_tensor.encoding<{lvlTypes = ["dense", "dense"]}>
#DENSE_P = #sparse_tensor.encoding<{
lvlTypes = ["dense", "dense"],
dimToLvl = affine_map<(i,j) -> (j,i)>
}>
#DCSR = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : compressed, d1 : compressed)}>
#DENSE = #sparse_tensor.encoding<{map = (d0, d1) -> (d0 : dense, d1 : dense)}>
#DENSE_P = #sparse_tensor.encoding<{map = (d0, d1) -> (d1 : dense, d0 : dense)}>
// CHECK-LABEL: @concat_sparse_sparse(
// CHECK-SAME: %[[TMP_arg0:.*]]: tensor<2x4xf64, #sparse_tensor
// CHECK-SAME: %[[TMP_arg1:.*]]: tensor<3x4xf64, #sparse_tensor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#map1 = affine_map<(d0, d1, d2, d3) -> (d2, d3)>
#map2 = affine_map<(d0, d1, d2, d3) -> (d0, d1)>

#DCSR = #sparse_tensor.encoding<{ lvlTypes = [ "compressed", "compressed" ] }>
#DCSR = #sparse_tensor.encoding<{ map = (d0, d1) -> (d0 : compressed, d1 : compressed) }>

// CHECK-LABEL: func.func @conv2d_all_sparse_CSR(
// CHECK-SAME: %[[VAL_0:.*]]: tensor<8x8xi32, #sparse_tensor.encoding<{{.*}}>>,
Expand Down
3 changes: 1 addition & 2 deletions mlir/test/Dialect/SparseTensor/sparse_expand.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
}>

#DCSC = #sparse_tensor.encoding<{
lvlTypes = [ "compressed", "compressed" ],
dimToLvl = affine_map<(i,j) -> (j,i)>
map = (d0, d1) -> (d1 : compressed, d0 : compressed),
}>

#SV = #sparse_tensor.encoding<{
Expand Down
2 changes: 1 addition & 1 deletion mlir/test/Dialect/SparseTensor/sparse_fill_zero.mlir
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: mlir-opt %s --linalg-generalize-named-ops --pre-sparsification-rewrite --sparsification --sparse-tensor-conversion --canonicalize --cse | FileCheck %s

#DCSR = #sparse_tensor.encoding<{ lvlTypes = [ "compressed", "compressed" ] }>
#DCSR = #sparse_tensor.encoding<{ map = (d0, d1) -> (d0 : compressed, d1 : compressed) }>

// CHECK-LABEL: func.func @fill_zero_after_alloc(
// CHECK-SAME: %[[Arg0:.*]]: !llvm.ptr<i8>,
Expand Down
Loading

0 comments on commit 2a07f0f

Please sign in to comment.