mirror of
https://github.com/kvcache-ai/ktransformers.git
synced 2026-11-05 01:07:28 +00:00
[GH-ISSUE #1073] [Feature] Use Physical Cores Prior to Hyper-threads and Clearify Best Practice for Arg cpu_infer #754
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/ktransformers#754
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 @MotorBottle on GitHub (Apr 7, 2025).
Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/1073
Checklist
Motivation
When trying the deployment, I found how to use the
cpu_inferarg needs to be clearified.My own test was conducted on 2*E5-2686v4, 512GB RAM, RTX 3080 20g, Ubuntu22.04 using docker, same setup following official Dockerfile.
My test showed that without USE_NUMA=1, a number higher than physical cores would make inference faster (cpu_infer=68, total 36c72t). However, when
USE_NUMA=1set,cpu_infer=36has a better performance thancpu_infer=68, but just slightly, and most of the cores in node 0 were working but many at node 1 were left idle. The futher discovery, when I turned hyperthreading off, showed the inference was greatly slowed down compared to on. And some tokens would need longer generation time than others, like 128ms compared to 98ms, one out of every 6-7 tokens, which did not happen when hyperthreading on (all were around 100ms).So I would presume, to optimize the performance, KTransformers need to have all physical cpu core threads primaryly used, then the HT threads (and of course HT on). Because when HT off, even if you set cpu_infer=cores-2, the performance would be capped somewhere. And that is for dual socket platforms with 2 NUMA nodes.
Related resources
No response
@yeungtuzi commented on GitHub (Apr 7, 2025):
It's very interesting and I will try it later.
@magikRUKKOLA commented on GitHub (Apr 8, 2025):
Are you sure you specificed the hardware correctly? E5-2686v4 ? Its only has 18 cores. May be you have two CPUs?
Also, what model are you talking about? With what quantization? Can you provide the full command how you run it?
@magikRUKKOLA commented on GitHub (Apr 8, 2025):
What RAM are you using?
May be you could just drop:
and
or something?
@MotorBottle commented on GitHub (Apr 8, 2025):
I mentioned that was dual socket platform above, so in total 36 cores and 72 threads.
The model was unsloth/DeepSeek-V3-0324-UD-Q2_K_XL. Around 2.5 bit dynamically quantized.
My command:
@MotorBottle commented on GitHub (Apr 8, 2025):
My RAM configuration is 16x DDR4 ECC 2RX4 32GB 2133Mhz, 256GB for each NUMA node
@magikRUKKOLA commented on GitHub (Apr 8, 2025):
Uh. Eh. I am sorry. I misread you "Dual" as "Xeon" for some raason. :)
Can you provide the dmidecode -t memory etc. ?
@MotorBottle commented on GitHub (Apr 8, 2025):
No problem.
@magikRUKKOLA commented on GitHub (Apr 8, 2025):
Very interesting! But why its configured lower than it can run (2400 MT/s)?
@MotorBottle commented on GitHub (Apr 8, 2025):
Motherboard limits