iree: codegen producing register count overflow for hip target gfx942 with 8 devices
What happened?
Iβm getting a register count overflow when trying to run llama3.1_405b_fp16 for 8 HIP devices targeting gfx942
iree/runtime/src/iree/vm/bytecode/verifier.c:345: RESOURCE_EXHAUSTED; register count overflow; loading bytecode module at '405b_f16_tp8.vmfb'; loading modules and dependencies; creating run context
Steps to reproduce your issue
Using llama3.1_405b_f16_tp8.mlir obtained from the SHARK-Platform model export process
Compile the mlir
iree-build/tools/iree-compile /data/llama-3.1/405b/llama3.1_405b_fp16_tp8.mlir --iree-hal-target-device=hip[0] --iree-hal-target-device=rhip[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-executable-debug-level=3 --iree-hip-target=gfx942 -o 405b_f16_tp8.vmfb
Attempt to run the vmfb
iree-build/tools/iree-run-module --parameters="model=/data/llama3.1/405b/llama3.1_405b_fp16_tp8_parameters.rank0.irpa" --parameters="model=/data/llama3.1/405b/llama3.1_405b_fp16_tp8_parameters.rank1.irpa" --parameters="model=/data/llama3.1/405b/llama3.1_405b_fp16_tp8_parameters.rank2.irpa" --parameters="model=/data/llama3.1/405b/llama3.1_405b_fp16_tp8_parameters.rank3.irpa" --parameters="model=/data/llama3.1/405b/llama3.1_405b_fp16_tp8_parameters.rank4.irpa" --parameters="model=/data/llama3.1/405b/llama3.1_405b_fp16_tp8_parameters.rank5.irpa" --parameters="model=/data/llama3.1/405b/llama3.1_405b_fp16_tp8_parameters.rank6.irpa" --parameters="model=/data/llama3.1/405b/llama3.1_405b_fp16_tp8_parameters.rank7.irpa" --module=405b_f16_tp8.vmfb --function=prefill_bs4 --input=4x1xi64=0 --input=4xi64=1 --input=4x1xi64=0,1,2,3 --input=1x2097152xf16 --device=hip[0] --device=hip[1] --device=hip[2] --device=hip[3] --device=hip[4] --device=hip[5] --device=hip[6] --device=hip[7]
What component(s) does this issue relate to?
Compiler
Version information
3b751a4d2
Additional context
MLIR vmfb The sharded parameter files are not necessary to replicate this error but I can upload these to a private location if necessary.
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 38 (7 by maintainers)
If I understand correctly, this version might include shape assertions because it includes this patch during export. Original Flow Stream VM
flow
A large number of dispatches in here are slow_memcpy. There are literally 15128 slow_mempy dispatches. π π π π π π π π
looks like most are just adding a unit dimension.
Ah, I found my mistake. I thought
--compile-to=vmwould produce the vmfb, but it seems it is one step before it. Tried compiled the rest of the way, but the compiler just seems to be crashing with this error:Yeah, thatβs what I meantβ¦ Need to partition on some axis