Skip to content

Commit af56a47

Browse files
authored
[CPU][NFC] Switch infusible pack tests to use imperfect tiling case. (#21404)
The pack op in the old test is fusible with fixes. Update the test to use imperfect tiling case that is known infusible atm. Signed-off-by: hanhanW <[email protected]>
1 parent c2f1fb9 commit af56a47

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

compiler/src/iree/compiler/Codegen/LLVMCPU/test/tile_root_and_fuse_producer_consumer.mlir

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -394,17 +394,22 @@ func.func @tile_linalg_ext_scan(%arg0: tensor<128x2xf32>) -> tensor<128x2xi64> {
394394
#map = affine_map<(d0, d1) -> (d0)>
395395
#map1 = affine_map<(d0, d1) -> (d1)>
396396
#map2 = affine_map<(d0, d1) -> (d0, d1)>
397-
func.func @infusible_pack(%arg0: tensor<4xf32>) -> tensor<1x4x16x1xf32> {
398-
%cst = arith.constant 0.000000e+00 : f32
399-
%0 = tensor.empty() : tensor<1x4x16x1xf32>
400-
%1 = tensor.empty() : tensor<4x4xf32>
401-
%2 = linalg.generic {indexing_maps = [#map, #map1, #map2], iterator_types = ["parallel", "parallel"]} ins(%arg0, %arg0 : tensor<4xf32>, tensor<4xf32>) outs(%1 : tensor<4x4xf32>) attrs = {lowering_config = #config} {
402-
^bb0(%in: f32, %in_0: f32, %out: f32):
403-
%3 = arith.addf %in, %in : f32
404-
linalg.yield %3 : f32
405-
} -> tensor<4x4xf32>
406-
%pack = linalg.pack %2 padding_value(%cst : f32) outer_dims_perm = [1, 0] inner_dims_pos = [1, 0] inner_tiles = [16, 1] into %0 : tensor<4x4xf32> -> tensor<1x4x16x1xf32>
407-
return %pack : tensor<1x4x16x1xf32>
397+
func.func @infusible_pack(%arg0 : tensor<30xf32>) -> tensor<5x6xf32> {
398+
%empty = tensor.empty() : tensor<30xf32>
399+
%0 = linalg.generic {
400+
indexing_maps = [affine_map<(d0) -> (d0)>, affine_map<(d0) -> (d0)>],
401+
iterator_types = ["parallel"]}
402+
ins(%arg0 : tensor<30xf32>) outs(%empty : tensor<30xf32>)
403+
attrs = {lowering_config = #config} {
404+
^bb0(%b0 : f32, %b1 : f32) :
405+
%1 = arith.addf %b0, %b0 : f32
406+
linalg.yield %1 : f32
407+
} -> tensor<30xf32>
408+
%empty1 = tensor.empty() : tensor<5x6xf32>
409+
%pack = linalg.pack %0 outer_dims_perm = [0]
410+
inner_dims_pos = [0] inner_tiles = [6] into %empty1
411+
: tensor<30xf32> -> tensor<5x6xf32>
412+
return %pack : tensor<5x6xf32>
408413
}
409414
// CHECK-LABEL: func.func @infusible_pack
410415
// CHECK: scf.forall

0 commit comments

Comments
 (0)