[GH-ISSUE #1347] [Feature] Support for unsloth/DeepSeek-R1-0528-GGUF #909

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

Originally created by @344303947 on GitHub (May 30, 2025).
Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/1347

Checklist

  • 1. If the issue you raised is not a feature but a question, please raise a discussion at https://github.com/kvcache-ai/ktransformers/discussions. Otherwise, it will be closed.
  • 2. To help the community, I will use Chinese/English or attach an Chinese/English translation if using another language. Non-English/Chinese content without translation may be closed.

Motivation

DeepSeek-R1-0528-UD-Q2_K_XL

loading blk.0.attn_q_a_norm.weight to cuda
loading blk.0.attn_kv_a_norm.weight to cuda
Process SpawnProcess-1:
Traceback (most recent call last):
File "/home/sean/miniconda3/envs/kt/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
self.run()
File "/home/sean/miniconda3/envs/kt/lib/python3.10/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/home/sean/miniconda3/envs/kt/lib/python3.10/site-packages/ktransformers/server/backend/interfaces/balance_serve.py", line 244, in run_engine
engine = Engine(args, token_queue, broadcast_endpoint)
File "/home/sean/miniconda3/envs/kt/lib/python3.10/site-packages/ktransformers/server/backend/interfaces/balance_serve.py", line 162, in init
optimize_and_load_gguf(self.model, optimize_config_path, gguf_path, config)
File "/home/sean/miniconda3/envs/kt/lib/python3.10/site-packages/ktransformers/optimize/optimize.py", line 131, in optimize_and_load_gguf
load_weights(module, gguf_loader)
File "/home/sean/miniconda3/envs/kt/lib/python3.10/site-packages/ktransformers/util/utils.py", line 125, in load_weights
load_weights(child, gguf_loader, prefix+name+".")
File "/home/sean/miniconda3/envs/kt/lib/python3.10/site-packages/ktransformers/util/utils.py", line 127, in load_weights
module.load()
File "/home/sean/miniconda3/envs/kt/lib/python3.10/site-packages/ktransformers/operators/base_operator.py", line 63, in load
utils.load_weights(child, self.gguf_loader, self.key+".")
File "/home/sean/miniconda3/envs/kt/lib/python3.10/site-packages/ktransformers/util/utils.py", line 125, in load_weights
load_weights(child, gguf_loader, prefix+name+".")
File "/home/sean/miniconda3/envs/kt/lib/python3.10/site-packages/ktransformers/util/utils.py", line 125, in load_weights
load_weights(child, gguf_loader, prefix+name+".")
File "/home/sean/miniconda3/envs/kt/lib/python3.10/site-packages/ktransformers/util/utils.py", line 125, in load_weights
load_weights(child, gguf_loader, prefix+name+".")
File "/home/sean/miniconda3/envs/kt/lib/python3.10/site-packages/ktransformers/util/utils.py", line 127, in load_weights
module.load()
File "/home/sean/miniconda3/envs/kt/lib/python3.10/site-packages/ktransformers/operators/base_operator.py", line 63, in load
utils.load_weights(child, self.gguf_loader, self.key+".")
File "/home/sean/miniconda3/envs/kt/lib/python3.10/site-packages/ktransformers/util/utils.py", line 125, in load_weights
load_weights(child, gguf_loader, prefix+name+".")
File "/home/sean/miniconda3/envs/kt/lib/python3.10/site-packages/ktransformers/util/utils.py", line 123, in load_weights
load_cur_state_dict(module, gguf_loader, prefix)
File "/home/sean/miniconda3/envs/kt/lib/python3.10/site-packages/ktransformers/util/utils.py", line 118, in load_cur_state_dict
raise Exception(f"can't find {translated_key} in GGUF file!")
Exception: can't find blk.0.attn_kv_b.weight in GGUF file!

Originally created by @344303947 on GitHub (May 30, 2025). Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/1347 ### Checklist - [ ] 1. If the issue you raised is not a feature but a question, please raise a discussion at https://github.com/kvcache-ai/ktransformers/discussions. Otherwise, it will be closed. - [ ] 2. To help the community, I will use Chinese/English or attach an Chinese/English translation if using another language. Non-English/Chinese content without translation may be closed. ### Motivation DeepSeek-R1-0528-UD-Q2_K_XL ### Related resources loading blk.0.attn_q_a_norm.weight to cuda loading blk.0.attn_kv_a_norm.weight to cuda Process SpawnProcess-1: Traceback (most recent call last): File "/home/sean/miniconda3/envs/kt/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap self.run() File "/home/sean/miniconda3/envs/kt/lib/python3.10/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/home/sean/miniconda3/envs/kt/lib/python3.10/site-packages/ktransformers/server/backend/interfaces/balance_serve.py", line 244, in run_engine engine = Engine(args, token_queue, broadcast_endpoint) File "/home/sean/miniconda3/envs/kt/lib/python3.10/site-packages/ktransformers/server/backend/interfaces/balance_serve.py", line 162, in __init__ optimize_and_load_gguf(self.model, optimize_config_path, gguf_path, config) File "/home/sean/miniconda3/envs/kt/lib/python3.10/site-packages/ktransformers/optimize/optimize.py", line 131, in optimize_and_load_gguf load_weights(module, gguf_loader) File "/home/sean/miniconda3/envs/kt/lib/python3.10/site-packages/ktransformers/util/utils.py", line 125, in load_weights load_weights(child, gguf_loader, prefix+name+".") File "/home/sean/miniconda3/envs/kt/lib/python3.10/site-packages/ktransformers/util/utils.py", line 127, in load_weights module.load() File "/home/sean/miniconda3/envs/kt/lib/python3.10/site-packages/ktransformers/operators/base_operator.py", line 63, in load utils.load_weights(child, self.gguf_loader, self.key+".") File "/home/sean/miniconda3/envs/kt/lib/python3.10/site-packages/ktransformers/util/utils.py", line 125, in load_weights load_weights(child, gguf_loader, prefix+name+".") File "/home/sean/miniconda3/envs/kt/lib/python3.10/site-packages/ktransformers/util/utils.py", line 125, in load_weights load_weights(child, gguf_loader, prefix+name+".") File "/home/sean/miniconda3/envs/kt/lib/python3.10/site-packages/ktransformers/util/utils.py", line 125, in load_weights load_weights(child, gguf_loader, prefix+name+".") File "/home/sean/miniconda3/envs/kt/lib/python3.10/site-packages/ktransformers/util/utils.py", line 127, in load_weights module.load() File "/home/sean/miniconda3/envs/kt/lib/python3.10/site-packages/ktransformers/operators/base_operator.py", line 63, in load utils.load_weights(child, self.gguf_loader, self.key+".") File "/home/sean/miniconda3/envs/kt/lib/python3.10/site-packages/ktransformers/util/utils.py", line 125, in load_weights load_weights(child, gguf_loader, prefix+name+".") File "/home/sean/miniconda3/envs/kt/lib/python3.10/site-packages/ktransformers/util/utils.py", line 123, in load_weights load_cur_state_dict(module, gguf_loader, prefix) File "/home/sean/miniconda3/envs/kt/lib/python3.10/site-packages/ktransformers/util/utils.py", line 118, in load_cur_state_dict raise Exception(f"can't find {translated_key} in GGUF file!") Exception: can't find blk.0.attn_kv_b.weight in GGUF file!
Author
Owner

@apalesnail commented on GitHub (May 30, 2025):

Same issue observed in Q4_K_M deepseek r1 0528

<!-- gh-comment-id:2922450765 --> @apalesnail commented on GitHub (May 30, 2025): Same issue observed in Q4_K_M deepseek r1 0528
Author
Owner

@zhouye commented on GitHub (May 30, 2025):

The UD-Q2_K_XL version of DeepSeek-R1 0528 splits the KV tensor into standalone K and V tensors. The reason of doing this might be K and V needs to be quantized into different data types.

The support of this feature was in the upstream llama.cpp (https://github.com/ggml-org/llama.cpp/pull/12801) but not included in ktransformer master.

<!-- gh-comment-id:2922724214 --> @zhouye commented on GitHub (May 30, 2025): The UD-Q2_K_XL version of DeepSeek-R1 0528 splits the KV tensor into standalone K and V tensors. The reason of doing this might be K and V needs to be quantized into different data types. The support of this feature was in the upstream llama.cpp (https://github.com/ggml-org/llama.cpp/pull/12801) but not included in ktransformer master.
Author
Owner

@qiyuxinlin commented on GitHub (Jun 1, 2025):

The issue has been resolved.

<!-- gh-comment-id:2927416312 --> @qiyuxinlin commented on GitHub (Jun 1, 2025): The issue has been resolved.
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#909
No description provided.