mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #410] Greedy output varies between server requests, but not between fresh engine runs (STRATA_IQ_MT_MIN=1, 0.1.32) #192
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#192
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 @brenoperucchi on GitHub (Oct 1, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/410
Follow-up to #152. With
STRATA_IQ_MT_MIN=1, temperature 0 still gives different answers to identical requests onthis machine. The engine itself looks deterministic: the variation comes from state the server carries from one
request to the next, and the adaptive expert tier explains at least part of it.
Machine: RTX 5090 32 GB, Ryzen 9 5950X (Zen 3, AVX2 only), 96 GB DDR4-3200, Windows 11 26200.
Engine: 0.1.32 from the release zip, with the
v0.1.32checkout'sserve/server.py.Model and config: Flash-Next IQ2_XS with
--expert-cache auto --spec 4 --mtp <rt> --max-context 32768 --kv int8 --pcie-frac 0.55 --spec-min-p 0.70andSTRATA_IQ_MT_MIN=1.Requests:
/v1/chat/completions,temperature 0,seed 42,cache_prompt false,max_tokens 256, one afteranother on one server. We compare the SHA-256 of the returned content.
Results
--tokens(41 fixed ids)--max-new 64STRATA_DUMP_FIRST_LOGITSfile is identical too--prompt-cache 0--prompt-cache 0 --adapt-swaps 0--prompt-cache 0 --adapt-swaps 0 --no-prefill-borrowWith the defaults, draft acceptance on the short prompt moved between 36 and 37 of 48-49 across requests even when
the text came out the same.
On 0.1.31 we had already ruled out the GPU/CPU split by itself: with
--expert-cache 1 --pcie-frac 0(decode cachehit rate 0.1%) outputs still varied, 2 to 3 distinct in 5. The adaptive tier was on in that run.
What we think is going on
The adaptive tier moves experts between RAM and VRAM based on what earlier requests routed. The GPU and the CPU round
the same expert differently (the startup message says so), so the same token can be computed on a different device
from one request to the next. Turning the tier off made the short prompt reproducible.
We cannot explain the medium prompt yet. It still varies with the tier off and with
--no-prefill-borrow, while thelonger prompt does not. Something else that persists between requests seems to affect the prompt path at that length.
We are not reporting a quality problem. Greedy repeats are not byte-identical, which gets in the way of A/B tests.
The docs say
STRATA_IQ_MT_MIN=1makes the answer independent of the drafting. It may help to add that theadaptive tier (and maybe other server state) still changes it, and that
--adapt-swaps 0removes that part. We canrun more tests here if you tell us what to try.
@Niko1221 commented on GitHub (Oct 1, 2026):
Thanks, a careful write-up, and your reading of the first part is right.
--adapt-swaps) moves experts between RAM and VRAM based on earlier requests, and the GPU and the CPU round the same expert differently, so the same token can come out differently from one request to the next.--adapt-swaps 0removes that part.--prompt-cache) lets a repeated request continue from a saved state and read only the new tail, through the decode path instead of the batched prompt path. Same quality, different rounding. A fresh CLI run always reads the whole prompt in one batch, which is why it's stable.STRATA_TRACE=1in the config'senvand post the engine's lines for two requests that differ? We're after theprompt N = R reused + M readline and the expert cache and prompt-path lines. Also check whether a server restarted before each request gives one output.We'll add 1 and 2 to the reproducibility notes in DETAILS.md (byte-identical repeats need
--prompt-cache 0 --adapt-swaps 0besidesSTRATA_IQ_MT_MIN=1). Keeping this open for 3.@brenoperucchi commented on GitHub (Oct 1, 2026):
Ran it again on 0.1.33 (release binary) with
STRATA_TRACE=1,--prompt-cache 0 --adapt-swaps 0andSTRATA_IQ_MT_MIN=1, same IQ2_XS config as above. The 2,671-token prompt from the first report is private, so I usedpublic prompts built from this repo at
v0.1.32: the first 9,000 bytes ofsrc/core/expert_source.cppwith a reviewinstruction (2,644 tokens) and the first 50,000 bytes with a summary instruction (14,649 tokens). Identical requests,
temperature 0, seed 42, 256 output tokens. The hash covers
reasoning_contentandcontent, since with theseprompts the model spends the 256 tokens thinking.
--no-prefill-borrowaddedSo the remaining variation is not tied to one prompt length here: our medium prompt was stable this time and the long
one was not. A restart before each request gives one output, so some state still carries over between requests with
both options off.
--no-prefill-borrowdoes not remove it.The two long requests that differed, from the same server. The prompt side is identical, and the first difference
in the trace is 62 tokens into the reply, where the window at position 14710 held 2 tokens in one request and 4 in the
other:
The full engine logs for these runs (including every
windowline) are ready to attach if useful.@Niko1221 commented on GitHub (Oct 2, 2026):
We reproduced it here and found the remaining part: the PCIe share of the missed experts (
--pcie-frac, which streams part of them to the GPU instead of computing them on the CPU). IQ3_XXS, a 3.6K-token prompt, 4 identical greedy requests on one server:STRATA_IQ_MT_MIN=1--prompt-cache 0 --adapt-swaps 0 --no-prefill-borrow(yours)--pcie-frac 0So with your settings, the PCIe share still made the first answer after a start differ from the next ones. It's a GPU-vs-CPU rounding difference like the others, not a quality issue. 0.1.34's DETAILS.md (reproducible greedy output) now says: for byte-identical repeats through the server use
--prompt-cache 0 --adapt-swaps 0 --pcie-frac 0withSTRATA_IQ_MT_MIN=1.--pcie-frac 0costs decode speed, so keep it for A/B runs. Closing; reopen if those settings still vary on your PC.@brenoperucchi commented on GitHub (Oct 2, 2026):
Confirmed here on 0.1.34 (release binary), IQ2_XS, with
--prompt-cache 0 --adapt-swaps 0 --pcie-frac 0andSTRATA_IQ_MT_MIN=1: 4 identical answers out of 4 on each of the three public prompts (63, 2,644 and 14,649 tokens), the first request after a start included. Draft acceptance still moved a little between requests (136-137 of 166-172 on the long one), with the same text every time. Thanks for tracking it down.