Skip to content

convert_checkpoint qwen1.5 error #1675

Closed

Description

@diandianliu

Hi, I am facing an error when trying to convert_checkpoint qwen1.5

**model: **
https://huggingface.co/Qwen/Qwen1.5-0.5B-Chat
error:
python convert_checkpoint.py --qwen_type qwen2 --model_dir /workspace/triton/models/qwen/Qwen1.5-0.5B-Chat/ --output_dir /workspace/triton/models/qwen/trt_ckpt_Qwen1.5-0.5B-Chat_fp16_1gpu
[TensorRT-LLM] TensorRT-LLM version: 0.11.0.dev2024052100
0.11.0.dev2024052100
Traceback (most recent call last):
File "/workspace/triton/tensorrtllm_backend/tensorrt_llm/examples/qwen/convert_checkpoint.py", line 369, in
main()
File "/workspace/triton/tensorrtllm_backend/tensorrt_llm/examples/qwen/convert_checkpoint.py", line 361, in main
convert_and_save_hf(args)
File "/workspace/triton/tensorrtllm_backend/tensorrt_llm/examples/qwen/convert_checkpoint.py", line 323, in convert_and_save_hf
execute(args.workers, [convert_and_save_rank] * world_size, args)
File "/workspace/triton/tensorrtllm_backend/tensorrt_llm/examples/qwen/convert_checkpoint.py", line 329, in execute
f(args, rank)
File "/workspace/triton/tensorrtllm_backend/tensorrt_llm/examples/qwen/convert_checkpoint.py", line 309, in convert_and_save_rank
qwen = from_hugging_face(
File "/usr/local/lib/python3.10/dist-packages/tensorrt_llm/models/qwen/convert.py", line 1087, in from_hugging_face
weights = load_weights_from_hf(config=config,
File "/usr/local/lib/python3.10/dist-packages/tensorrt_llm/models/qwen/convert.py", line 1193, in load_weights_from_hf
weights = convert_hf_qwen(
File "/usr/local/lib/python3.10/dist-packages/tensorrt_llm/models/qwen/convert.py", line 931, in convert_hf_qwen
lm_head_weights = get_weight(model_params, 'lm_head', dtype)
File "/usr/local/lib/python3.10/dist-packages/tensorrt_llm/models/qwen/convert.py", line 455, in get_weight
if config[prefix + '.weight'].dtype != dtype:
KeyError: 'lm_head.weight'

Activity

  1. byshiue commented on May 29, 2024

    @byshiue
    Collaborator

    Thank you for the report. It is a bug of Qwen convert when tie_word_embeddings is True. We will fix it in next update.

  2. self-assigned this
    on May 29, 2024
  3. added
    bug
    triaged
    on May 29, 2024
  4. nv-guomingz commented on Jun 3, 2024

    @nv-guomingz
    Collaborator

    Hi @diandianliu , thanks for your contributing. We've merged your contribution into code base and will add you into contributor list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Mergedbugtriaged

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions