Issue converting DeepSeek-R1 to GGUF format. #11989
-
Hi All, I'm attempting to convert the DeepSeek-R1 cloned in its entirety and have had no success. I have built the latest pull of llama.cpp with the oneAPI C++ compiler and python 3.12.3 on Linux. I noticed that the model was not included in convert_hf_to_gguf_update.py so I added the link and ran that command with a huggingface token and it came back error free. I was also able to run the below command which also came back error free. python3 convert_hf_to_gguf.py models/tokenizers/deepseek-r1/ --outfile models/ggml-vocab-deepseek-r1.gguf --vocab-only the build had no issue converting DeepSeek-R1-Distill_llama-70B, it is working perfectly but for DeepSeek-R1 I get the following error almost immediately: INFO:hf-to-gguf:Loading model: DeepSeek-R1
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 weight map from 'model.safetensors.index.json'
INFO:hf-to-gguf:gguf: loading model part 'model-00001-of-000163.safetensors'
INFO:hf-to-gguf:token_embd.weight, torch.bfloat16 --> F16, shape = {7168, 129280}
INFO:hf-to-gguf:blk.0.attn_norm.weight, torch.bfloat16 --> F32, shape = {7168}
INFO:hf-to-gguf:blk.0.ffn_down.weight, torch.float8_e4m3fn --> F16, shape = {18432, 7168}
Traceback (most recent call last):
File "/home/devcloud/llama.cpp/convert_hf_to_gguf.py", line 5010, in <module>
main()
File "/home/devcloud/llama.cpp/convert_hf_to_gguf.py", line 5004, in main
model_instance.write()
File "/home/devcloud/llama.cpp/convert_hf_to_gguf.py", line 439, in write
self.prepare_tensors()
File "/home/devcloud/llama.cpp/convert_hf_to_gguf.py", line 4040, in prepare_tensors
super().prepare_tensors()
File "/home/devcloud/llama.cpp/convert_hf_to_gguf.py", line 298, in prepare_tensors
for new_name, data_torch in (self.modify_tensors(data_torch, name, bid)):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/devcloud/llama.cpp/convert_hf_to_gguf.py", line 4037, in modify_tensors
return [(self.map_tensor_name(name), data_torch)]
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/devcloud/llama.cpp/convert_hf_to_gguf.py", line 214, 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' Any help would be appreciated, thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
same issue |
Beta Was this translation helpful? Give feedback.
The original model has fp8 weights and some extra tensors with dequantization scales. llama.cpp doesn't support this, you have to: