mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #494] Decode profile (RTX A3000 + i7-12850HX): the CPU expert pool is ~half the round; pin the verify host first #227
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#227
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 @yannickloth on GitHub (Oct 2, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/494
Context
A decode-time profile of the RTX A3000 12 GB laptop + i7-12850HX host from #485, on production engine 0.1.35
(Qwen3.8-Flash-Next Swift 1.5 IQ3_XXS native pack, the calibrated
--pcie-frac 0.35 --spec-min-p 0.70 --pool-workers 8), from the engine's own--statsaccumulators. Full write-up and raw lines:bench/results/2026-10-02-rtx-a3000-i7-12850hx/profile.md(PR #489).The split
One verify-window round, ms and share of the round's wall clock. A round emits 2.10 tokens at the fresh hit
rate and 1.15 when the output degenerates and hits more.
hit_rate 0.354hit_rate 0.756Real serve traffic on this host ran
hit_rate 0.35-0.65(34-40 tok/s), i.e. the fresh-decode end. There theCPU expert pool is the largest single term, and the GPU is second.
What it sizes
pool.hpppinned vs in-loop rates (36.3 vs 26.9 GB/s, ~1.35×) is worth ~+8-15% tok/s. The pool measures only18-22 GB/s over the rows here, so there may be more than 1.35× to win. The
generate/session path alreadypins the host (
SessionLoopScratch::init), but the serve/specVerifier::rundoes not — the doorbell-spinninghost and the PCIe-copy helpers are free to land on a worker's core.
The i-quant gate/up is ~68% of the pool and documented codebook-bound, so VNNI barely touches it.
cudaStreamSynchronizeis already ~0 ms/round on this host. The MTP drafter'sper-draft syncs live inside the 4-6% MTP term and are the only part of that area with headroom.
--pool-workers 8on the default--pool-affinity alldoes not land on 8 P-cores;it pins cores
2,4,6,8,10,12,14,16= seven P-core primaries + the first E-core, and the E-core is the tail ofevery split-row drain.
--pool-affinity p-coresavoids it but starts onlyp_cores - 1 = 7workers.Notes for measuring this model
The native IQ pack runs verify windows only, so
--gpu-stages,--gpu-only-fulland--no-pool+--specareunavailable (
session_replay_stages: not captured with the split, etc.), and/metrics'ram_blobs/file_blobs/file_mbare 0 on theMAP_HUGETLBarena. The verify-window "wait for rings" term isthe GPU floor available on this path; the 26.32 ms graph floor is the non-native path's.
Refs #485 (the probe's low reading matters via
pcie_frac, not via bandwidth: PCIe in use is ~4 GB/s) and #487.@yannickloth commented on GitHub (Oct 2, 2026):
P1 measured: no serve-path collision on this host — the host is already pinned, so no code is needed.
Before writing a fix I ran the Phase 0 census and a same-binary A/B, on production 0.1.35 (
--serve --spec 4 …, Swift 1.5 IQ3_XXS native pack,--pool-workers 8).Collision check
During an active serve decode,
/proc/<pid>/task/*/statusplusps -Lsampled 120 × 50 ms: the only busy non-worker thread is the engine main thread,Cpus_allowed_list: 0; the 8 pool workers are on2,4,6,8,10,12,14,16. Exactly nine busy threads (host + 8 workers), the host on core 0 in every sample. No worker core is ever shared.Why:
SessionLoopScratch::init(src/core/session.cpp:547) is called unconditionally inmain()(src/program/generate.cpp:3607) before the serve/verifier block (:4200), so the serve host is pinned to the pool's reserved core beforeVerifier::runever executes. The "serve verifier is unpinned" premise is a code-location asymmetry, not a behavioral one.A/B
Same binary,
STRATA_NO_VERIFY_PINoff/on,bench/e2e.sh, fixed prompt,max_tokens 200, interleaved, 6 runs per arm, alternating order:Mean delta −0.3%, median −5.1%: not the >3% win
tools/calibrate.pyrequires (the host is noisy, ±20%).A guarded
Verifierpin was implemented and verified (fixed-prompt output bit-identical on/off;pool_test/pool_stress/expert_parity/verify_host_pin_test/expert_layout_test/expert_cache_per_layer_testand 10 parity tests pass), but it only re-pins the already-pinned thread, so it is ~0 perf. I closed PR #501 rather than merge redundant code.Plan order: P1 is done/no-op on this host; the next real gain stays P7/P8 on the codebook-bound pool.
@Niko1221 commented on GitHub (Oct 2, 2026):
Thank you for the detailed profile and for closing #501 after measuring it. The verify thread is already pinned by the session setup, so the -0.3% fits. Two leftovers we noted:
--pool-workers 8with--pool-affinity allcan put a worker on an E-core, and--pool-affinity p-coresstarts p_cores - 1 workers. The remaining gain is in the codebook-bound pool kernels (your P7/P8), which stay on our list. Closing as a report.@yannickloth commented on GitHub (Oct 3, 2026):
Thanks for the careful handling here and for keeping the pool kernels (P7/P8) on the list. The work behind 0.1.38 is appreciated.
What you are building is the difference between running a SOTA model locally and having to pay for cloud/API access — that is not a negligible feat.
@yannickloth commented on GitHub (Oct 3, 2026):
P7 (i-quant gate/up) follow-up is now a dedicated report: #616 — the AVX2 codebook gather is bit-exact and a stable 1.3x isolated, but gives +1.0% e2e and zero gain at 15 workers, so the pool is not decode-bound there. Moving the long version there to keep this closed thread short.