mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #1235] Sapphire Rapids (Xeon w7-2475X): +8% decode, +3% prefill and byte-identical greedy output. STRATA_IQ_MT_MIN=1 is faster here, and 8 stager threads beat 32 #508
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#508
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 @enkynakamura on GitHub (Oct 6, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/1235
Hi @Niko1221 , I ran a measured tuning pass on my workstation and three results go against current defaults or docs. Numbers only, all from the CLI harness. Happy to run more arms if useful.
Setup
-DCMAKE_CUDA_ARCHITECTURES=120, Release)--native),--expert-cache 2390(2672-2675 slots in every run),--pcie-frac 0.33,--kv int8, yarn ×382f46a8)1.
STRATA_IQ_MT_MIN=1is faster on this CPU, not slowernative_expert.cpp:79-96and DETAILS.md give -1..-3% decode for MT_MIN=1 (Ryzen 7600, IQ3_S). On the w7-2475X with UD-IQ4_XS it is the opposite. Clean comparison, both arms with--suffix-draft 0(output identical within each arm), 1424-token prompt,--spec 4:--suffix-draft 0--suffix-draft 0+STRATA_IQ_MT_MIN=1+4.9% decode, -17.2% gate/up time, with slightly more distinct experts per layer in the MT_MIN=1 arm. The 0.1.40
STRATA_IQ3S_MT1path does not cover this case (it requires!cpu_avx512_ok()and IQ3_S).2.
STRATA_STAGER_THREADS: 8 beats the default 32 for a UD pack with its experts in RAMprefill.cpp:861picks 32 threads whenever any expert istransient(). For this pack everything sits in RAM / file cache (the decode log reportsfiles 0 blobs, 0.0 MB read), and 32 is slower. 352K-token prompt, tuned config otherwise identical:+5.9% prefill for 8 vs 32. Outputs identical in all 9 runs. The 32-thread rule was measured on a pack that really reads the SSD; maybe the choice could depend on whether the transient experts are actually cached.
This may be the same mechanism as #1056 (Stager threads yield-spin; PR #1101 is still open). I have not tested #1101 here.
3. Reproducible greedy output without the speed cost
Same 1424-token prompt,
--spec 4,STRATA_IQ_GATHER=1,STRATA_IQ_PREFETCH=4096in all arms:STRATA_IQ_MT_MIN=1--adapt-swaps 0 --pcie-frac 0--suffix-draft 0--suffix-draft 0+ MT_MIN=1MT_MIN=1 alone did not make the output reproducible; turning the suffix drafter off did, while keeping
--pcie-frac 0.33and the adaptive tier on. Most of the recipe's cost seems to come from--pcie-frac 0: that arm computes 17.6 distinct experts per layer on the CPU against 7.5-7.8 in the others.My guess at the cause (not proven): the lookup vs MTP choice in
DraftPolicyis driven by measured wall-clock round time (generate.cpp:10831-10834→draft_policy.cpp:84-87), so timing noise changes the windows and from there the expert grouping and the PCIe share.On v0.1.40.1, 352K-token prompt: the tuned config (
--suffix-draft 0, MT_MIN=1) gave 1 hash in 3 runs; the default drafting gave 2 hashes in 3 runs.In #410 (0.1.32, Zen 3, IQ2_XS), fresh CLI runs with MT_MIN=1 were stable. Here fresh CLI runs with MT_MIN=1 still varied while the suffix drafter was on. In the #410 trace, the first difference is a window that held 2 tokens in one request and 4 in the other.
These are fresh CLI runs. I have not tested repeated requests through the server (#410).
Minor
STRATA_IQ_GATHER=1on Sapphire Rapids: pool GB/s 55.9 [55.7-56.0] → 59.2 [59.1-59.5] (+5.9%). It is bit-exact: same hash with and without it under--suffix-draft 0. The comment iniq_avx512.cpp:31-32only reports the Zen 4 slowdown; on Intel it may be worth enabling by default.--expert-cache Nhelp text (generate.cpp:803) says "keep N expert blobs resident". With a native pack and a profile, N × max_blob is a byte budget (generate.cpp:3921), so 2390 gave 2672-2675 slots here.End result on v0.1.40.1 (352K-token prompt)
Both arms use the same args and differ only here. Defaults:
--spec 4, no env. Tuned:--spec 5 --suffix-draft 0, plusSTRATA_IQ_MT_MIN=1 STRATA_IQ_GATHER=1 STRATA_IQ_PREFETCH=4096 STRATA_STAGER_THREADS=8.Decode +8.2%, prefill +3.0%. The tuned output was identical in 3 runs; the defaults produced 2 different outputs.
@Niko1221 commented on GitHub (Oct 13, 2026):
Thanks for the report. To keep the tracker current we are closing issues older than three days: 0.1.44 is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1.
If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.