Skip to content

Commit

Permalink
[CPU] Fix check for scalable tile sizes (#15264)
Browse files Browse the repository at this point in the history
This was meant to check `tileScalableFlags` not `tileSizes`. Tests
happened to pass as the lowering configs contained 1s.
  • Loading branch information
MacDue authored Oct 23, 2023
1 parent aa5602d commit 7d650ae
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/src/iree/compiler/Codegen/LLVMCPU/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ void setSCFTileSizes(scf::SCFTilingOptions &options, TilingInterface consumerOp,
int numLoops = consumerOp.getLoopIteratorTypes().size();
tileSizes.resize(numLoops, /*default=*/0);
tileScalableFlags.resize(numLoops, /*default=*/false);
if (!llvm::is_contained(tileSizes, 1)) {
if (!llvm::is_contained(tileScalableFlags, true)) {
// Non-scalable case: All constant tile sizes.
options.setTileSizes(
getAsIndexOpFoldResult(consumerOp.getContext(), tileSizes));
Expand Down
10 changes: 10 additions & 0 deletions compiler/src/iree/compiler/Codegen/LLVMCPU/test/tile.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,13 @@ func.func @scalable_matmul(%A: tensor<?x?xf32>, %B: tensor<?x?xf32>, %C: tensor<
// CHECK-SAME: step %[[SCALABLE_TILE_SIZE]]
// CHECK: scf.for
// CHECK-SAME: step %[[C1]]

// -----

// CHECK-LABEL: scalable_lowering_config_with_no_1s
// CHECK: vector.vscale
func.func @scalable_lowering_config_with_no_1s(%A: tensor<?x?xf32>, %B: tensor<?x?xf32>, %C: tensor<?x?xf32>) -> tensor<?x?xf32> {
%1 = linalg.matmul {lowering_config = #iree_codegen.lowering_config<tile_sizes = [[8, [32], 0]]>} ins(%A, %B: tensor<?x?xf32>, tensor<?x?xf32>)
outs(%C: tensor<?x?xf32>) -> tensor<?x?xf32>
return %1 : tensor<?x?xf32>
}

0 comments on commit 7d650ae

Please sign in to comment.