iree: [compiler] Llama 8b fp8 fails to compile

What happened?

Llama 8b fp8 compile hangs for > 6 hours on shark-ai nightly, since 3.4.0rc20250401 IREE version at commit 884a518b22589dde31650f6c407a72469b961b58.

Steps to reproduce your issue

  1. Get mlir - https://gist.github.com/archana-ramalingam/914480309ec6c4660338b02b84b37b95
  2. Build IREE at 884a518b22589dde31650f6c407a72469b961b58
  3. Compile:
../iree-build/tools/iree-compile fp8.mlir \
  --iree-hal-target-device=hip \
  --iree-hip-target=gfx942 \
  -o=fp8.vmfb \
  --iree-opt-level=O3 \
  --iree-hal-indirect-command-buffers=true \
  --iree-stream-resource-memory-model=discrete \
  --iree-hal-memoization=true
  1. Compile hangs without progress.

What component(s) does this issue relate to?

Compiler

Version information

884a518b22589dde31650f6c407a72469b961b58

Additional context

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 32 (32 by maintainers)

Commits related to this issue

Most upvoted comments

@MaheshRavishankar the mismatch was I originally was compiling with the following command and hit the above listed error

./build/tools/iree-compile ../sharktank/mistral_fp8_quark.mlir \
--iree-hal-target-device=hip \
--iree-hip-target=gfx942 \
-o mistral_quark_fp8.vmfb

Using the commands from @pashu123 /the original issue, I was also able to compile without error

./build/tools/iree-compile ../sharktank/mistral_fp8_quark.mlir \
--iree-hal-target-device=hip \
--iree-hip-target=gfx942 \
-o mistral_quark_fp8.vmfb \
 --iree-opt-level=O3 \
 --iree-hal-indirect-command-buffers=true  \
--iree-stream-resource-memory-model=discrete \
--iree-hal-memoization=true

In triaging which of the added flags I was missing that reconciled the error, I found it was this one.

--iree-opt-level=O3

The reshapes are created in BlockDynamicDimensions, I think https://github.com/llvm/llvm-project/pull/133819 might be needed to properly propagate the reshapes. cc @MaheshRavishankar

Debug log from the pass: https://gist.github.com/IanWood1/6ed3144150b65642f6b7e82b99ddf6ef

@IanWood1 try to add that pattern to the pass and see if it helps. If it does I’ll land it

@hanhanW no this isn’t expected. It was probably introduced after forming dispatches, I’ll see if I can track down where It came from

@kuhar can you take a look. I am away today.