mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #3417] Work resource profile sets --pool-workers from logical threads, not physical cores (more workers than cores on any SMT machine) #1381
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#1381
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 @squidwardboom on GitHub (Oct 20, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/3417
What happens
On any SMT/hyper-threaded machine, choosing the "Work" resource profile (the wording in the UI is "We reserve GPU memory and limit CPU expert workers to leave headroom for other apps") produces a
--pool-workersvalue that is larger than the number of physical cores.On this PC:
work--pool-workersthe app writes--pool-workers 7So the profile whose stated purpose is to limit CPU workers ends up adding workers — more than either the "Full speed" profile or no setting at all would produce.
The visible symptom is a permanently pegged CPU (100 % on all threads) while the model is loaded and generating, even while idle between requests.
Where it comes from
Three small steps. Each one looks reasonable on its own.
1. The Python hardware report counts logical processors.
control/tools/strata_mcp.py,Hardware._hardware()(line 837 before the change):os.cpu_count()is documented as the number of logical CPUs — 16 here. (_mac_hardware()at line 927 has the same shape.)2. The host treats that number as physical cores.
host/server/native-resources.mjs:11-16, inresourceSettings():Math.floor(16*0.8)= 12.That this field is meant to be physical cores is confirmed elsewhere in the same codebase —
host/server/engine.mjs:288reads "CPU threads exceed physical cores (hw.cpu.cores)", andhost/server/catalog.mjs:63says "cores: physical cores detected on this machine". Note also the fallback athost/server/native-control.mjs:103-107,const cores=os.cpus().length, which is logical as well, so the fallback path has the same result.3. The value is never checked against what the CPU can actually use.
Nothing between these two functions compares the result with the physical core count. Strata already knows this is harmful, in two places that this path does not consult:
control/strata_control/tune_knobs.py:158lists--pool-workersas a known-bad setting:{"flag": "--pool-workers", "test": "above_engine_default", "reason": "more helper threads than the engine chose made it 36% slower"}control/setup.py'spool_workers_note()warns, for exactly this configuration:the config asks for 12 CPU expert workers, more than its physical cores: extra workers can make Strata slower. Recommended: --pool-workers 7So the installer will warn a user who typed
--pool-workers 12by hand, and the app will hand that same value to every user who picks the "Work" profile.Measured effect (same model, same prompt, one variable changed)
Model IQ3_S on a Radeon RX 7900 XTX. Same request each run (
max_tokens 256,temperature 0), one warm-up run then one measured run. Only--pool-workersdiffers.--pool-workers 12(app'sworkprofile)--pool-workers 7(this CPU's value)strataCPU busy50strataCPU peakThe +36.9 % matches the note in
tune_knobs.py:158almost exactly: the app's "Work" profile reproduces, by default and on every SMT machine, the one setting upstream measured as 36 % slower.Suggested fix
Report physical cores.
strata_control.tune_machine.cpu()already returns them ({'model': 'AMD Ryzen 7 7800X3D 8-Core Processor', 'logical': 16, 'physical': 8, 'hybrid': False}), so the change is local:With physical cores reported,
Math.floor(8*0.8)= 6 workers, and theMath.min(previous, workers)already innative-resources.mjskeeps any hand-set value safer than that.Two further hardening suggestions, separate from the fix above:
resourceSettings()clamp workers to the physical core count even when the OS cannot report one, so a bad hardware probe degrades to "no--pool-workers" instead of "one per thread".pool_workers_note()'s warning in the UI when the profile itself produces a setting that the note would complain about. Right now the app never sees it.Environment
Strata-0.2.0-beta-windows-hip-rdna3.exe), not from git.0.1.45.3-windows-x86_64-hip-rdna3.--pool-workers 12 --vram-reserve-mib 4915 --resident-budget-gib 40Aside worth knowing
Editing
install/strata-iq3_s.jsonwhile the app is running does not stick. The host keeps the model configuration in memory and writes it back from there (native-control.mjs:268, andresourceSettings()runs again on every start), so any manual--pool-workersedit is regenerated from the profile on the next start. That is why the local workaround had to be the source change above, plus restarting the host: no amount of editing the JSON survives.@github-actions[bot] commented on GitHub (Oct 20, 2026):
Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing:
Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment
/reopen.Details: CONTRIBUTING.md
@Niko1221 commented on GitHub (Oct 21, 2026):
Thank you, the table and the code path made this easy. Strata counted threads where it should count cores, so the Work profile asked for 12 CPU workers on your 8-core CPU. The hardware report now gives the physical core count, so Work asks for 6. This is fixed in 0.2.2.
Your numbers (27.9 vs 38.1 tok/s) match what we already knew about too many workers. If you try 0.2.2 and Work still shows more workers than cores, tell us the value you see.