Repository navigation
Conversation
Deletes inserting the op right before the first use of the constant. Generating the op right after the constant guarantees the dominitio because the constant already meets it. Plus, a constant could be used in different blocks. In this context, it will crash in the check. Also adds the pass to MHLO pipeline.
| passManager.addNestedPass<FuncOp>( | ||
| mlir::iree_compiler::createPromoteI1ToI8Pass()); |
There was a problem hiding this comment.
What prompted this change? I recently removed a similar pass from this file in #6852 based on discussion here: #6756 (comment). We really need a clear stance (that is documented) on how i1 types should be handled (#5223).
There was a problem hiding this comment.
There are i1 constants (e.g., tensor<1024xi1>), and IREE does not know how to handle i1 constants.
I think it is slightly different from #6852 because PromoteTensorLoads is mainly to handle 0D i1 tensors (i.e. tensor) which are introduced by CFG.
I would see this change in these ways:
- The pass is already used in TOSA pipeline. This makes the MHLO pipeline align the TOSA pipeline. I.e., the pass is added because IREE does not handle i1 constants correctly now.
- The i1 constants could be used in computations. Ideally, IREE should pack constants, and codegen side should be able to handle it. We will see similar situations in quantized model, e.g.,
tensor<1024xi4>, though the quant stories are not clear to me at this moment.
To be more clear, I think this case should be handled like:
- At flow level, the host side decides how to pack/store these non-native types (e.g.,
i1,i4). - IREE compiler will configure codegen side to store constants in some types. E.g., today we are storing i1 in 8 bits on SPIR-V side. See https://github.com/llvm/llvm-project/blob/a95ba8107359e17cb1669c01f416fd2723a23126/mlir/include/mlir/Dialect/SPIRV/Transforms/SPIRVConversion.h#L55-L63
Once IREE HAL can store these types correctly (maybe pack them back-to-back), and all the backends can emulate the case. I think we will have a clearer picture.
There was a problem hiding this comment.
Thanks for that breakdown! I'm starting a doc for #5223 and it will be good to capture some of this in there.
I've seen these i8 passes shuffled around enough times that I'd really like to see us land on the actual structure we want (what you mention for flow and codegen), rather than carry forward the stopgaps.
|
testing if adding label works to me |
Abbreviated Benchmark Summary@ commit 57618da81d92ad505c5b24fc922fccc58f55ce8e (vs. base 401338bded50cf20b1f3e4d6f0724847896a505b) Regressed Benchmarks 🚩
[Top 3 out of 54 benchmark results showed] Improved Benchmarks 🎉
For more information: |
|
This is no longer needed. The issue is addressed and the pass is deleted in #8199 |
Deletes inserting the op right before the first use of the constant.
Generating the op right after the constant guarantees the dominitio
because the constant already meets it. Plus, a constant could be used in
different blocks. In this context, it will crash in the check.
Also adds the pass to MHLO pipeline.