Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Thanks for fixing!
If there are no strong reasons to stick to the test code I would go for something shorter, e.g. using matvec:
builtin.func @no_fusion(%arg0 : tensor<?x?xf32>, %arg1 : tensor<?xf32>, %arg2: tensor<?xf32>) -> tensor<?xf32> { %c0 = arith.constant 0 : index %c1 = arith.constant 1 : index %cst = arith.constant 1.0 : f32 %0 = linalg.fill(%cst, %arg0) : f32, tensor<?x?xf32> -> tensor<?x?xf32> %1 = linalg.matvec ins(%0, %arg1: tensor<?x?xf32>, tensor<?xf32>) outs(%arg2: tensor<?xf32>) -> tensor<?xf32> return %1 : tensor<?xf32> }
Also I would rename the test file to tile-and-fuse-no-fuse.mlir. We are not consistent there but I think most tests by now use hyphen instead of underscore.
mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp | ||
---|---|---|
595–598 | A tile size of zero is always invalid. You should really fail even if a single tile size is zero - the specification would on the whole be invalid. |
Done. Btw, I tried to make it such that the getRootReplacement... doesnt assert if no tiled loops are generated. Couldnt figure out an easy way to do this. Ideally it would return the same op, but you then cannot use that with replaceAllUsesWith (since that is an error). Would be nice to have a way to not fail if no tiled loops are generated. This is a WAR for that.
mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp | ||
---|---|---|
595–598 | Thats not the norm that Linalg tiling uses. Tile size = 0 is a specification that a particular loop should not be tiled. |
True, I think getRootReplacement should return FailureOr<ValueRange>? I made a TODO and will look at it ASAP. However, I still think it is a good idea to fail early if no tiling is needed.
mlir/test/Dialect/Linalg/tile-and-fuse-no-fuse.mlir | ||
---|---|---|
3 | nit: it is only gemm now |
A tile size of zero is always invalid. You should really fail even if a single tile size is zero - the specification would on the whole be invalid.