mirror of
https://github.com/kvcache-ai/ktransformers.git
synced 2026-11-05 01:07:28 +00:00
[GH-ISSUE #1445] [Bug] KT 0.3.2版本 运行Kimi-K2-Instruct-UD-IQ2_XXS 能加载模型,进入对话框后报错。 #963
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/ktransformers#963
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mikestut on GitHub (Jul 16, 2025).
Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/1445
检查清单
问题描述
model_path: str = MODEL_PATH,
optimize_config_path: str = ktransformer_rules_dir+'DeepSeek-V3-Chat-serve.yaml',
gguf_path: str = GGUF_PATH, # | None = None,
max_new_tokens: int =1024,
cpu_infer: str = CPU_INFER ,#: int = Config().cpu_infer,
use_cuda_graph: bool = True , #False,
prompt_file : str | None = None,
mode: str = "normal",
force_think: bool = False,
chunk_size: int =12800
正常加载完成60层。
loading model.layers.60.self_attn.q_a_layernorm.weight to cuda
loading model.layers.60.self_attn.kv_a_layernorm.weight to cuda
loading model.layers.60.self_attn.kv_b_proj.weight to cuda:0
loading model.layers.60.input_layernorm.weight to cuda
loading model.layers.60.post_attention_layernorm.weight to cuda
loading model.norm.weight to cuda
Chat: 你好
显存占用:8G
WARNING:transformers_modules.tokenization_kimi:Calling super().encode with {'add_special_tokens': False}
报错如下:
File /opt/conda/lib/python3.11/site-packages/torch/nn/modules/module.py:1747, in Module._call_impl(self, *args, **kwargs)
1742 # If we don't have any hooks, we want to skip the rest of the logic in
1743 # this function, and just call forward.
1744 if not (self._backward_hooks or self._backward_pre_hooks or self._forward_hooks or self._forward_pre_hooks
1745 or _global_backward_pre_hooks or _global_backward_hooks
1746 or _global_forward_hooks or _global_forward_pre_hooks):
-> 1747 return forward_call(*args, **kwargs)
1749 result = None
1750 called_always_called_hooks = set()
TypeError: flashinfer_attn.forward() got an unexpected keyword argument 'attention_mask'
复现步骤
python ktransformers/server/main.py
--port 10002
--model_path <path_to_safetensor_config>
--gguf_path <path_to_gguf_files>
--optimize_config_path ktransformers/optimize/optimize_rules/DeepSeek-V3-Chat-serve.yaml
--max_new_tokens 1024
--cache_lens 32768
--chunk_size 256
--max_batch_size 4
--backend_type balance_serve \
反馈:
环境信息
ubuntu2204
X99
512 ddr4
2CPU 56线程
RTX3070 16G
docker 容器中跑(3.1.2.4都正常可以跑。
@apalesnail commented on GitHub (Jul 16, 2025):
Does it work with the ktransformers backend?
@mikestut commented on GitHub (Jul 17, 2025):
Yes, are you have the same problem??
@apalesnail commented on GitHub (Jul 17, 2025):
I have seen this before with DeepSeek. Here was the workaround:
Hey all, a workaround is to copy all of the small files from hugging face such as modeling_deepseek.py must be in the directory for model_path (unlike the ktransformers backend, which automatically pulls from hugging face).