[GH-ISSUE #950] [Feature] 绑定指定的CPU核心 #678

Closed
opened 2026-10-29 14:42:45 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @yeungtuzi on GitHub (Mar 21, 2025).
Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/950

检查清单

  • 1. 如果您提出的不是新功能而是问题,请在讨论区发起讨论 https://github.com/kvcache-ai/ktransformers/discussions。否则该 issue 将被关闭
  • 2. 为方便社区交流,我将使用中文/英文或附上英文/中文翻译(如使用其他语言)。未附带翻译的非英文/中文内容可能会被关闭

需求背景

vllm中类似参数/环境变量为

export VLLM_CPU_KVCACHE_SPACE=40
export VLLM_CPU_OMP_THREADS_BIND=0-29 

或者可以使用numactl
numactl -N0-7 -m0-7 /path/to/llama-cli -m /path/to/model.gguf -t 8 --numa numactl 来实现?

相关资源

No response

Originally created by @yeungtuzi on GitHub (Mar 21, 2025). Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/950 ### 检查清单 - [x] 1. 如果您提出的不是新功能而是问题,请在讨论区发起讨论 https://github.com/kvcache-ai/ktransformers/discussions。否则该 issue 将被关闭 - [x] 2. 为方便社区交流,我将使用中文/英文或附上英文/中文翻译(如使用其他语言)。未附带翻译的非英文/中文内容可能会被关闭 ### 需求背景 vllm中类似参数/环境变量为 ``` export VLLM_CPU_KVCACHE_SPACE=40 export VLLM_CPU_OMP_THREADS_BIND=0-29 ``` 或者可以使用numactl `numactl -N0-7 -m0-7 /path/to/llama-cli -m /path/to/model.gguf -t 8 --numa numactl `来实现? ### 相关资源 _No response_
Author
Owner

@Atream commented on GitHub (Mar 22, 2025):

可以使用numactl来实现,不过由于权重是mmap到内存的,绑核前需要清空mmap缓存
sudo sh -c "echo 3 > /proc/sys/vm/drop_caches"

<!-- gh-comment-id:2744972028 --> @Atream commented on GitHub (Mar 22, 2025): 可以使用numactl来实现,不过由于权重是mmap到内存的,绑核前需要清空mmap缓存 `sudo sh -c "echo 3 > /proc/sys/vm/drop_caches"`
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#678
No description provided.