iree: [compiler] Deepseek-V3 compile fails with codegen issues
What happened?
This fix for #20548 further uncovered multiple codegen issues like - https://gist.github.com/archana-ramalingam/84c4fa9b9cbad20385aaf90ffe009abe.
Creating this issue with an end goal of being able to compile the linked deepseek mlir (has 3 attention+FFN and 1 attention+MoE block) successfully by iteratively resolving all underlying sub-issues.
This is critical for Deepseek-V3 enablement for May 5th release.
Steps to reproduce your issue
- Fetch mlir: https://gist.github.com/archana-ramalingam/b692d0a123edb798596ec68f0044dd2e
- Run compile:
iree-compile deepseek_v3_f16_blk_0_3.mlir \
--iree-hip-target=gfx942 \
--iree-hal-target-device=hip \
-o=deepseek_v3_f16_blk_0_3.vmfb
What component(s) does this issue relate to?
Compiler
Version information
Commit @ b3fcfb6c5e7bead99b16285cba3d612687b31ee4
Additional context
This commit https://github.com/iree-org/iree/commit/b3fcfb6c5e7bead99b16285cba3d612687b31ee4 led to 2 more issues:
- sharktank testBenchmark70B_f16_TP8_Non_Decomposed_Input_Len_128 test fail too on 0419 https://github.com/nod-ai/shark-ai/actions/runs/14548496681/job/40816909348#step:7:386534, will xfail it in sharktank https://github.com/nod-ai/shark-ai/pull/1285
fetch mlir https://sharkpublic.blob.core.windows.net/sharkpublic/chi/llama/llama70b/f16_torch_128_tp8.mlir reproduce issue:
iree-compile /home/chi/src/shark-ai/2025-04-20/llama-70b/f16_torch_128_tp8.mlir --iree-hip-target=gfx942 -o=/home/chi/src/shark-ai/2025-04-20/llama-70b/f16_torch_128_tp8.vmfb --iree-hal-target-device=hip[0] --iree-hal-target-device=hip[1] --iree-hal-target-device=hip[2] --iree-hal-target-device=hip[3] --iree-hal-target-device=hip[4] --iree-hal-target-device=hip[5] --iree-hal-target-device=hip[6] --iree-hal-target-device=hip[7] --iree-hal-dump-executable-files-to=/home/chi/src/shark-ai/2025-04-20/llama-70b/f16_torch_128_tp8/files --iree-opt-level=O3 --iree-hal-indirect-command-buffers=true --iree-stream-resource-memory-model=discrete --iree-hal-memoization=true
- llama 8b fp8 performance regression:
| commit | 128 | 128 | 2048 | 2048 |
|---|---|---|---|---|
| prefill | decode | prefill | decode | |
| https://github.com/iree-org/iree/commit/b3fcfb6c5e7bead99b16285cba3d612687b31ee4 | 31.3 | 10.5 | 386 | 20.4 |
| before | 30.2 | 10 | 386 | 16.7 |
| 042411 | 40.0 | 21.7 | 397 | 27.8 |
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 35 (35 by maintainers)
Commits related to this issue
- [GPU] Bail out in matmul TileAndFuse config for unaligned dynamic shapes (#20622) We cant always handle such shapes with the padding method used by the pipeline. Fixes : https://github.com/iree-org/i... — committed to mcx/iree by nirvedhmeshram 2 years ago
- Delete llama 70b iree compile xfail (#1353) Delete the iree compile xfail bring in https://github.com/nod-ai/shark-ai/pull/1285/files It's been fixed by iree0429 https://github.com/iree-org/iree/issu... — committed to nod-ai/shark-ai by AmosLewis 2 years ago
- Delete llama 70b iree compile xfail (#1353) Delete the iree compile xfail bring in https://github.com/nod-ai/shark-ai/pull/1285/files It's been fixed by iree0429 https://github.com/iree-org/iree/issu... — committed to IanNod/SHARK-Platform by AmosLewis 2 years ago
- [GPU] Bail out in matmul TileAndFuse config for unaligned dynamic shapes (#20622) We cant always handle such shapes with the padding method used by the pipeline. Fixes : https://github.com/iree-org/i... — committed to KyleHerndon/iree by nirvedhmeshram 2 years ago
Yeah it doesn’t overcome the value bounds issue, the bailout PR I sent should fix the issue.
As of d4aaf915c3d2ff3bd073b2d4f27172149f2e1ace adding the flag
--iree-opt-level=O3gets the IR to successfully compile. So, this should be less/non blocking@IanWood1 Based on today test, llama 8b fp8 performance regression has been solved and back to 0418 best ever result.
Thats great! @bangtianliu i’d like you to keep investigating this. -O3 seems to be hiding some issue that might come up again.
@kuhar can you triage this a bit.