[GH-ISSUE #830] [Bug] No Tensor Saved when Using merge_safetensor_gguf.py #599

Closed
opened 2026-10-29 14:41:45 +00:00 by bsakaguchi · 3 comments
Owner

Originally created by @3wweiweiwu on GitHub (Mar 7, 2025).
Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/830

Originally assigned to: @Azure-Tang on GitHub.

Checklist

  • 1. I have searched related issues but cannot get the expected help.
  • 2. The bug has not been fixed in the latest version.
  • 3. Please note that if the bug-related issue you submitted lacks corresponding environment info and a minimal reproducible demo, it will be challenging for us to reproduce and resolve the issue, reducing the likelihood of receiving feedback.
  • 4. If the issue you raised is not a bug but a question, please raise a discussion at https://github.com/kvcache-ai/ktransformers/discussions. Otherwise, it will be closed.
  • 5. To help the community, I will use Chinese/English or attach an Chinese/English translation if using another language. Non-Chinese/English content without translation may be closed.

Describe the bug

When I try to merge DeepSeek-R1-IQ1S-F8 to gguf DeepSeek-R1-UD-IQ1_S, it returns error "raise ValueError("No tensors to save")"

Reproduction

GGUF Model Path: unsloth/DeepSeek-R1-GGUF/DeepSeek-R1-UD-IQ1_S

Command:

python merge_tensors/merge_safetensor_gguf.py --safetensor_path "~/unsloth/deepseek-r1-fp8-safesensors/DeepSeek-R1-IQ1S-FP8" --gguf_path "~/unsloth/DeepSeek-R1-UD-IQ1_S" --output_path "~/unsloth/deepseek-merged-iq1/

Error

All the arguments:
Namespace(safetensor_path='~/unsloth/deepseek-r1-fp8-safesensors', gguf_path='~/unsloth/DeepSeek-R1-UD-IQ1_S', output_path='~/unsloth/deepseek-merged-iq1/')
Traceback (most recent call last):
  File "~/ktransformers/merge_tensors/merge_safetensor_gguf.py", line 214, in <module>
    main()
  File "~/ktransformers/merge_tensors/merge_safetensor_gguf.py", line 209, in main
    write_combined_tensor(target_tensor_map, output_path, gguf_loader)
  File ~/ktransformers/merge_tensors/merge_safetensor_gguf.py", line 121, in write_combined_tensor
    raise ValueError("No tensors to save')

Environment

OS: Ubuntu 22
GPU: 2xA10
CPU: AMD EPYC 74F3 24-Core Processor
Ktransformer Version: 0.2.3
Build from source code

Originally created by @3wweiweiwu on GitHub (Mar 7, 2025). Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/830 Originally assigned to: @Azure-Tang on GitHub. ### Checklist - [x] 1. I have searched related issues but cannot get the expected help. - [x] 2. The bug has not been fixed in the latest version. - [x] 3. Please note that if the bug-related issue you submitted lacks corresponding environment info and a minimal reproducible demo, it will be challenging for us to reproduce and resolve the issue, reducing the likelihood of receiving feedback. - [x] 4. If the issue you raised is not a bug but a question, please raise a discussion at https://github.com/kvcache-ai/ktransformers/discussions. Otherwise, it will be closed. - [x] 5. To help the community, I will use Chinese/English or attach an Chinese/English translation if using another language. Non-Chinese/English content without translation may be closed. ### Describe the bug When I try to merge DeepSeek-R1-IQ1S-F8 to gguf DeepSeek-R1-UD-IQ1_S, it returns error "raise ValueError("No tensors to save")" ### Reproduction **GGUF Model Path**: unsloth/DeepSeek-R1-GGUF/DeepSeek-R1-UD-IQ1_S **Command**: ``` python merge_tensors/merge_safetensor_gguf.py --safetensor_path "~/unsloth/deepseek-r1-fp8-safesensors/DeepSeek-R1-IQ1S-FP8" --gguf_path "~/unsloth/DeepSeek-R1-UD-IQ1_S" --output_path "~/unsloth/deepseek-merged-iq1/ ``` **Error** ``` All the arguments: Namespace(safetensor_path='~/unsloth/deepseek-r1-fp8-safesensors', gguf_path='~/unsloth/DeepSeek-R1-UD-IQ1_S', output_path='~/unsloth/deepseek-merged-iq1/') Traceback (most recent call last): File "~/ktransformers/merge_tensors/merge_safetensor_gguf.py", line 214, in <module> main() File "~/ktransformers/merge_tensors/merge_safetensor_gguf.py", line 209, in main write_combined_tensor(target_tensor_map, output_path, gguf_loader) File ~/ktransformers/merge_tensors/merge_safetensor_gguf.py", line 121, in write_combined_tensor raise ValueError("No tensors to save') ``` ### Environment OS: Ubuntu 22 GPU: 2xA10 CPU: AMD EPYC 74F3 24-Core Processor Ktransformer Version: 0.2.3 Build from source code
Author
Owner

@Azure-Tang commented on GitHub (Mar 8, 2025):

It seems that script doesn't find safetensors in your path.

  1. Check the safetensor files are indeed located in ~/unsloth/deepseek-r1-fp8-safesensors/DeepSeek-R1-IQ1S-FP8
  2. Use absolute path, e.g /home/user/unsloth/deepseek-r1-fp8-safesensors/DeepSeek-R1-IQ1S-FP8

Or, you can download preprocessed hybrid tensors from https://huggingface.co/KVCache-ai/DeepSeek-R1-GGML-FP8-Hybrid

<!-- gh-comment-id:2708350001 --> @Azure-Tang commented on GitHub (Mar 8, 2025): It seems that script doesn't find safetensors in your path. 1. Check the safetensor files are indeed located in `~/unsloth/deepseek-r1-fp8-safesensors/DeepSeek-R1-IQ1S-FP8` 2. Use absolute path, e.g `/home/user/unsloth/deepseek-r1-fp8-safesensors/DeepSeek-R1-IQ1S-FP8` Or, you can download preprocessed hybrid tensors from https://huggingface.co/KVCache-ai/DeepSeek-R1-GGML-FP8-Hybrid
Author
Owner

@3wweiweiwu commented on GitHub (Mar 10, 2025):

Thanks for the clarification. It's issue on my end.

I downloaded the pre-merged tensors, and tried to merge it again. I should download original tensors.

<!-- gh-comment-id:2709368844 --> @3wweiweiwu commented on GitHub (Mar 10, 2025): Thanks for the clarification. It's issue on my end. I downloaded the pre-merged tensors, and tried to merge it again. I should download original tensors.
Author
Owner

@AlbertG123 commented on GitHub (Apr 2, 2025):

python merge_tensors/merge_safetensor_gguf.py --safetensor_path "/DeepSeek-R1-IQ1S-FP8" --gguf_path "/DeepSeek-R1-Q2_K_XL" --output_path "~/deepseek-merged-iq1/"
我也遇到这个报错,no tensor to save.
DeepSeek-R1-IQ1S-FP8 , 这个是从KVCache-ai/DeepSeek-R1-GGML-FP8-Hybrid/DeepSeek-R1-IQ1S-FP8 中下载的61 个tensor 文件. DeepSeek-R1-Q2_K_XL 是5个 GGUF 文件.

<!-- gh-comment-id:2771266626 --> @AlbertG123 commented on GitHub (Apr 2, 2025): python merge_tensors/merge_safetensor_gguf.py --safetensor_path "~/DeepSeek-R1-IQ1S-FP8" --gguf_path "~/DeepSeek-R1-Q2_K_XL" --output_path "~/deepseek-merged-iq1/" 我也遇到这个报错,no tensor to save. DeepSeek-R1-IQ1S-FP8 , 这个是从KVCache-ai/DeepSeek-R1-GGML-FP8-Hybrid/DeepSeek-R1-IQ1S-FP8 中下载的61 个tensor 文件. DeepSeek-R1-Q2_K_XL 是5个 GGUF 文件.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kvcache-ai/ktransformers#599
No description provided.