-
Notifications
You must be signed in to change notification settings - Fork 873
PackConstants can produce zero-sized buffers #23926
Copy link
Copy link
Open
Labels
bug 🐞Something isn't workingSomething isn't working
Description
What happened?
Under certain circumstances, the PackConstants pass can produce buffers with zero size. Those zero-sized buffers can cause downstream passes or the runtime to fail.
Steps to reproduce your issue
- Create a MLIR file
small_constant_for_reproducer.mlirwith the following contents:
util.func public @smallConstantForReproducer() -> (!stream.resource<constant>, !stream.timepoint) {
%c256 = arith.constant 256 : index
%0:2 = stream.resource.constants :
!stream.resource<constant>{%c256} = dense<42> : tensor<64xi32>
=> !stream.timepoint
util.return %0#0, %0#1 : !stream.resource<constant>, !stream.timepoint
}
- Run
iree-compile --iree-hal-target-backends=llvm-cpu --iree-llvmcpu-target-triple=x86_64-linux-gnu --iree-llvmcpu-target-cpu=host --iree-stream-resource-max-allocation-size=128 -o small_constant_for_reproducer.vmfb -dump-compilation-phases-to=dump small_constant_for_reproducer.mlir
The important point is here that the limit (128) provided on the command line is less than the size of the first constant in the input MLIR.
3. Check first line of dump/small_constant_for_reproducer.7.stream.mlir:
#composite_of_0b = #util.composite<0xi8, []>
What component(s) does this issue relate to?
Compiler
Version information
Additional context
I have a suggested fix in a PR: #23927.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bug 🐞Something isn't workingSomething isn't working