mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #798] Hybrid CPU detection on Linux counts only the Turbo Boost Max 3.0 "favored" cores as P-cores (Core Ultra 7 270K Plus: 2P/22E instead of 8P/16E) — affects setup's --pool-workers and --pool-affinity auto|p-cores #359
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#359
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 @WUZICANGJIE on GitHub (Oct 4, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/798
Summary
On Linux both
setup.py(cpu_cores(), line 371) and the engine (src/kernels/cpu/pool.cpp, lines 221 and 253) classify a core as a P-core only when itscpu_capacityequals the maximum. On Intel CPUs with Turbo Boost Max 3.0, the kernel gives the two "favored" P-cores a slightly higher capacity than the other P-cores, so only those two are counted as P-cores and the remaining six P-cores are treated as E-cores.Environment
6f32ec0(engine 0.1.39), HIP build, RX 9070 (gfx1201)Data
What happens
setup.cpu_cores()returns(2, 22), sohybrid_pool_workers()recommends 12 workers instead of the 15 the #642 rule intends for 8P + 16E (p - 1 + e // 2).hybrid CPU detected (2 P-cores / 2 threads, 22 E-cores). With--pool-affinity p-coresor--pool-affinity autoand no explicit--pool-workers, it starts 1 expert-pool worker (pool workers: 1).--pool-affinity autowith an explicit--pool-workers 16still lands on CPUs 1–16 (the misclassified P-cores 1, 3–7 sort first by CPU number), so it happens to work.Measured effect (decode, IQ2_XS, greedy 400 tokens on a cached 7K prompt, 4 runs after 2 warm-up runs, engine 0.1.38)
all, one per core)--pool-affinity auto(default count)--pool-affinity p-cores(default count)--pool-workers 12(default affinity)--pool-affinity auto --pool-workers 16On this machine the GPU is the bottleneck once the E-cores are out of the way (8, 12, 14 and 16 workers with the default affinity all gave 66.5–66.8 tok/s), so the wrong count costs little here. On a machine where the CPU half dominates, 1 worker (
p-cores/autodefaults) or a too-small recommendation would likely cost more.Suggested fix
/sys/devices/cpu_core/cpus(P) and/sys/devices/cpu_atom/cpus(E).cap >= 0.9 * max_cap) instead ofcap == max_cap. Here that separates 1024/1012 (P) from 768 (E).EfficiencyClass) is not affected.I have not checked whether other Turbo Boost Max 3.0 CPUs (e.g. Raptor Lake) report unequal P-core capacities in the same way.
This report was drafted with an AI assistant; all numbers above were measured on my machine.
@Niko1221 commented on GitHub (Oct 6, 2026):
Fixed in 0.1.40: setup and the engine take the P/E split from Intel's cpu_core/cpu_atom lists when they exist, else an E-core is one under 90% of the largest capacity, so the Turbo Boost Max 3.0 'favored' cores no longer hide the other P-cores. A Core Ultra 7 270K Plus is now 8P + 16E, 15 workers.