Closed pdhirajkumarprasad closed 1 day ago
@lialan if you are looking at this please attach the IR with dump after all. I can redirect appropriately
Problematic memref.alloca
:
%54 = "memref.alloca"(%45) <{alignment = 64 : i64, operandSegmentSizes = array<i32: 1, 0>}> : (index) -> memref<?x2x32x64xf32>
contains dynamic shape. the dynamic size: %45
was defined as:
%45 = "affine.apply"(%37) <{map = affine_map<()[s0] -> (s0 floordiv 16)>}> : (index) -> index
again the value cannot be simply simplified, hence the check for alloca size bound failed.
@MaheshRavishankar the LLVM IR is attached in @pdhirajkumarprasad 's comment, just grep the keywords in this page.
Thats not enought to see what is going on. I see the alloca is dynamic, but need to see IR dump after all to really understand... for all such bug reports it will be easier for me to redirect if I can just get the dump with --mlir-print-ir-after-all --mlir-print-ir-before-all --mlir-disable-threading --mlir-elide-elementsattrs-if-larger=4
.
@MaheshRavishankar see attached: 18297.mlir.txt
Seems like we are missing a folder for unpack
-> pack
%34 = affine.apply affine_map<()[s0] -> (s0 floordiv 16)>()[%32]
%35 = tensor.empty(%34) : tensor<?x16x384x64xf32>
%unpack = tensor.unpack %33 outer_dims_perm = [0, 1, 2, 3] inner_dims_pos = [2, 3] inner_tiles = [8, 4] into %35 {lowering_config = #iree_codegen.lowering_config<tile_sizes = [[0, 4, 2, 64], [1, 1, 1, 1], [0, 0, 0, 0], [0, 0, 0, 0]]>} : tensor<?x16x48x16x8x4xf32> -> tensor<?x16x384x64xf32>
%36 = tensor.empty(%34) : tensor<?x48x16x64x8x1xf32>
%pack = tensor.pack %unpack outer_dims_perm = [0, 2, 1, 3] inner_dims_pos = [2, 3] inner_tiles = [8, 1] into %36 {lowering_config = #iree_codegen.lowering_config<tile_sizes = [[0, 4, 2, 64], [1, 1, 1, 1]]>} : tensor<?x16x384x64xf32> -> tensor<?x48x16x64x8x1xf32>
This is just a transpose AFAICS.
@pashu123 could you fix this?
Confirm the issue is gone along with #18296 in latest main branch.
Moving this out of CPU project board.
@pashu123 still need to fuse pack+unpack, per @MaheshRavishankar
Is this failing again on main? Last check was that this isnt failing on mai.
Is this failing again on main? Last check was that this isnt failing on mai.
I verified this is working on the main. We can close this and create a new issue for the pack+unpack folding.
Verified, issue don't exist in latest build
What happened?
for the given IR
getting error as
IR after failure:
Steps to reproduce your issue
command to reproduce the issue:
IREE version: IREE compiler version 20240819.990 @ aeda14995f16ed1302db616adf0c03acf80f27ee LLVM version 20.0.0git
What component(s) does this issue relate to?
Compiler
Version information
No response
Additional context
No response