Repository navigation
fix(provider): Nemotron Super speculates for sampled and controlled requests - #1593
Merged
Merged
Conversation
… it cannot draft for inference.md and a changelog fragment for the SDK change: sampled Super requests speculate through exact target-prefix acceptance, and a stop-string, penalty or logit-bias request decodes one ordinary token per step beside requests that speculate instead of turning speculation off for the step.
…d and controlled requests libs/mlx-swift-lm 41e76b0e -> 82a4a531: 41e76b0e plus the Super MTP fix only (mlx-swift-lm branch fix/mtp-speed-on-41e76b0e; the same library change as Layr-Labs/mlx-swift-lm#357 on main). Sampled Super rows speculate through exact target-prefix acceptance, and a stop, penalty or logit-bias row decodes one ordinary token per step beside speculating rows instead of turning speculation off for the step. NemotronSuperLocalMTPTests, through NemotronSuperLocalBinding, the bridge and the speculating owner on synthetic weights: - sampledRequestSpeculatesAndDrawsThePlainOwnersTokens: a seeded T=0.7 request draws the plain owner's tokens and speculates (rectangular depth 3 and serial depth 1: 5 rounds each; 0 with 41e76b0e). - controlledRequestLeavesSpeculationOnForTheRequestBesideIt: a text request started while a stop, repetition-penalty or logit-bias request decodes speculates (3 rounds beside it; 0 with 41e76b0e) and both outputs equal their solo and plain-owner outputs. With 41e76b0e exactly these five expectations fail; the suite's other six tests pass with both pins. Real checkpoint (M3 Ultra, release build of this tree, c=1, T=1.0): sampled Super decode 45.2-58.2 tok/s with MTP (acceptance 0.64-0.85) against 37.7-40.8 before; greedy decode unchanged and greedy output byte-identical with MTP on and off.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…ests libs/mlx-swift-lm 82a4a531 -> 30498c29 on fix/mtp-speed-on-41e76b0e: the SDK's NemotronSuperMTPRequestControlsTests, its assistant policy test updated for target-prefix acceptance (it pinned the old policy and failed in SDK CI on main), and the docs section. No library change, so the provider build is unchanged.
The release adopted the synced SDK (mlx-swift-lm efd38585, mlx-swift 6c31f9f1, mlx 83dbdb04). libs/mlx-swift-lm resolves to 2e283e78 (mlx-swift-lm fix/mtp-speed): efd38585 plus the Super MTP fix and its assistant policy-test update, the same change as Layr-Labs/mlx-swift-lm#357 on main.
Refactor pass. speculativeOwnerServesExactTextAndTargetOnlyImagesThenRetires repeated the fixture, budget, lease, owner and teardown code that the new OwnerPair/ownerPair helper already holds. It now uses the helper; the owners are identical (2 GiB of KV, one request: the explicit DARKBLOOM_NEMOTRON_SUPER_MAX_CONCURRENT=1 equals the unset default) and every expectation is kept. Test-only.
jonathan308
merged commit Oct 24, 2026
f4f35f2
into
release/provider-0.10.2-features
15 checks passed
jonathan308
added a commit
that referenced
this pull request
Oct 24, 2026
…49a23) libs/mlx-swift-lm moves to f7449a23, the head of SDK branch release/sdk-0.10.2-final. That branch is SDK main a1fbe922 (#356 merged) plus signed --no-ff merges of the SDK PRs that 0.10.2 ships: - mlx-swift-lm#360 (44ad2b71): the FP8 eager-bound first-token stall fix; - mlx-swift-lm#357 (74400370): Super speculates for sampled and controlled requests; - mlx-swift-lm#359 (9c8810af): decode-only steps priced in the first-token projection; - mlx-swift-lm#362 (880eadd6): GLM long-context paged decode. SDK main fast-forwards to that branch once each PR's CI is green, so this pin lands on main with no re-pin. mlx-swift (eedca444) and mlx (ff4bb35b) are unchanged: the set moves no mlx-swift pin. The folded provider PRs pinned their own SDK commits (#1593 4d962e39, #1595 5d3bf208, #1598 5fba64c0); each of those changes is in this set.
6 of 10 tasks
jonathan308
added a commit
that referenced
this pull request
Oct 25, 2026
Set ProviderCore.version to 0.10.2 and render the v0.10.2 changelog entry from the 27 fragments added since v0.10.1, ordered by theme behind an upgrade and rollout section: Nemotron 3.5 Super prefix caching (#1586, #1588); GLM-5.3-Flash prefix caching (#1587, #1589, #1590); 4-bit SSD checkpoints and the SSD prefix cache on every model (#1592 (mlx-swift-lm#363), #1584, #1592); Logprobs on Nemotron 3.5 Super and GLM-5.3-Flash (#1564); OpenRouter compatibility: GLM-5.3-Flash and MiMo-V2.6-Flash requests no longer refused (#1585, #1592); Speed: MTP and throughput (#1592 (mlx-swift-lm#360), #1593 (mlx-swift-lm#357), #1595 (mlx-swift-lm#359), #1594, #1595, #1598 (mlx-swift-lm#362), #1594); Provider diagnostics: refusal reasons and load memory (#1592, #1603); MLX stack (#1596); Desktop release workflow (#1580). Apply 12 corrections reviewed against the code. #1580 is already in the v0.10.1 tag but merged after the 0.10.1 preparation, so its fragment is rendered here. Mark v0.10.1 as published on 2026-10-24. Record in the provider release runbook the SDK pin check, the enablement order (darkbloom-platform#464 before any catalog logprobs change, the GLM allowlist tuple, then both models' logprobs after the rollout and Super's tuple after a signed restart check), the platform evidence and the published history. No tag, registration, upload, deployment or enablement is performed.
jonathan308
added a commit
that referenced
this pull request
Oct 25, 2026
Set ProviderCore.version to 0.10.2 and render the v0.10.2 changelog entry from the 27 fragments added since v0.10.1, ordered by theme behind an upgrade and rollout section: Nemotron 3.5 Super prefix caching (#1586, #1588); GLM-5.3-Flash prefix caching (#1587, #1589, #1590); 4-bit SSD checkpoints and the SSD prefix cache on every model (#1592 (mlx-swift-lm#363), #1584, #1592); Logprobs on Nemotron 3.5 Super and GLM-5.3-Flash (#1564); OpenRouter compatibility: GLM-5.3-Flash and MiMo-V2.6-Flash requests no longer refused (#1585, #1592); Speed: MTP and throughput (#1592 (mlx-swift-lm#360), #1593 (mlx-swift-lm#357), #1595 (mlx-swift-lm#359), #1594, #1595, #1598 (mlx-swift-lm#362), #1594); Provider diagnostics: refusal reasons and load memory (#1592, #1603); MLX stack (#1596); Desktop release workflow (#1580). Apply 14 corrections reviewed against the code. #1580 is already in the v0.10.1 tag but merged after the 0.10.1 preparation, so its fragment is rendered here. Mark v0.10.1 as published on 2026-10-24. Record in the provider release runbook the SDK pin check, the enablement order (darkbloom-platform#464 before any catalog logprobs change, the GLM allowlist tuple, then both models' logprobs after the rollout and Super's tuple after a signed restart check), the platform evidence and the published history. No tag, registration, upload, deployment or enablement is performed.
Gajesh2007
pushed a commit
that referenced
this pull request
Oct 25, 2026
Set ProviderCore.version to 0.10.2 and render the v0.10.2 changelog entry from the 20 fragments added since v0.10.1, ordered by theme behind an upgrade and rollout section: Nemotron 3.5 Super prefix caching (#1586, #1588); GLM-5.3-Flash prefix caching (#1587, #1589, #1590); 4-bit SSD checkpoints and the SSD prefix cache on every model (#1592 (mlx-swift-lm#363), #1584, #1592); Logprobs on Nemotron 3.5 Super and GLM-5.3-Flash (#1564); GLM-5.3-Flash OpenRouter request controls (#1585, #1592); Speed: MTP and throughput (#1592 (mlx-swift-lm#360), #1593 (mlx- swift-lm#357), #1595 (mlx-swift-lm#359), #1594, #1595, #1598 (mlx-swift- lm#362), #1594); Provider diagnostics (#1592); MLX stack (#1596); Desktop release workflow (#1580). Apply 12 corrections reviewed against the code. #1580 is already in the v0.10.1 tag but merged after the 0.10.1 preparation, so its fragment is rendered here. Mark v0.10.1 as published on 2026-10-24. Record in the provider release runbook the SDK pin check, the enablement order (darkbloom-platform#464 before any catalog logprobs change, the GLM allowlist tuple, then both models' logprobs after the rollout and Super's tuple after a signed restart check), the platform evidence and the published history. No tag, registration, upload, deployment or enablement is performed. Co-authored-by: Jonathan Spangler <5055076+jonathan308@users.noreply.github.com>
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
Nemotron 3.5 Super reports MTP as enabled and active, but sampled requests (temperature > 0) never speculated, and
one sampled,
stop, penalty orlogit_biasrequest switched speculation off for every request in the same decodestep. This PR pins the SDK fix and adds provider tests for it through the local binding and bridge. It ships in
0.10.2 together with the M5 Ultra Super depth table
[3,2,1,1,0](9d8277460): net for sampled Super requests onthe M5 Ultra c=1 +20 %, after a 2K prompt +56 %, c=2 −4 %, c=4 −1 %, c=8 0 %; greedy unchanged by this PR.
Before
flowchart LR S["Super request<br/>temperature 1.0"]:::req --> E{"MTP row gate"}:::gate E -- "sampled: refused" --> T["target-only<br/>1 token per step"]:::slow G["greedy request<br/>in the same step"]:::req --> C{"every row in the<br/>cohort eligible?"}:::gate C -- "no: one sampled / stop /<br/>penalty / bias row" --> W["whole step target-only<br/>for every request"]:::slow classDef req fill:#dbeafe,stroke:#1d4ed8,color:#0b1b3f classDef gate fill:#fef3c7,stroke:#b45309,color:#3b2603 classDef slow fill:#fee2e2,stroke:#b91c1c,color:#450a0aAfter
flowchart LR S["Super request<br/>temperature 1.0"]:::req --> E{"MTP row gate<br/>(exact target-prefix acceptance)"}:::gate E -- "accepted" --> V["draft + exact verify<br/>several tokens per step"]:::fast X["stop / penalty /<br/>logit_bias request"]:::req --> R["leaves the draft cohort<br/>1 ordinary token per step"]:::neutral G["other requests<br/>in the step"]:::req --> V classDef req fill:#dbeafe,stroke:#1d4ed8,color:#0b1b3f classDef gate fill:#fef3c7,stroke:#b45309,color:#3b2603 classDef fast fill:#dcfce7,stroke:#15803d,color:#052e16 classDef neutral fill:#f3f4f6,stroke:#4b5563,color:#111827Code flow
flowchart TB B["EngineV2Bridge.submitTokenized<br/>CBv2Request: sampling, stopStrings"]:::prov --> P["EngineLoopV2 MTP planning"]:::sdk P --> D["mtpDraftBatchRows<br/>NEW: on Super's row-exact recurrent target,<br/>drop every ineligible row"]:::changed D --> K{"mtpRowsCanSpeculate<br/>(cohort)"}:::sdk K -- "yes" --> R["draft + verify round"]:::sdk E["mtpBasicEligible<br/>NEW: Super drafter reports<br/>supportsTargetPrefixAcceptance"]:::changed --> D classDef prov fill:#ede9fe,stroke:#6d28d9,color:#1e1037 classDef sdk fill:#e0f2fe,stroke:#0369a1,color:#082f49 classDef changed fill:#dcfce7,stroke:#15803d,color:#052e16Legend: blue = request, amber = gate, red = no speculation, green = speculation / changed code, grey = unchanged
ordinary decode.
What changes in this repository:
libs/mlx-swift-lm d4fd516e -> 4d962e39 # #1592's SDK pin (#356 head) + the Super MTP fix # + its assistant policy-test update (mlx-swift-lm fix/mtp-speed) provider-swift/Tests/ProviderCoreTests/Inference/Engine/NemotronSuperLocalMTPTests.swift + sampledRequestSpeculatesAndDrawsThePlainOwnersTokens # rectangular depth 3, serial depth 1 + controlledRequestLeavesSpeculationOnForTheRequestBesideIt # stop, repetition penalty, logit_bias docs/architecture/inference.md # Super sampled / controlled rows +changelog.d/nemotron-super-sampled-mtp.mdThe SDK change itself is Layr-Labs/mlx-swift-lm#357 (on
main).4d962e39is #356's last headd4fd516eplusthe same change, with
mtpDraftBatchRowskeeping #356's logprob clause beside the new ineligible-row clause. #356merged into
mainat 19:27 UTC (a1fbe922, same tree asd4fd516e); #357's head74400370is thatmainplus thefix and has the same tree as this pin. The SDK's own
NemotronSuperMTPAssistantTests.policyAndExactTargetBindingpinned the old policy; it is updated there too (itfailed in #357's CI before that). This branch merges #1592's head
d85f7e71a; the diff against it is the fourfiles above.
Interaction with tapered MTP (depth tables)
The fixed depth-by-rows table (
DARKBLOOM_NEMOTRON_SUPER_MTP_DEPTH, default3,2,2,2,1, the engine'sfixedDraftTokensByDecodeRows) is indexed by every decode-ready row in the step(
EngineLoopV2.beginMTPPlan→beginPlan(plannedDecodeRows: rows.count)), not by the draft cohort. This changeleaves that count alone. It only lets sampled rows into the cohort instead of vetoing the step, and moves stop /
penalty /
logit_biasrows out of the cohort while they still count toward the table index (the forward stillcarries their row). So any tapered table applies to sampled traffic exactly as to greedy traffic, and a step with
one controlled row takes the depth for its full row count. A Super speculative-batch limit, if one is added, would
count the cohort (
withinBatchGate). Depth never affects exactness: every emitted token is target-verified.Evidence
Provider tests (
swift build --build-tests, thenswift test --skip-build --no-parallel --filter NemotronSuperLocalMTPTests, M3 Ultra, isolated state):metrics.rounds > 0(0 rounds), tokens still equalroundsBeside > 0(0 rounds), outputs still equalMeasured twice with the same outcome: at this branch's merged state (before: #1592's head with SDK
efd38585;after: SDK
2e283e78; 18:12–18:14 UTC,runs/provider-merged-{before,after}) and on the pre-sync line (before:provider
fb052c1e5+ SDK41e76b0e; after: SDK82a4a531). In both, exactly the five new expectations failbefore and all 8 tests pass after.
At the final merged state (#1592 head
d85f7e71a+ SDK4d962e39, mlx-swifteedca444, mlxff4bb35bwith itsmetallib):
swift test --skip-build --no-parallel --filter NemotronSuper— 229 tests in 32 suites pass(18:46–18:50 UTC,
runs/provider-final-super), including the two new tests (sampled 5 rounds in both modes,3 rounds beside each controlled request).
4d962e39and2e283e78have the same SDK sources.SDK suites at
2e283e78(M3, filterNemotronSuper|NemotronH35|MTPMediaFallback|Logprob): 241 Swift Testing testsin 67 suites pass; XCTest 0 failures (only the real-artifact tests skip).
Real checkpoint, M3 Ultra 256 GB, concurrency 1, release build of the pre-sync line with the same library change
(provider
fb052c1e5+ SDK82a4a531,darkbloomsha25638eb1902…), prefix cache off, decode tok/s, mean of 2passes, 65/65 requests HTTP 200:
Greedy output is byte-identical with MTP on and off (SHA-256 of the text, 3 prompts). Coordinator relay: 12/12
relayed requests billed exactly the reported completion tokens.
M5 Ultra (Darkbloom M5 Ultra #1, plan A, prefix cache off, 384-token outputs, prompts clear of the
80–92-token prefill stall band; before = provider
fb052c1e5+ SDK41e76b0e, after = the same + this change),per-request decode tok/s (aggregate), MTP acceptance:
Greedy is unchanged. Sampled requests now follow the greedy curve: large gains alone, and from 2 concurrent requests
the M5 Ultra's existing MTP cost at width (greedy already pays −8 % at c=4 and −13 % at c=8 with the M3-tuned depth
table
3,2,2,2,1). On the M3 Ultra MTP gains at every width, so sampled traffic gains there throughout. The M5taper below removes most of that.
With the M5 Ultra taper. The M5-only Super depth table
[3,2,1,1,0](9d8277460onperf/glm-super-decode-prefill, shipping in the same release; M3 keeps[3,2,2,2,1]) composes with this change: thetable indexes all decode-ready rows, so sampled rows get exactly the greedy depths. On #1 with this change
(per-request tok/s, aggregate; depth 1 at 4 rows via
DARKBLOOM_NEMOTRON_SUPER_MTP_DEPTH=3,2,1,1,1, depth 0 at 8 rowsmeasured as MTP off):
Net for sampled traffic against the build before both changes: c=1 +20 %, 2K prompt +56 %, c=2 −4 %, c=4 −1 %,
c=8 0 %.
Checks:
make docs-check(196 files OK),make docs-impact-check BASE=origin/release/provider-0.10.2-features(OK),make changelog-check(OK).Merge Danger
Door: two-way. Revert the gitlink to restore the old behavior; no persisted state, protocol or wire change.
Blast radius: Super speculative serving. Sampled Super requests now speculate (lower acceptance than greedy):
+20–55 % alone on the M3 and M5 Ultra; on the M5 Ultra from 2 concurrent requests they pay the MTP-at-width cost
greedy traffic already pays (−4 / −10 / −14 % aggregate at c=2/4/8), removable with a tapered depth table
(
DARKBLOOM_NEMOTRON_SUPER_MTP_DEPTH=3,2,1,1,1restores c=4) or a speculative-batch limit. Controlled requests nolonger slow their neighbours. GLM and MiMo are unchanged.
Limitations
4d962e39(mlx-swift-lmfix/mtp-speed) has the same tree as Quick fix: collapse Gemma rollout models in clients #357's head74400370. Once Quick fix: collapse Gemma rollout models in clients #357 isin
main, Provider 0.10.2 features: Super/GLM prefix caching, logprobs, GLM OpenRouter reasoning fields #1592 can pinmain's head instead; the provider build does not change.41e76b0e+ the same librarychange); the merged state is validated by the provider and SDK tests.
id. Sampled exactness rests on the synthetic-weight tests here and in the SDK, which use a fixed id.
test covers accepted sampled drafts (5–7 accepted).
c7fa08908on this branch (test-only: the existing paired-owner test nowuses the new
ownerPairhelper);NemotronSuperLocalMTPTests8/8 pass at that head (M3, 19:43 UTC). Any furtherrefactor review is the coordinating agent's gate.