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

  1. Fetch mlir: https://gist.github.com/archana-ramalingam/b692d0a123edb798596ec68f0044dd2e
  2. 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   
  1. Error: https://gist.github.com/archana-ramalingam/84c4fa9b9cbad20385aaf90ffe009abe

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:

  1. 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
  1. 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

Most upvoted comments

@nirvedhmeshram I tried to set the padding size to be 1 for outer reduction dimension, and GPUPadOperandsPass still failed.

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=O3 gets the IR to successfully compile. So, this should be less/non blocking

@AmosLewis llvm/llvm-project#136326 has been merged. After next integrate I’ll revert b3fcfb6

@IanWood1 Based on today test, llama 8b fp8 performance regression has been solved and back to 0418 best ever result.

commit 128 128 2048 2048
prefill decode prefill decode
0429 30.3 10 388 16.7
0418 30.2 10 386 16.7

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.