Skip to content

fix(provider): Nemotron Super speculates for sampled and controlled requests - #1593

Merged
jonathan308 merged 6 commits into
release/provider-0.10.2-featuresfrom
fix/mtp-speed
Oct 24, 2026
Merged

jonathan308 merged 6 commits into
release/provider-0.10.2-featuresfrom
fix/mtp-speed

Conversation

@jonathan308

@jonathan308 jonathan308 commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Nemotron 3.5 Super reports MTP as enabled and active, but sampled requests (temperature > 0) never speculated, and
one sampled, stop, penalty or logit_bias request switched speculation off for every request in the same decode
step. 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 on
the 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:#450a0a
Loading

After

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:#111827
Loading

Code 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:#052e16
Loading

Legend: 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.md

The SDK change itself is Layr-Labs/mlx-swift-lm#357 (on main). 4d962e39 is #356's last head d4fd516e plus
the same change, with mtpDraftBatchRows keeping #356's logprob clause beside the new ineligible-row clause. #356
merged into main at 19:27 UTC (a1fbe922, same tree as d4fd516e); #357's head 74400370 is that main plus the
fix and has the same tree as this pin. The SDK's own
NemotronSuperMTPAssistantTests.policyAndExactTargetBinding pinned the old policy; it is updated there too (it
failed in #357's CI before that). This branch merges #1592's head d85f7e71a; the diff against it is the four
files above.

Interaction with tapered MTP (depth tables)

The fixed depth-by-rows table (DARKBLOOM_NEMOTRON_SUPER_MTP_DEPTH, default 3,2,2,2,1, the engine's
fixedDraftTokensByDecodeRows) is indexed by every decode-ready row in the step
(EngineLoopV2.beginMTPPlan → beginPlan(plannedDecodeRows: rows.count)), not by the draft cohort. This change
leaves that count alone. It only lets sampled rows into the cohort instead of vetoing the step, and moves stop /
penalty / logit_bias rows out of the cohort while they still count toward the table index (the forward still
carries 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, then
swift test --skip-build --no-parallel --filter NemotronSuperLocalMTPTests, M3 Ultra, isolated state):

Test before after
sampled request (T=0.7, seed 29) speculates, tokens equal the plain owner's fails: metrics.rounds > 0 (0 rounds), tokens still equal passes: 5 rounds in both modes
text request beside a stop / repetition-penalty / logit-bias request speculates, both outputs equal their solo outputs fails: roundsBeside > 0 (0 rounds), outputs still equal passes: 3 rounds beside each
the 6 existing tests in the suite pass pass

Measured 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 + SDK 41e76b0e; after: SDK 82a4a531). In both, exactly the five new expectations fail
before and all 8 tests pass after.

At the final merged state (#1592 head d85f7e71a + SDK 4d962e39, mlx-swift eedca444, mlx ff4bb35b with its
metallib): 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). 4d962e39 and 2e283e78 have the same SDK sources.

SDK suites at 2e283e78 (M3, filter NemotronSuper|NemotronH35|MTPMediaFallback|Logprob): 241 Swift Testing tests
in 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 + SDK 82a4a531, darkbloom sha256 38eb1902…), prefix cache off, decode tok/s, mean of 2
passes, 65/65 requests HTTP 200:

Shape (prompt → output) Greedy, MTP on (before / after) Sampled T=1.0, before Sampled T=1.0, after After: acceptance
short (32 → 512) 54.5 / 55.0 40.3 (0 rounds) 52.8 (+31 %) 0.71
code (1.9K → 512) 46.4 / 45.2 37.7 45.2 (+20 %) 0.64
tools (565 → ~360) 59.5 / 60.5 40.6 52.4 (+29 %) 0.73
reasoning (90 → ~850) 61.6 / 59.8 40.8 58.2 (+43 %) 0.85
document (11K → 384) 55.6 / 55.8 37.9 51.6 (+36 %) 0.84

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 + SDK 41e76b0e, after = the same + this change),
per-request decode tok/s (aggregate), MTP acceptance:

Cell greedy before greedy after sampled T=1.0 before sampled T=1.0 after
c=1 short 69.8–78.6 72.4–77.9 59.9 (0 rounds) 69.8–78.5 (+20 % median), acc 0.55–0.66
c=1 2K prompt 82.5–92.1 88.6–96.5 59.4 (0 rounds) 89.9–94.8 (+55 %), acc 0.82–0.89
c=2 48.9–51.3 (agg 99–104) 50.5–50.6 (agg 102) 48.3–48.4 (agg 98–99) 45.6–47.5 (agg 92–96, −4 %)
c=4 27.6–28.5 (agg 113–115) 28.4–28.6 (agg 114–115) 29.9 (agg 123–124) 27.2–27.5 (agg 110–111, −10 %)
c=8 15.2–15.5 (agg 123–127) 15.0–15.6 (agg 122–127) 17.1–17.2 (agg 143) 14.9–15.1 (agg 122, −14 %)

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 M5
taper below removes most of that.

With the M5 Ultra taper. The M5-only Super depth table [3,2,1,1,0] (9d8277460 on
perf/glm-super-decode-prefill, shipping in the same release; M3 keeps [3,2,2,2,1]) composes with this change: the
table 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 rows
measured as MTP off):

Rows sampled, default table → taper greedy, default table → taper
1, 2 72.1, 46.5 (94) — same depths 75.6, 50.6 (102) — same depths
4 27.4 (110) → 29.5 (121), +8 % 28.5 (115) → 30.1 (123), +6 %
8 15.0 (122) → 17.2 (144), +15 % 15.3 (124) → 17.4 (145), +14 %

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,1 restores c=4) or a speculative-batch limit. Controlled requests no
longer slow their neighbours. GLM and MiMo are unchanged.

Limitations

  • The gitlink 4d962e39 (mlx-swift-lm fix/mtp-speed) has the same tree as Quick fix: collapse Gemma rollout models in clients #357's head 74400370. Once Quick fix: collapse Gemma rollout models in clients #357 is
    in main, Provider 0.10.2 features: Super/GLM prefix caching, logprobs, GLM OpenRouter reasoning fields #1592 can pin main's head instead; the provider build does not change.
  • The real-checkpoint and M5 Ultra numbers come from builds of the pre-sync line (41e76b0e + the same library
    change); the merged state is validated by the provider and SDK tests.
  • Sampled output on real weights cannot be token-compared over HTTP: the RNG stream is keyed on the engine request
    id. Sampled exactness rests on the synthetic-weight tests here and in the SDK, which use a fixed id.
  • In the provider fixture the sampled request accepts no draft (5 rounds, 0 accepted, EOS after 7 tokens); the SDK
    test covers accepted sampled drafts (5–7 accepted).
  • Refactor pass: the coordinating agent's c7fa08908 on this branch (test-only: the existing paired-owner test now
    uses the new ownerPair helper); NemotronSuperLocalMTPTests 8/8 pass at that head (M3, 19:43 UTC). Any further
    refactor review is the coordinating agent's gate.

… 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.
@vercel

vercel Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
d-inference Ready Ready Preview Oct 24, 2026 7:42pm UTC
d-inference-console-ui-dev Ready Ready Preview Oct 24, 2026 7:42pm UTC
d-inference-landing Ready Ready Preview Oct 24, 2026 7:42pm UTC
darkbloom-status Ready Ready Preview Oct 24, 2026 7:42pm UTC
eigen-homepages-darkbloom Ready Ready Preview Oct 24, 2026 7:42pm UTC

Request Review

…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.
The release now pins mlx-swift-lm d4fd516e (#356 with main's #358: mlx-swift eedca444, mlx ff4bb35b). libs/mlx-swift-lm resolves to 4d962e39 (mlx-swift-lm fix/mtp-speed): d4fd516e plus the Super MTP fix and its policy-test update.
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
jonathan308 merged commit f4f35f2 into release/provider-0.10.2-features Oct 24, 2026
15 checks passed
jonathan308 added a commit that referenced this pull request Oct 24, 2026
Nemotron Super speculates for sampled and controlled requests (with SDK
#357). Folded into #1592 per the parent; the libs/mlx-swift-lm pin
follows SDK main FINAL.
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.
@jonathan308 jonathan308 mentioned this pull request Oct 24, 2026
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

5 active deployments
Preview – d-inference — c7fa0890 Deployed Oct 24, 2026 by vercel[bot]
Preview – d-inference-console-ui-dev — c7fa0890 Deployed Oct 24, 2026 by vercel[bot]
Preview – d-inference-landing — c7fa0890 Deployed Oct 24, 2026 by vercel[bot]
Preview – eigen-homepages-darkbloom — c7fa0890 Deployed Oct 24, 2026 by vercel[bot]
Preview – darkbloom-status — c7fa0890 Deployed Oct 24, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant