mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #1912] [CLOSED] --pool-affinity measure: on a hybrid CPU, time the all and p-cores pool layouts at start and take the faster (opt-in) #3754
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#3754
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?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/1912
Author: @Xiaomi2008
Created: 10/11/2026
Status: ❌ Closed
Base:
main← Head:pr/pool-affinity-measure📝 Commits (1)
271b5b5--pool-affinity measure: on a hybrid CPU, time the all and p-cores pool layouts at start and take the faster (opt-in)📊 Changes
2 files changed (+118 additions, -2 deletions)
View changed files
📝
docs/DETAILS.md(+11 -0)📝
src/program/generate.cpp(+107 -2)📄 Description
Title
Issue: none (searched the open issues and pull requests; nothing covers this)
Summary
--pool-affinity measure(opt-in; hybrid CPUs, native packs): at start theallandp-corespool layouts are timed on the pack's own experts, and the faster one is taken.The default layout puts a worker on every physical core, and a layer's experts are done when the slowest worker is. On a Core i7-13700K (8 P + 8 E cores) the E-cores make the verify window wait, by an amount that changes from run to run, so a fixed rule did not seem right.
What is timed is the decode's own call (
run_split_multi_native): two experts of four tokens per layer, every layer in turn, the host spinning ~150 us between two layers as it does on the GPU's flags, three interleaved blocks per layout, about a second in all.p-coresis taken unlessallis more than 10% faster. One line prints both readings and the choice.What changed
measurevalue of--pool-affinity, its usage text,measure_pool_affinity()and the call before the pool is built.Extra Notes
Measured
This branch (0.1.42 + this change), Core i7-13700K, RTX 5090, 64 GB, Windows 11, Swift 1.5 IQ3_XXS, 128K context, one 8K prompt and the same 1,500 forced tokens (
--spec-follow), three interleaved rounds:all, 15 workers)--pool-affinity measure(readallat 16.4 - 17.6 ms, tookp-cores)--pool-affinity p-cores(7 workers)Its limit
It is one reading at start and is not repeated. Over four server starts of one day on 0.1.41 it read
allat 14.8, 21.9 and 25.3 ms against 6.1 to 6.2 ms forp-coresand tookp-cores; once it readallat 6.6 ms against 8.6 ms and tookall. The same dayallran the pool at 2.4 ms per window in one run and 6.7 to 13.2 ms in others. Where the E-cores' speed changes while the engine runs,--pool-affinity p-coresis the steady choice, and the docs entry says so. If a fixedp-coresdefault on hybrid CPUs is preferred to this switch, these numbers may still be of use for that.What it leaves alone
all.--pool-affinity auto | p-cores | allare unchanged.Not tested
--allow-unsupported-compiler. HIP and SYCL were not compiled; the change is ingenerate.cpp, which both build (the SYCL tree has its own copy, which this PR does not touch).Docs: one entry in
docs/DETAILS.md.The whole tuned config on this PC, through the server (context, not this change alone)
0.1.42 built from source, the same engine binary in both columns, the Python server, the same requests, two interleaved rounds (each: a start, three 9K prompts, a 54K and an 85K prompt). Core i7-13700K, RTX 5090, 64 GB, Windows 11, Swift 1.5 IQ3_XXS, 128K, image encoder on the GPU.
The tuned config differs from setup's arguments in more than this PR, so the table does not isolate it:
--pool-affinity p-cores(what this PR'smeasurepicked in three of four starts): the largest part of the decode difference. The isolated measurement is the table above (146.6 - 158.0 against 200.0 - 204.9 tok/s).STRATA_GR_V3=1and--adapt-every 1 --adapt-swaps 80 --adapt-decay 0.97, existing switches: on the same forced text, P-cores in both arms, 220 - 223 tok/s without and 236 - 239 with both (two interleaved rounds).STRATA_PF_FUSED=1and--prefill auto:16384, existing switches: the prefill rows. On 0.1.41, a 30K prompt: 5,644 - 5,676 tok/s without, 6,533 - 6,575 with both (two rounds). Quality of the fused kernel here, teacher-forced over 2,000 tokens after an 8K prompt: 17 - 19 tokens differ from the text the default prompt path generated, against 9 for the default path itself.--pcie-frac 0.25,--vram-reserve-mib 1500andSTRATA_VRAM_FREE=device(#1911): the VRAM row.Not the released 0.1.42 binary: both columns are this source build.
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.