Repository navigation
[superseded by #1961] fix(provider): no default presence penalty on Qwen 3.5/3.6 - #1946
Draft
jonathan308 wants to merge 4 commits into
Draft
jonathan308 wants to merge 4 commits into
jonathan308 wants to merge 4 commits into
Conversation
…cheable (red) The catalog Qwen3.5-9B, qwen3.5-35b-a3b and qwen3.6-35b-a3b-vl-mtp-mxfp8 builds run an embedded MTP head that keeps the prompt history (mtp_mode auto). The engine captures their resident and SSD checkpoints only from rows that can speculate (mtpTakeHistoryState, CompleteCheckpointCapture.capture), and it never speculates a row with a repetition, frequency or presence penalty (EngineLoopV2.mtpBasicEligible). Since 0.10.5 (#1652) a request that omits presence_penalty gets 1.5 on these builds, so it neither speculates nor donates a checkpoint. Coordinator bodies carry the registry's temperature, top_p and top_k, never a penalty, so this applies to every hosted request. Fails on dev 0f11fbe: the bare and the coordinator-shaped request get presence_penalty 1.5.
…, so they speculate and cache again #1652 (0.10.5) gave a request to the catalog Qwen3.5-9B, qwen3.5-35b-a3b or qwen3.6-35b-a3b-vl-mtp-mxfp8 build that omitted presence_penalty the model card's 1.5. The engine drafts no row with a penalty (EngineLoopV2.mtpBasicEligible), and these builds' MTP heads keep the prompt history, so such a row observes no assistant history and stages no resident or SSD checkpoint (mtpTakeHistoryState; CompleteCheckpointCapture.capture throws incompatibleCheckpoint without it). Coordinator requests never carry a penalty: since platform #492 the coordinator sends these builds' registry temperature 1, top_p 0.95 and top_k 20 only. So every hosted request ran without MTP and donated nothing. On 11-09 production had no cache holders for the two 35B builds, and OpenRouter's cached share of their prompt tokens fell from 27-42% on 10-30 to 0% from 10-31, the day 0.10.5 reached the fleet. Omitted knobs now take only the cards' temperature 1.0, top_p 0.95 and top_k 20, which still replace the greedy decoding that looped to max_tokens (#1530). A request's own presence_penalty still applies. The presence-penalty default plumbing #1652 added has no other user and goes. Docs: the sampling table and paragraph (inference.md), and prefix-cache.md invariant 9 and a failure-mode row for the MTP-eligibility coupling. Tests: the red test from the previous commit passes; the 9B card test now expects presence_penalty 0.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…ctor pass) The independent refactor pass for #1946 (session refactor-pass-1946, earnings/refactor-1946.md) found no must-fix issue and two wording fixes: - prefix-cache.md invariant 9 named "the Qwen inline heads under mtp_mode = auto" as if it were the definition. tracksPersistentHistory applies to any request-stateful drafter, under `on` as well as `auto`, so the Qwen 3.5/3.6 heads are now an example. - The qwen35CardDefaults doc comment states the invariant in the conditional ("would turn off ... omits"), as inference.md does, not as history. No behavior change. Combined tree: EngineV2SamplingDefaultsTests 16/16, Bonsai9BRequestPolicyTests 3, BenchmarkProductionInputTests 8, MTPAcceptanceConfigTests 6 (CPU-only); changelog, docs-impact and docs-check (211 files) OK. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…y send its own penalty (review) The independent review of #1946 found two overstated statements: - "the builds ship no generation_config.json": only Qwen3.5-9B ships none. The 35B builds' files declare the same temperature 1.0 / top_p 0.95 / top_k 20; none of the three is admitted to artifact defaults, so no file is read. - "coordinator requests never carry a penalty": the coordinator adds only the registry's temperature, top_p and top_k, and no penalty unless the registry sets one; a client can still send its own. Comments, docs and the changelog fragment only; no code change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 10, 2026
This was referenced Nov 10, 2026
Merged
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Since provider 0.10.5, the catalog
Qwen3.5-9B,qwen3.5-35b-a3bandqwen3.6-35b-a3b-vl-mtp-mxfp8builds get a defaultpresence_penaltyof 1.5 when a request omits it (#1652). That default turns off two things on these builds:The coordinator adds only the registry's
temperature,top_pandtop_k, so this hit every hosted request that didn't send its own penalty. OpenRouter's cached share of prompt tokens on the two 35B builds fell from 27–42 % on 10-30 to 0 % from 10-31, the day 0.10.5 reached the fleet. On 11-09 production had no cache holders for either build.This PR keeps the cards'
temperature1.0,top_p0.95 andtop_k20 as defaults and drops the default penalty. A request's ownpresence_penaltystill applies. Draft until the GPU checks in Notes pass.Linked issue
Regression from #1652 (fix for #1530). Found by the OpenRouter gap analysis (cache 0 % on Qwen3.6 and Qwen3.5-35B).
Root cause
Code at dev
0f11fbe01a; SDKmlx-swift-lm67110e7b, the pin on both dev and master.EngineV2SamplingDefaults.qwen35CardDefaultssetspresencePenalty: 1.5(EngineV2SamplingDefaults.swift:68-69).EngineV2Translation.samplingParamsapplies it to any request that omits the field (EngineV2Bridge+Translation.swift:127).aa9ea29f4, 10-29 19:51), the coordinator forwards these builds' registrytemperature1,top_p0.95 andtop_k20. Its allowlist of forwarded keys has nopresence_penalty(coordinator/api/inference/request/model_runtime_defaults.go:24-31). In production, fix(provider): stop Qwen 3.5/3.6 looping to max_tokens on omitted sampling #1652's only effective change was therefore the 1.5 penalty.EngineLoopV2.mtpBasicEligiblerequirespresencePenalty == 0(EngineLoopV2+MTPPlanning.swift:34). Undermtp_mode = "auto"the embedded heads are on forqwen3_5andqwen3_5_moe(MTPMode.automaticEmbeddedModelTypes,ProviderConfig.swift:86).tracksPersistentHistory), so the complete-checkpoint codec carries the assistant (EngineV2.swift:949).mtpTakeHistoryStatereturns no state for an ineligible row (EngineLoopV2+MTPExecution.swift:642).CompleteCheckpointCapture.capturethrowsincompatibleCheckpoint(CompleteCheckpointCapture.swift:238-242);EngineLoopV2+HybridPrefix.swift:93);EngineLoopV2+HistoricalCheckpoint.swift:306)./v1/cache/status.presence_penalty: 0themselves.Bisect 0.10.4 → 0.10.5
By code: 23 commits, plus the SDK pin move
aee6ebb6→2beb401f.isDenseQwen35(model is Qwen35Model && !(model is Qwen35MoEModel)), so the MoE builds are untouchedmtpBasicEligible,mtpTakeHistoryStateand the capture requirement are identical ataee6ebb6,2beb401fand67110e7bidentity.ContractID) are all listed in production'sEIGENINFERENCE_CACHE_ROUTING_ALLOWED_ARTIFACTS: Qwen3.64b92f730…, Qwen3.5-35B507d6d7a…, Qwen3.5-9Bd3816f9f…. The same method reproduces GLM's listede49c4d35…./v1/cache/statusshowsstale_models: 0Production evidence (read-only, 11-09).
OpenRouter's cached share, 14:00Z each day:
Gemma was unchanged (2.7 % on 10-30, 11.0 % on 10-31). No coordinator deploy fell between those two samples.
cache_routing_holders: none for either 35B build; 4 for Qwen3.5-9B, against Qwen3.8's 109. Qwen3.8 is a dense inline-MTP Qwen without the penalty.MTP accepted, 13:00–13:30Z: Qwen3.6 2 of 125 requests, Qwen3.5-9B 4 of 149, Qwen3.5-35B 0 of 49. Qwen3.8 on Macs: 105 of 443.
The artifacts' own
generation_config.jsonfor both 35B builds declares exactlytemperature1.0,top_p0.95 andtop_k20, with no presence penalty (models.darkbloom.ai/<r2_prefix>/generation_config.json).Test plan
5c7d5a73d3addsqwen35CardDefaultsLeaveDefaultRequestsSpeculativeAndCacheable. On dev0f11fbe01ait fails with 6 issues: the bare and the coordinator-shaped request getpresence_penalty1.5 on all three builds. The suite's other 15 tests pass.937161efe1passes the wholeEngineV2SamplingDefaultsTestssuite (16/16).Bonsai9BRequestPolicyTests(3),BenchmarkProductionInputTests(8),MTPAcceptanceConfigTests(6).swift build --build-tests(provider-swift, prod identity), thenswift test --skip-buildin a sandbox that denies the GPU user clients. These are CPU-only.ac2b5c89a2(comments, docs and the changelog only):changelog.py check(68 fragments),docs-impact-check --base devanddocs-check.sh(211 files) OK; both Swift files parse (swiftc -parse).937161efe1, atf73bbc5d39(after the refactor pass) and atac2b5c89a2(after the review's doc fix): build, Provider Unit Tests shards 1–2 and Provider Tests. That includesEngineV2BridgeTests, which needs a Metal device and so was not run on the build Mac (a production machine).python3 scripts/changelog.py checkOK;scripts/docs-impact-check.py --base devcoverage OK;./scripts/docs-check.sh211 files OK.Components touched
Protocol / interface changes
EngineV2SamplingDefaultsloses thepresencePenaltyfield fix(provider): stop Qwen 3.5/3.6 looping to max_tokens on omitted sampling #1652 added; it had no other user.Documentation impact
docs/architecture/inference.md: the sampling table and a separate paragraph for the Qwen catalog builds, moved out of the Bonsai 9B paragraph. After the review it says that only the 9B lacks ageneration_config.json, and that a client may send its own penalty;docs/architecture/prefix-cache.md: invariant 9 (the MTP-eligibility coupling) and a failure-mode row.Changelog
changelog.d/qwen35-default-penalty-keeps-mtp-and-cache.mdand ranpython3 scripts/changelog.py check.Notes for reviewers
OR-FIX.md§1.5, rewritten 21:40Z).temperature1 /top_p0.95 /top_k20 without a penalty only from chore(attestation): retire the hypervisor_active stub — field, entitlement, and false UI claims #492's deploy (10-29 19:51) until Macs moved to 0.10.5. That is the window in which Qwen3.6 cached 42 % on 10-30.presence_penalty: 0, the built-in acceptance) and exact. The typical arm decides, because it is what every 0.10.5–0.10.11 Mac runs after the registry write (darkbloom-platform [bug] Qwen won’t load on a 48 GB Mac despite enough RAM, false memory check after restart #743).presence_penalty: 0. The 2nd send of an ~9K-token prompt must log a complete-checkpoint capture, and the 3rd must reportcached_tokens≥ 8,192.temperature1 under the built-in typical acceptance (MTPAcceptancePolicy.resolve), which is lossy for sampled rows.OR-FIX.md. Until it does,[backend.mtp_acceptance_by_model]can pin them toexact.mtpTakeHistoryState). Then a penalty,stopstring, logprobs orlogit_biasrow on these builds would still donate. That needs a mlx-swift-lm PR (the owner's), and is not part of this PR.presence_penaltywhen the caller omits it. With a build'sruntime_parametersset to 0, every 0.10.5–0.10.11 Mac gets this PR's behaviour for that build without updating. Older providers, and this PR, already treat 0 as their default.OR-FIX.md§1.5).1.5, notnull:nullleaves 0.10.12+ Macs on this PR's 0.OR-FIX.md).Before And After
flowchart LR subgraph Before["Before (0.10.5 to 0.10.11)"] B1["coordinator body: temperature 1, top_p 0.95, top_k 20, no penalty"] --> B2["provider default presence_penalty 1.5"] B2 --> B3["mtpBasicEligible false: no MTP"] B3 --> B4["mtpTakeHistoryState nil: no assistant history"] B4 --> B5["capture refused: no checkpoint, no receipt, 0 holders, 0% cached"] end subgraph After A1["coordinator body: temperature 1, top_p 0.95, top_k 20, no penalty"] --> A2["provider adds no penalty"] A2 --> A3["row speculates and observes history"] A3 --> A4["checkpoint staged, donated and published: holders, cache hits"] A5["request's own presence_penalty"] --> A6["still applies: no MTP, no donation for that row"] endRefactor Pass
opencode runsession (refactor-pass-1946, Claude Opus 5.5), 19:54–19:57Z, in its own detached worktree at937161efe1. It made no builds, commits or GitHub writes. Report:earnings/refactor-1946.md.f73bbc5d39, signed:prefix-cache.mdinvariant 9 named "the Qwen inline heads undermtp_mode = "auto"" as if that defined it.tracksPersistentHistorycovers any request-stateful drafter, underontoo, so the Qwen 3.5/3.6 heads are now an example.qwen35CardDefaultsdoc comment states the invariant ("would turn off … omits"), not history.EngineV2SamplingDefaultsTests16/16,Bonsai9BRequestPolicyTests3,BenchmarkProductionInputTests8,MTPAcceptanceConfigTests6. Changelog, docs-impact and docs-check (211 files) OK.Independent Review
earnings/review-1946-743.md.samplingParamsis byte-identical tov0.10.4's.ac2b5c89a2(signed, pushed fast-forward):generation_config.json": only the 9B ships none. The 35B builds' files declare the same three values, and none of the three is admitted to artifact defaults, so no file is read.temperature,top_pandtop_k, and no penalty unless the registry sets one. A client can send its own.inference.md, theEngineV2SamplingDefaults.swiftheader, two test comments and the changelog fragment.EngineV2SamplingDefaultsTests:131(atac2b5c89a2),Bonsai9BRequestPolicyTests:43,50,EngineV2BridgeTests:597).