Repository navigation
Pin the multi-turn determinism probe to a backend that can be deterministic - #10234
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
f349e89 to
4fcaca1
Compare
|
@codex review |
|
Security review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
GGUF inference smoke (API, tools, vision)andChat UI, API, Update and GGUF inferenceare red onmainand on roughly 25 open PRs, on Linux and macOS, with:Nothing in the branches under test can reach that code path, and no commit correlates: the last green run on
mainis #10131 and the first red is #10090, which touches onlycontext_refusal.pyand the Anthropic error-wording paths. The run 20 minutes later passed.What is actually happening
The probe compares two replays of a greedy conversation,
check(label, runner(), runner()). The server it compares them against runs with speculative decoding on.gemma-3-270m-itis a non-MTP GGUF, so_speculative_flagstakes theelseatstudio/backend/core/inference/llama_cpp.py:25338and appends--spec-default. The launch line in the failing run's own artifact:That flag does not mean "no drafter". The server logs from the same run:
n-gram drafting, live, on every request. The draft pool is built from text the server has already seen, so the first turn-1 request after a load drafts nothing and decodes one token at a time, and every later one verifies a ~32-token draft in a single batch.
check(runner(), runner())evaluates its arguments left to right, so attempt 1 always compares the one cold replay against a warm one.llama-server's README says what that costs: "the logits are not guaranteed to be bit-for-bit identical for different batch" sizes. And the divergences match that exactly. They are nested prefixes of each other, not different content:
A sampler that stopped being greedy produces different words. A 270M model near-tied on
<end_of_turn>produces that ladder.The green runs were diverging the same way. Comparing the last green run (33691479198) against the red one (33731460405), turn-1 requests are identifiable by their 35-token prompt:
draft acceptance = 0.06250draft acceptance = 0.46875Identical argv, identical
unslothai/llama.cpp b10715, identical model snapshot. The only difference is luck. TheATTEMPTS = 3retry added in #10025 was carrying it.Prompt caching is not the variable and never was:
_apply_seeded_llama_requestalready setscache_prompt = Falsefor a seeded request, and every turn-1 request re-processes all 35 prompt tokens, including one the server matched atf_sim_best = 1.000. Slot contention is not it either: every request in both runs landed on slot 3.The fix
Pin the probe's load to a configuration where greedy decoding is reproducible, and have the script check the pin took. The byte-exact comparison is unchanged: loosening it is what would hide a real regression.
The three loads that feed
multi_turn_chat.pygain"speculative_type": "off", "n_parallel": 1.offis a documentedLoadRequestvalue and takes theeffective_mode == "off"branch, which emits no speculative flag at all.n_parallel: 1also drops--kv-unified, whose shared-pool occupancy is a second input to the batch. Only those three loads change. The tool-calling and vision phases keep both defaults, so the configuration real users get stays covered by CI for correctness.A workflow pin nobody verifies is worth nothing, so
main()now callsassert_reproducible_backend()before it generates anything. It reads/api/inference/status, which already publishesspeculative_typeandparallel_slotsthrough_InferenceRuntimeFields, and fails with a named reason:That is the difference between a mystery divergence and a sentence. #5669 left this leg printing a warning instead of asserting for three months because nothing was watching the check itself, so two new tests in
tests/studio/test_smoke_workflows_share_one_script.pywatch this one: every leg must carry both pins ahead of the probe, andmain()must refuse a server reporting either the wrong drafting mode or more than one slot. 13 passed.ATTEMPTS = 3is deliberately left alone; the existing retry contract test needs it. Once all three legs have run green on the pinned config for a couple of weeks it should come down to 1, since over a genuinely deterministic config a retry can only hide an intermittent sampler regression.What this still catches
temperature: 0no longer mapping to greedy, from a reordered sampler chain or a coerced default_operator_sampling_overrideor_fill_recommended_sampling_openaioverriding an explicittemperature: 0.0repeat_penalty/presence_penaltydefault leaking into a greedy request and moving the argmaxseedbeing dropped, or_apply_seeded_llama_requestno longer settingcache_prompt = False, since prefix reuse reintroduces the batch-shape difference immediately and fails/v1/messagesdiverging from/v1/chat/completionsWhat it no longer catches
Byte-equality in the default, speculative-on configuration, which is the one users get. That is deliberate: it is not a property llama.cpp offers, and asserting it produces exactly this flake. Coverage of the drafting path itself belongs in a probe that asserts acceptance rate or quality, not byte-equality.
Two things found next to this, filed as notes rather than fixed here
--spec-defaultis read as "no drafter" throughoutllama_cpp.py. Three branches append it underlogger.warning("... loading without speculative decoding.")(:25054,:25063,:25091), and the comment at:25275states "these models fall through to--spec-default, i.e. no drafter at all". The draft-acceptance lines above say otherwise. Those branches want--spec-type none, the spelling the MLA branch at:25220already uses. The non-MTPelseat:25338is a separate decision and may well be intended.The seed reproducibility contract is overstated.
_apply_seeded_llama_request's docstring promises "repeated requests stay reproducible" and delivers onlycache_prompt = False. With drafting on for every non-MTP GGUF that is not true, and llama.cpp offers no per-request remedy: its server schema keeps the whole speculative block,speculative.typeincluded, under#if 0. Either narrow the docstring or have a fixed seed also select a non-speculative load.