mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #4673] [Engine] T=0 answers are not reproducible: byte-identical requests differ within one session (0.1.52 and 0.1.54) #2130
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#2130
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 @udqe on GitHub (Oct 30, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4673
Summary
temperature: 0on the local server does not give the same answer twice, on two engine builds, at text level and in the final answer. And it is not the sampling: atT=0.8the sameseedtwice gives different continuations, so the OpenAIseeddoes not pin a response here either (parsed and forwarded, never rejected; no effect visible). This is the Windows/CUDA server path, engine 0.1.52 (release 0.2.7.1) and 0.1.54 (release 0.2.8). It matters because the benchmark culture here compares outputs for equality ("outputs differed, quality not evaluated" in a #4522 test right now): on this engine an output-equality check proves nothing, and a single wrong answer can be the engine, not the model, not the PR.Area
[Engine] (server and engine behaviour; the mechanism stays open - suspects below, no kernel claim)
Desktop app, Terminal or source?
Terminal install, engine started from a run config, Windows 11,
0.1.52-windows-x86_64-cuda-cuda13and0.1.54-windows-x86_64-cuda-cuda13.What happened (measured)
Byte-identical
POST /v1/chat/completionsbodies, back to back in one session:temperature: 0: 4/4 prompts differ on 0.1.54 and 4/4 on 0.1.52; across two same-config sessions the final answer of a logic puzzle flips (verbatim pair below).temperature: 0.8+ sameseed: 1234twice: differs (content and reasoning).temperature: 0.9, seed: 999twice gave3f9ab71d0e4c2a85then3f9a2bc7d4e18f60.logprobs: trueworks (per-token entries come back) - it is a working feature, not a stub; only itstop_logprobswas empty in our replies.enable_thinking: false(the server's off-switch, distinct from a plainthinkingfield the server does not read): the template's empty-thinking path is taken, yet the model still writes reasoning (thereasoning_contentreply field, ~700 tokens atmax_tokens: 300), and within one batch of five byte-identical T=0 requests the answer field came back empty all five times while the batch before it answered - the emptiness itself varies.Smallest steps or command that reproduce it (~30 s, paste-ready)
PowerShell (Windows), against a loaded model - set
$modelto the name shown byGET /v1/models:bash/macOS/Linux (needs
jq):Three identical hashes = deterministic.
max_tokens: 1500is deliberate: reasoning models spend the budget before the answer. To check the seed claim, addseed = 1234; temperature = 0.8and compare thereasoning_contenttoo (a content-only compare can match on the answer while the reasoning diverges).What it looks like when it bites (verbatim, engine 0.1.52, same run config, two sessions)
Session A1 (two identical runs, both this):
The card in slot 3 is B. The constraints force the consecutive block D-A-B-C, and since E cannot occupy slot 5, this block must start in slot 2, placing B in slot 3.Session A2:
The card in slot 3 is A. The constraints force the consecutive block D-A-B-C, and since E cannot be in slot 5, the block must occupy slots 2 through 5, leaving A in slot 3.A1 is wrong and reads fine (block at 2-5 means slot 5 is E, which the puzzle forbids).
Reproduction status
Reproduced locally, repeatedly, two engine builds: 4/4 within-session (both builds), the final-answer flip above, the seed pair and the hex-string pair today on 0.1.54.
Graphics card, memory and system
2x RTX 4090 (24 GB), TR3970X, 128 GiB RAM, Windows 11. Our config is a split (
--layer-split 22,--pipeline-windows 2,--spec 4with the MTP drafter); NOT tested: single-card,--spec 0,--pipeline-windows 0, HIP, Metal. Suspects, as suspects only: the speculative accept path at T=0, the second pipeline window / continuous batching, KV-cache state carried from the previous request, non-deterministic kernels.Strata version
Control/CLI 0.2.8; engine 0.1.52-windows-x86_64-cuda-cuda13 (release 0.2.7.1) and 0.1.54-windows-x86_64-cuda-cuda13 (release 0.2.8) - identical behaviour.
Model, size and settings
Qwen3.8-Flash-Next UD-Q4_K_XL native pack; requests set only the fields named per test above; server defaults otherwise;
logprobsreturned entries, so the requests were not silently dropped.What we checked before blaming the model or a knob
Bodies byte-identical (the script re-sends the same string); the seed field is parsed and forwarded both in the server (
serve/server.pyaround the sampling-key build) and in the engine (seedkey in the request parse) - static reading of the 0.2.8 source, unconfirmed static analysis; the hex-string pair above is the executed proof that the seed changes nothing; a trim on/off spot-check differs between identical-config sessions just as much as between trim arms - the knob under test does not need to exist for outputs to differ.What we would like
temperature: 0guarantees on this server (greedy is not the same as reproducible) - and the same line forseed(accepted; no reproducibility promised).engine / backend / single|split / spec on|off / result PASS|DIFFER- we will know quickly whether this is our split path or universal.(AI-assisted: the model served by this repo's engine ran the probes and drafted this; the request/reply pairs above are ours, verbatim. An earlier revision of this issue called
seed"ignored" before we read the source; corrected here, same day.)@github-actions[bot] commented on GitHub (Oct 30, 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
@github-actions[bot] commented on GitHub (Oct 30, 2026):
Thanks, this follows the format now.
@Cryonic7 commented on GitHub (Nov 4, 2026):
Also on engine 0.1.56, across engine starts. That's Strata 0.2.10, a stock build for sm_89, on an RTX 4090 with Windows 11 and CUDA 13.4.
What we ran: two identical starts with:
STRATA_IQ_MT_MIN=1andSTRATA_ROUTE_TAIL_SKIP=0;--prompt-cache 0 --adapt-swaps 0 --pcie-frac 0;--expert-cache 5966, 7,800 slots in both starts);--spec 4 --spec-min-p 0.5).Result: 0 of 7 greedy answers were the same, and that happened twice. The 7 were four ~1K-token answers and a three-turn ~100K-token conversation. The first ~1K answer diverged within its first 300 characters, and the ~100K answers differed from the first character. The model was Swift 1.5 IQ3_S at 262K context.
For comparison: the same switches, with the slots pinned, gave byte-identical answers across 4 starts on the same machine (11-02). That was on our local builds of engine 0.1.45 and of 0.2.9 (engine 0.1.55). So this changed somewhere between 0.1.55 and 0.1.56 for us. Not bisected.
@udqe commented on GitHub (Nov 4, 2026):
Our box re-tested today on engine 0.1.56 (app 0.2.10, 2x RTX 4090, Windows 11, UD-Q4_K_XL at pw2, conversation cache on) - three data points, and one of them narrows @Cryonic7's otherwise strong framing.
1. Same-session byte-identity at T=0 on .56: not always dead, just unreliable. The original body's "4/4 differ" was a back-to-back block; today's equivalent (five byte-identical bodies of a short logic puzzle, greedy, one session) gave runs 1 and 2 byte-identical, then divergence by run 5 - four distinct outputs in five. Same session, same prompt, greedy, and a pair still matched while a later pair did not. Whatever perturbs the logits is state-dependent, not a constant per-start property. Worth noting the converse trap for any equality protocol: for our prompt style a "reply with one 16-character hex string" request came back with the same canned
0123456789abcdefevery time (the model, not the engine, recycling an example-like string) - an equality check on such outputs passes vacuously; improvisation prompts ("invent a product review") are the honest probe.2. Seed does not pin on .56 either - reproducing the body's claim on the new build: same body with
seed: 999twice attemperature: 0.9differs, andtemperature: 0, seed: 7twice differs too; five seed-carrying bodies produced five distinct outputs. Nothing in .56 changed there.3. The shape of the divergence at greedy was itself informative this time: the two
T=0, seed: 7replies opened with the identical clause - "I wasn't expecting the" - and first differed at the invented gadget noun ("Pocket Thunderstorm" vs "Sock Whisperer"). A fixed function-word prefix diverging at the first content token is what a small logits perturbation looks like - the tie breaks one way, then the continuations fork - and it is different from what a sampling-stage bug at T=0 would produce (forking from token one, uniformly).@Cryonic7 your before/after bracket (0.1.45 and 0.1.55 byte-identical across 4 starts vs 0/7 twice on 0.1.56, prompt-cache and adapt off, expert cache pinned) is the cleanest cross-start evidence on this thread, but I have to push back on "changed somewhere between 0.1.55 and 0.1.56" as the scope: this issue's original measurements showed 4/4 differing at T=0 already on 0.1.52 and 0.1.54 on our stack, so same-session non-reproducibility predates your window; what your data changes is cross-boot reproducibility, and the two may not be the same failure. Two axes worth separating on your box (both cheap): (a) do your .56 runs ever produce a byte-identical within-session pair, the way we just got on .56 and the way your .45/.55 cross-start pairs did? If within-session still sometimes matches on .56, the .55->.56 delta narrowed a boot-scoped variance (first-request state: cache warmth, arena residency, pinned-copy timing) rather than introducing divergence per se; (b) your 100K three-turn conversation diverged from the first character - is that also true from the first character of turn 1 on two cold starts, or does turn 1 match and the fork land at turn 2 (after context-accumulated state)? Ours is a corner we cannot probe today: cross-boot testing needs engine restarts, and restarts on this box happen by manual policy only - recorded as untested rather than guessed.
Mechanism stays open exactly as the body left it; none of the above is a kernel claim - it is the same "an output-equality check proves nothing" conclusion, plus, today, a second conclusion: even a within-session equality check only proves inequality when it finds it.
(ai-assisted; measurements: udqe production boot, engine 0.1.56 windows-x86_64-cuda-cuda13, greedy T=0 and seeded arms above; contrast with the 0.1.52/0.1.54 pairs in the body)
@Cryonic7 commented on GitHub (Nov 4, 2026):
Thanks for splitting this into the two axes, testing them is what turned up the cause for us.
Fair point on scope. Our 0.1.45/0.1.55 bracket was about repeats across starts with the switches on, on our lab builds, not the within-session case in the body. Correction: only the second of the two "0 of 7" runs in my last comment had
STRATA_ROUTE_TAIL_SKIP=0, not both. The first had tail skip at its default (on).Re-ran both today on stock 0.2.10 (engine 0.1.56, RTX 4090, Windows 11) with the same switches (
STRATA_IQ_MT_MIN=1,STRATA_ROUTE_TAIL_SKIP=0,--prompt-cache 0 --adapt-swaps 0 --pcie-frac 0, MTP--spec 4 --spec-min-p 0.5, and 7,800 expert slots in every start). Two cold starts, each running the ~100K question first, then one ~1K question 5 times, then the ~100K question again.(a) Within one session the ~1K repeats gave 4 distinct texts out of 5 in one start (one identical pair) and 5 out of 5 in the other. The forks were at characters 242 to 775, mostly the same near-tie (the order of two examples in a docstring). The ~100K question asked twice in one session differed from the first character in both starts ("The EngineSwap mechanism..." cold, "Based on the notes from..." later), though the two later answers matched each other across starts for 543 characters.
(b) Turn 1 on two cold starts matched for 52 characters, then forked at a near-tie ("introduced around 2026-10-19" vs "introduced 2026-10-19"). So my "differed from the first character" didn't come from accumulated turns. In that run the ~100K conversation came after four ~1K requests, and the first word depends on what ran before it in the session.
For us the cause is the CPU prefill share. Its default limit went from 1,024 to 3,072 tokens in v0.2.10 (c4082ce8/de830800, 10-31, not in v0.2.9), which brings our 1,040-token prompt into it, and part of the ~100K read as well (the cold ~100K answers only repeat with it off). Same two-start run with
STRATA_PREFILL_CPU_SHARE=0added:The ~1K read went from 0.9 s to 1.7 s with it off, and the ~100K read was unchanged (~32 s).
It might be worth trying on your box too. The share has been on by default for chunks under 1,024 tokens since v0.1.41 (
162ce64e), so a short prompt would have had it on 0.1.52 and 0.1.54 as well, if it arms on your setup. DETAILS.md says a layer split and batch slots keep it off, so that depends on how your two cards are set up. If you try it, keep the expert slot count the same in both starts (we pinned 7,800). On our own build with the share off, two starts that got 7,800 and 7,641 slots matched on 5 of 7 answers, and on 7 of 7 once both had the same count.DETAILS.md's "Reproducible output" paragraph doesn't list
STRATA_PREFILL_CPU_SHARE=0orSTRATA_ROUTE_TAIL_SKIP=0(OLDER_GPUS.md:278 lists both), and theSTRATA_PREFILL_CPU_SHARErow still says chunks under 1,024 tokens. Might be worth adding both switches to that paragraph?(AI-assisted: Claude Code ran the starts and the comparisons on my machine. I reviewed the results and this reply before posting.)