mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #40] Strata's Linux CPU topology detection counts SMT siblings separately #22
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#22
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 @jugeeeemu on GitHub (Sep 28, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/40
Summary
In Strata's Linux implementation, physical_cores() currently enumerates the logical CPU IDs allowed by sched_getaffinity(), without deduplicating SMT siblings by physical core.
This differs from the Windows implementation, which explicitly selects one
logical processor per physical core.
The CLI help also describes the default pool size as:
Existing example: #27
Issue #27 contains a Linux Ryzen 5 5600 (6C/12T) log showing:
This looks consistent with the same behavior: all 12 logical CPUs are visible
to the pool instead of one logical CPU per physical core.
Reproduction
Environment:
b742ff9CPU topology (
lscpu -e=CPU,CORE,SOCKET):With all logical CPUs visible:
With one logical CPU from each P-core plus all E-cores:
No
--pool-workersoverride was used.Performance impact
I came across this while experimenting with settings to improve performance.
For this issue, I reran the comparison under controlled conditions using the
engine's direct
strata generatepath rather than the chat/server UI.I used a small deterministic synthetic prompt with the following options:
The only variable was the process CPU affinity; no
--pool-workersoverridewas used.
0-230,2,4,6,8,10,12,14,16-23In this test, excluding the SMT siblings improved decode throughput by about
15.9%.
All six runs had identical speculative-decoding behavior:
168 rounds,346/465drafts accepted,3.06 tokens/round.Expected
On Linux,
physical_cores()should select one allowed logical CPU per physicalcore while respecting the process affinity mask, similar to the Windows
implementation.
English isn't my first language, so I used ChatGPT to help write this issue.
Sorry if any of the wording is unclear or awkward.
@Niko1221 commented on GitHub (Sep 28, 2026):
Thank you - a precise report with the measurement that makes it an easy fix. On Linux the pool now keeps one allowed CPU per physical core (package + core id from sysfs), like the Windows side, and still respects
taskset(if the first sibling is left out, the other one is used). On your 13700K that is 15 workers + the host thread by default, the configuration you measured at +16%. Checked on a 6-core/12-thread Ryzen under WSL: 11 -> 5 workers. Released in 0.1.14.