Skip to content

Misc. bug: Fail to convert Qwen3-4B-Instruct-2507-FP8 from safetensors to GGUF format. #15173

@MaoJianwei

Description

@MaoJianwei

Name and Version

version: 6119 (cd6983d5)
built with cc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 for x86_64-linux-gnu

Operating systems

Linux

Which llama.cpp modules do you know to be affected?

No response

Command line

(llm) mao@mao:~/llm/llama.cpp$ python convert_hf_to_gguf.py --outfile ../Qwen3-4B-Instruct-2507-FP8-gguf ../Qwen3-4B-Instruct-2507-FP8/

Problem description & steps to reproduce

Fail to convert Qwen3-4B-Instruct-2507-FP8 from safetensors to GGUF format.

First Bad Commit

b6119
git pull origin master, just now

Relevant log output

(llm) mao@mao:~/llm/llama.cpp$ python convert_hf_to_gguf.py --outfile ../Qwen3-4B-Instruct-2507-FP8-gguf ../Qwen3-4B-Instruct-2507-FP8/
INFO:hf-to-gguf:Loading model: Qwen3-4B-Instruct-2507-FP8                                      
INFO:hf-to-gguf:Model architecture: Qwen3ForCausalLM                                           
INFO:gguf.gguf_writer:gguf: This GGUF file is for Little Endian only                           
INFO:hf-to-gguf:Exporting model...                                                                                                                                                            
INFO:hf-to-gguf:gguf: loading model part 'model.safetensors'                                                                                                                                  
INFO:hf-to-gguf:output.weight,             torch.float16 --> F16, shape = {2560, 151936}       
INFO:hf-to-gguf:token_embd.weight,         torch.float16 --> F16, shape = {2560, 151936}       
INFO:hf-to-gguf:blk.0.attn_norm.weight,    torch.float16 --> F32, shape = {2560}               
INFO:hf-to-gguf:blk.0.ffn_down.weight,     torch.float8_e4m3fn --> F16, shape = {9728, 2560}   
Traceback (most recent call last):                                                             
  File "/home/mao/llm/llama.cpp/convert_hf_to_gguf.py", line 8595, in <module>                 
    main()                                                                                     
  File "/home/mao/llm/llama.cpp/convert_hf_to_gguf.py", line 8589, in main                     
    model_instance.write()                                                                     
  File "/home/mao/llm/llama.cpp/convert_hf_to_gguf.py", line 410, in write                     
    self.prepare_tensors()                                                                     
  File "/home/mao/llm/llama.cpp/convert_hf_to_gguf.py", line 277, in prepare_tensors           
    for new_name, data_torch in (self.modify_tensors(data_torch, name, bid)):                  
  File "/home/mao/llm/llama.cpp/convert_hf_to_gguf.py", line 2846, in modify_tensors           
    yield from super().modify_tensors(data_torch, name, bid)                                   
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                   
  File "/home/mao/llm/llama.cpp/convert_hf_to_gguf.py", line 245, in modify_tensors            
    return [(self.map_tensor_name(name), data_torch)]                                          
             ^^^^^^^^^^^^^^^^^^^^^^^^^^                                                        
  File "/home/mao/llm/llama.cpp/convert_hf_to_gguf.py", line 236, in map_tensor_name
    raise ValueError(f"Can not map tensor {name!r}")                          
ValueError: Can not map tensor 'model.layers.0.mlp.down_proj.weight_scale_inv'
(llm) mao@mao:~/llm/llama.cpp$ 

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions