iree-org / iree

A retargetable MLIR-based machine learning compiler and runtime toolkit.
http://iree.dev/
Apache License 2.0
2.48k stars 553 forks source link

LLVM Integrate compile failure #17778

Closed Max191 closed 2 days ago

Max191 commented 4 days ago

https://github.com/iree-org/iree/pull/17770 exposed some failures in iree-compile related to unit dim folding caused by https://github.com/llvm/llvm-project/commit/2c06fb899966b49ff0fe4adf55fceb7d1941fbca.

The failure can be seen in this example:

func.func @unit_dim_folding(%arg0: vector<1x1xf32>) -> vector<1x1xf32> {
  %cst = arith.constant dense<0.000000e+00> : vector<1x1xf32>
  %0 = arith.mulf %arg0, %cst : vector<1x1xf32>
  return %0 : vector<1x1xf32>
}

Running iree-opt --pass-pipeline="builtin.module(func.func(iree-llvmcpu-drop-vector-unit-dims))" test.mlir results in:

error: 'arith.mulf' op operand #0 must be floating-point-like, but got 'vector<f32>'
    %0 = arith.mulf %arg0, %cst : vector<1x1xf32>

To reproduce, just cherry-pick the above LLVM commit, and run the above iree-opt command.

hanhanW commented 4 days ago

cc @banach-space @nujaa the llvm commit is breaking IREE, so we reverted it in our llvm-project fork. We'll need some help to land it to IREE. Can we revert the upstream commit until it's fixed? I can help provide a repro without IREE specifics.

banach-space commented 4 days ago

cc @banach-space @nujaa the llvm commit is breaking IREE, so we reverted it in our llvm-project fork. We'll need some help to land it to IREE. Can we revert the upstream commit until it's fixed? I can help provide a repro without IREE specifics.

I'm OK with this being temporarily reverted from MLIR (we don't require it ATM). I also think that I know what the issue is :)

@nujaa, are OK if that is reverted for a few days?

hanhanW commented 2 days ago

The upstream commit is reverted in https://github.com/llvm/llvm-project/pull/97652, closing the issue.