[GH-ISSUE #740] 请教为什么配置512G内存,1张L40s因内存不足运行不了DeepSeek-R1-Q4_K_M #540

Closed
opened 2026-10-29 14:40:59 +00:00 by bsakaguchi · 6 comments
Owner

Originally created by @Longleaves on GitHub (Feb 28, 2025).
Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/740

检查清单

  • 1. 我已经搜索过相关问题,但未能获得预期的帮助
  • 2. 该问题在最新版本中尚未修复
  • 3. 请注意,如果您提交的BUG相关 issue 缺少对应环境信息和最小可复现示例,我们将难以复现和定位问题,降低获得反馈的可能性
  • 4. 如果您提出的不是bug而是问题,请在讨论区发起讨论 https://github.com/kvcache-ai/ktransformers/discussions。否则该 issue 将被关闭
  • 5. 为方便社区交流,我将使用中文/英文或附上中文/英文翻译(如使用其他语言)。未附带翻译的非中文/英语内容可能会被关闭

问题描述

请教为什么配置512G内存,1张L40s 48G显卡,2个Intel(R) Xeon(R) Gold 6338 CPU @ 2.00GHz会因内存不足而运行不了DeepSeek-R1-Q4_K_M,非常感谢!

复现步骤

numactl -N 1 -m 1 python ./ktransformers/local_chat.py --model_path deepseek-ai/DeepSeek-R1 --gguf_path DeepSeek-R1-GGUF/DeepSeek-R1-Q4_K_M --cpu_infer 30 --max_new_tokens 8192 --force_think true

环境信息

512G DRAM
48G VRAM
2*32核

Originally created by @Longleaves on GitHub (Feb 28, 2025). Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/740 ### 检查清单 - [x] 1. 我已经搜索过相关问题,但未能获得预期的帮助 - [ ] 2. 该问题在最新版本中尚未修复 - [ ] 3. 请注意,如果您提交的BUG相关 issue 缺少对应环境信息和最小可复现示例,我们将难以复现和定位问题,降低获得反馈的可能性 - [ ] 4. 如果您提出的不是bug而是问题,请在讨论区发起讨论 https://github.com/kvcache-ai/ktransformers/discussions。否则该 issue 将被关闭 - [ ] 5. 为方便社区交流,我将使用中文/英文或附上中文/英文翻译(如使用其他语言)。未附带翻译的非中文/英语内容可能会被关闭 ### 问题描述 请教为什么配置512G内存,1张L40s 48G显卡,2个Intel(R) Xeon(R) Gold 6338 CPU @ 2.00GHz会因内存不足而运行不了DeepSeek-R1-Q4_K_M,非常感谢! ### 复现步骤 numactl -N 1 -m 1 python ./ktransformers/local_chat.py --model_path deepseek-ai/DeepSeek-R1 --gguf_path DeepSeek-R1-GGUF/DeepSeek-R1-Q4_K_M --cpu_infer 30 --max_new_tokens 8192 --force_think true ### 环境信息 512G DRAM 48G VRAM 2*32核
Author
Owner

@yeungtuzi commented on GitHub (Feb 28, 2025):

因为看不到你的内存配置,我建议你先把numactl这个去掉,有一种可能是你的每个CPU只接了256G内存导致内存不足(需要380G+)

<!-- gh-comment-id:2690792664 --> @yeungtuzi commented on GitHub (Feb 28, 2025): 因为看不到你的内存配置,我建议你先把numactl这个去掉,有一种可能是你的每个CPU只接了256G内存导致内存不足(需要380G+)
Author
Owner

@coelien commented on GitHub (Mar 4, 2025):

因为看不到你的内存配置,我建议你先把numactl这个去掉,有一种可能是你的每个CPU只接了256G内存导致内存不足(需要380G+)

为什么需要380G+,怎么算的呢

<!-- gh-comment-id:2696678145 --> @coelien commented on GitHub (Mar 4, 2025): > 因为看不到你的内存配置,我建议你先把numactl这个去掉,有一种可能是你的每个CPU只接了256G内存导致内存不足(需要380G+) 为什么需要380G+,怎么算的呢
Author
Owner

@yeungtuzi commented on GitHub (Mar 4, 2025):

Q4模型的大小就是这么大

<!-- gh-comment-id:2697551065 --> @yeungtuzi commented on GitHub (Mar 4, 2025): Q4模型的大小就是这么大
Author
Owner

@better319 commented on GitHub (Mar 5, 2025):

能截个图,说明下怎么样可以禁用其中一个吗

<!-- gh-comment-id:2701033462 --> @better319 commented on GitHub (Mar 5, 2025): 能截个图,说明下怎么样可以禁用其中一个吗
Author
Owner

@yeungtuzi commented on GitHub (Mar 9, 2025):

我理解是本案例的numactl会强制只能使用socket 0上面的cpu和内存,如果本socket上连接的内存不足以运行671b,会失败。去掉numactl之后,系统会自动尝试大致平均分配两个socket的内存,这样就够了。

I understand that in this case, numactl enforces the use of only the CPUs and memory on socket 0. If the memory connected to this socket is insufficient to run 671b, it will fail. After removing numactl, the system will automatically attempt to roughly evenly distribute memory across both sockets, which should be sufficient.


发件人: better319 @.>
发送时间: 2025年3月5日 22:01
收件人: kvcache-ai/ktransformers @.
>
抄送: yeungtuzi @.>; Comment @.>
主题: Re: [kvcache-ai/ktransformers] 请教为什么配置512G内存,1张L40s因内存不足运行不了DeepSeek-R1-Q4_K_M (Issue #740)

能截个图,说明下怎么样可以禁用其中一个吗

―
Reply to this email directly, view it on GitHubhttps://github.com/kvcache-ai/ktransformers/issues/740#issuecomment-2701033462, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADLPPABBIMMXOUXCQC3LRJ32S37UNAVCNFSM6AAAAABYB3HQ7GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMBRGAZTGNBWGI.
You are receiving this because you commented.Message ID: @.***>

[better319]better319 left a comment (kvcache-ai/ktransformers#740)https://github.com/kvcache-ai/ktransformers/issues/740#issuecomment-2701033462

能截个图,说明下怎么样可以禁用其中一个吗

―
Reply to this email directly, view it on GitHubhttps://github.com/kvcache-ai/ktransformers/issues/740#issuecomment-2701033462, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADLPPABBIMMXOUXCQC3LRJ32S37UNAVCNFSM6AAAAABYB3HQ7GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMBRGAZTGNBWGI.
You are receiving this because you commented.Message ID: @.***>

<!-- gh-comment-id:2708621527 --> @yeungtuzi commented on GitHub (Mar 9, 2025): 我理解是本案例的numactl会强制只能使用socket 0上面的cpu和内存,如果本socket上连接的内存不足以运行671b,会失败。去掉numactl之后,系统会自动尝试大致平均分配两个socket的内存,这样就够了。 I understand that in this case, numactl enforces the use of only the CPUs and memory on socket 0. If the memory connected to this socket is insufficient to run 671b, it will fail. After removing numactl, the system will automatically attempt to roughly evenly distribute memory across both sockets, which should be sufficient. ________________________________ 发件人: better319 ***@***.***> 发送时间: 2025年3月5日 22:01 收件人: kvcache-ai/ktransformers ***@***.***> 抄送: yeungtuzi ***@***.***>; Comment ***@***.***> 主题: Re: [kvcache-ai/ktransformers] 请教为什么配置512G内存,1张L40s因内存不足运行不了DeepSeek-R1-Q4_K_M (Issue #740) 能截个图,说明下怎么样可以禁用其中一个吗 ― Reply to this email directly, view it on GitHub<https://github.com/kvcache-ai/ktransformers/issues/740#issuecomment-2701033462>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ADLPPABBIMMXOUXCQC3LRJ32S37UNAVCNFSM6AAAAABYB3HQ7GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMBRGAZTGNBWGI>. You are receiving this because you commented.Message ID: ***@***.***> [better319]better319 left a comment (kvcache-ai/ktransformers#740)<https://github.com/kvcache-ai/ktransformers/issues/740#issuecomment-2701033462> 能截个图,说明下怎么样可以禁用其中一个吗 ― Reply to this email directly, view it on GitHub<https://github.com/kvcache-ai/ktransformers/issues/740#issuecomment-2701033462>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ADLPPABBIMMXOUXCQC3LRJ32S37UNAVCNFSM6AAAAABYB3HQ7GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMBRGAZTGNBWGI>. You are receiving this because you commented.Message ID: ***@***.***>
Author
Owner

@Longleaves commented on GitHub (Mar 17, 2025):

我去掉了numactl,并且用单socket的安装方法,可以正常用512G内存启动了,谢谢各位!

<!-- gh-comment-id:2727903339 --> @Longleaves commented on GitHub (Mar 17, 2025): 我去掉了numactl,并且用单socket的安装方法,可以正常用512G内存启动了,谢谢各位!
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#540
No description provided.