mirror of
https://github.com/kvcache-ai/ktransformers.git
synced 2026-11-05 01:07:28 +00:00
[GH-ISSUE #1344] [Bug] 使用4个GPU部署模型DeepSeek-R1的Q4量化版本时出错 #904
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/ktransformers#904
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 @MacColdNET on GitHub (May 29, 2025).
Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/1344
Originally assigned to: @qiyuxinlin on GitHub.
检查清单
问题描述
在 docker 容器环境下,使用4个 GPU 启动 DeepSeek-R1 的 Q4_K_M 版本模型时出现错误如下:
复现步骤
我使用官方提供的镜像 approachingai/ktransformers:v0.3.1-AVX512 启动容器:
docker run --gpus all -d --name ktransformers-gpu-all-v5 -v /data:/app/models --network=host -e HF_ENDPOINT=https://hf-mirror.com -e NCCL_SOCKET_IFNAME=ens110f0 -e GLOO_SOCKET_IFNAME=ens110f0 --shm-size=64g approachingai/ktransformers:v0.3.1-AVX512进入容器内,先把transformers版本降级为4.43.2(如果不降级,会出现“AttributeError: 'DeepseekV3ForCausalLM' object has no attribute '_get_logits_warper'”错误),然后启动 DeepSeek-R1 的 Q4_K_M 版本:
ktransformers --model_path /app/models/Model-Zoo/model_config/DeepSeek-R1/config/ --gguf_path /app/models/Model-Zoo/DeepSeek-R1-GGUF/DeepSeek-R1-Q4_K_M/ --model_name deepseek-r1 --port 10002 --optimize_config_path /workspace/ktransformers/ktransformers/optimize/optimize_rules/DeepSeek-V3-Chat-multi-gpu-4.yaml --max_new_tokens 4090 --cache_lens 40900其中DeepSeek-V3-Chat-multi-gpu-4.yaml 就是官方提供的默认文件, DeepSeek-R1的Q4_K_M gguf文件我是在modelscope上下载的。模型启动成功,但是发送请求时报错:
请求语句如下:
完整的报错日志如下:
报错日志.txt
GPU显存占用如下(GPU0上有别的进程,所以占用得多一些):
请问是因为模型量化版本不适配吗?如果我哪一步操作不妥,还请指明。
环境信息
操作系统:
CPU信息:
GPU: