llama3-70b model convert fails in v0.9.0 when use_parallel_embedding and tp_size = 8
System Info
-CPU: x86
Memory: over 300G GPU: 8 x V100 No IB, No nvlink, NCCL use socket for communication Driver:
+---------------------------------------------------------------------------------------+ | NVIDIA-SMI 530.30.02 Driver Version: 530.30.02 CUDA Version: 12.1 | |-----------------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |=========================================+======================+======================| | 0 Tesla V100-SXM2-32GB On | 00000000:00:08.0 Off | 0 | | N/A 44C P0 57W / 300W| 32498MiB / 32768MiB | 0% Default | | | | N/A | +-----------------------------------------+----------------------+----------------------+ | 1 Tesla V100-SXM2-32GB On | 00000000:00:09.0 Off | 0 | | N/A 43C P0 58W / 300W| 19530MiB / 32768MiB | 0% Default | | | | N/A | +-----------------------------------------+----------------------+----------------------+ | 2 Tesla V100-SXM2-32GB On | 00000000:00:0A.0 Off | 0 | | N/A 42C P0 57W / 300W| 19474MiB / 32768MiB | 0% Default | | | | N/A | +-----------------------------------------+----------------------+----------------------+ | 3 Tesla V100-SXM2-32GB On | 00000000:00:0B.0 Off | 0 | | N/A 44C P0 57W / 300W| 19476MiB / 32768MiB | 0% Default | | | | N/A | +-----------------------------------------+----------------------+----------------------+ | 4 Tesla V100-SXM2-32GB On | 00000000:00:0C.0 Off | 0 | | N/A 43C P0 59W / 300W| 19476MiB / 32768MiB | 0% Default | | | | N/A | +-----------------------------------------+----------------------+----------------------+ | 5 Tesla V100-SXM2-32GB On | 00000000:00:0D.0 Off | 0 | | N/A 42C P0 58W / 300W| 19476MiB / 32768MiB | 0% Default | | | | N/A | +-----------------------------------------+----------------------+----------------------+ | 6 Tesla V100-SXM2-32GB On | 00000000:00:0E.0 Off | 0 | | N/A 44C P0 61W / 300W| 19476MiB / 32768MiB | 0% Default | | | | N/A | +-----------------------------------------+----------------------+----------------------+ | 7 Tesla V100-SXM2-32GB On | 00000000:00:0F.0 Off | 0 | | N/A 45C P0 62W / 300W| 21482MiB / 32768MiB | 0% Default | | | | N/A | +-----------------------------------------+----------------------+----------------------+
Who can help?
@byshiue
Information
- [ ] The official example scripts
- [X] My own modified scripts
Tasks
- [ ] An officially supported task in the
examplesfolder (such as GLUE/SQuAD, ...) - [X] My own task or dataset (give details below)
Reproduction
on 8 x V100 card(32GB) we intend to convert llama-3-70b-instruct with tp size == 8, and use_parallel_embedding, with tensorrt-llm v0.9.0
check point converting:
python3 convert_checkpoint.py --model_dir /home/jgq/tmpfs/llama3-70b-instruct --output_dir /home/jgq/cloud/engines/llama3-70b-instruct/cvt-tp8-pp1 --tp_size 8 --pp_size 1 --use_embedding_sharing --embedding_sharding_dim 0 --use_parallel_embedding --dtype float16
it reports:
[TensorRT-LLM] TensorRT-LLM version: 0.9.0
0.9.0
Loading checkpoint shards: 100%|█████████████████████████████████████████| 30/30 [00:53<00:00, 1.79s/it]
Loading checkpoint shards: 100%|█████████████████████████████████████████| 30/30 [10:59<00:00, 21.97s/it]
Weights loaded. Total time: 00:02:12
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/tensorrt_llm/models/modeling_utils.py", line 401, in load
param.value = weights[name]
File "/usr/local/lib/python3.10/dist-packages/tensorrt_llm/parameter.py", line 120, in value
assert v.shape == self._shape, \
AssertionError: The value updated is not the same shape as the original. Updated: (16032, 8192), original: (128256, 8192)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/jgq/trtllm/examples/llama/convert_checkpoint.py", line 446, in <module>
main()
File "/home/jgq/trtllm/examples/llama/convert_checkpoint.py", line 438, in main
convert_and_save_hf(args)
File "/home/jgq/trtllm/examples/llama/convert_checkpoint.py", line 375, in convert_and_save_hf
execute(args.workers, [convert_and_save_rank] * world_size, args)
File "/home/jgq/trtllm/examples/llama/convert_checkpoint.py", line 397, in execute
f(args, rank)
File "/home/jgq/trtllm/examples/llama/convert_checkpoint.py", line 362, in convert_and_save_rank
llama = LLaMAForCausalLM.from_hugging_face(
File "/usr/local/lib/python3.10/dist-packages/tensorrt_llm/models/llama/model.py", line 244, in from_hugging_face
llama = convert.from_hugging_face(
File "/usr/local/lib/python3.10/dist-packages/tensorrt_llm/models/llama/convert.py", line 1196, in from_hugging_face
llama.load(weights)
File "/usr/local/lib/python3.10/dist-packages/tensorrt_llm/models/modeling_utils.py", line 403, in load
raise RuntimeError(
RuntimeError: Encounter error 'The value updated is not the same shape as the original. Updated: (16032, 8192), original: (128256, 8192)' for parameter 'transformer.vocab_embedding.weight'
Expected behavior
convert successfully
actual behavior
failed in embedding parameter weight processing
additional notes
when I set tp_size=2, pp_size=4, it's OK
sorry: in addition notes I said: when I set tp_size=2, pp_size=4, it's OK
actually it fails too!
Could you reproduce same issue on LLaMA2-70B? (I cannot access the LLaMA3-70B now)
Also, could you take a try on latest main branch (commit id: f430a4b447ef4cba22698902d43eae0debf08594)? I can convert LLaMA2-70B on this commit.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 15 days."
Hi @forrestjgq do u still have further issue or question now? If not, we'll close it soon.