Repository navigation
Keep Nemotron Super prefix reuse as durable SSD checkpoints (stacked on #1586) - #1588
jonathan308 wants to merge 4 commits into
Conversation
…points The managed Super slot's exact text prefix reuse is now complete encrypted SSD checkpoints by default, as for the other cache-enabled models: the builder prepares the paged backend, builds an SSDHybridCheckpointStore bound to the published aggregate and the checkpoint's prompt contract, and assembles the engine with it (native KV precision whatever the operator's checkpoint quantization). The slot advertises prefix_cache_v2_models, checkpoints survive restarts within the store TTL, and the coordinator's repeat hint now reaches the Super route, so writes follow the same demand gate and daily budget. The SDK bump adds the Super KV type declarations and the assistant's durable history codec. The resident bank is no longer reserved by default (its grant returns to KV); DARKBLOOM_PREFIX_CACHE_MEMORY=1 selects it, and it remains the only tier that reuses image turns. A load whose artifact hash changes during the load is refused when it has a durable store.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Real-hardware evidence (M3 Ultra, pinned checkpoint
|
| Turn | Cached | TTFT | Charge (µUSD) |
|---|---|---|---|
| fleet-novel (coordinator repeat hint 0): looked up, not written | 0 | 16.24 s | 499 |
| repeat: written, two files: 192,806,241 B (2,048-token checkpoint) and 249,461,161 B (8,192) | 0 | 15.87 s | 499 |
| warm: restored from SSD | 8,192 | 1.04 s | 100 (per-request minimum; 499 uncached) |
The coordinator accepted the durable capability (prefix_cache_v2_models), and the receipts carried cache_receipt_boundary_mode=checkpoint. All three turns produced identical text.
Restart survival (e2e/run3, PASS)
A dev release binary has no keychain access group, so its persistent KEK load fails. Under DARKBLOOM_PREFIX_CACHE_ALLOW_EPHEMERAL the store then silently uses a fresh key at every launch. The new key fingerprint resets the epoch and retires every file, so a first run with the release binary missed after its restart. This is not specific to Super. The SDK's own answer for builds without the access group is the DEBUG-only DARKBLOOM_DEBUG_CACHE_KEY_FILE, so this proof used a dev-identity debug build of this branch (b35cbc51…, same metallib) with an owner-only 32-byte key file. Being a debug build, it doesn't report the release privacy posture, so the harness stood in for that posture exactly as the e2e testbed's force-trust does. It also had a 60 s first-content deadline because the debug build is slower.
| Turn | Cached | TTFT (debug build) |
|---|---|---|
| novel / repeat (written) | 0 / 0 | 20.25 s / 17.12 s |
| warm | 8,192 | 2.15 s |
| SIGHUP restart in place (provider back in 158 s) | ||
| after restart | 8,192 | 3.14 s, 100 µUSD, identical text |
| other account | 0 | 20.42 s |
The epoch ced7acd3… and key fingerprint d6f0b320… were unchanged across the restart, and the same two files (same names and sizes) were on disk before and after. Coordinator counters: 5 SSD lookups and 2 hits; donated 2 (the repeat's two checkpoints) and skipped_novel 4; holders were removed only by the restart's disconnect (2). The platform rollout procedure (Layr-Labs/darkbloom-platform#463) requires this restart check on the signed build with the Keychain key.
Burst: write queue (e2e/run4, release binary)
Four distinct ~8.3k-token documents, one account each, were sent concurrently three times: novel, repeat, warm. The first-content deadline base was 150 s, since four cold prefills on one M3 run back to back.
- Novel and repeat rounds. The slot prefills one request at a time, so TTFTs stagger at about 16, 33, 50 and 67 s.
- After the repeats. Six files totalling 1,326,802,197 B, three documents × (2,048 + 8,192), landed within 3 s of the last repeat. The store refused the fourth document's two checkpoints (its repeat finished last) with
write_queue_full. The refusal is counted, not silent. Coordinator donation outcomes:donated7,skipped_novel8 (the novel round),write_queue_full2. - Warm round. 3 of 4 hit (8,192 cached, identical text, 100 µUSD). The refused document ran cold and may donate again on that turn. The warm hits' TTFT (about 17 s) was queuing behind the concurrent cold prefill; the restore itself costs about 1 s, as in the durable run above.
Half-precision snapshot storage: measured, not adopted
The attention KV (BF16, 8 KiB/token) and the conv state (BF16) are already stored at their native half precision. The Mamba SSM state is fp32: 167,772,160 B of the 170,229,760 B recurrent part of every checkpoint (98.6 %). A local, uncommitted experiment stored it as bf16 or fp16 by rounding at capture in the resident bank. It ran on the real checkpoint with the plain owner: 3 prompts of about 8,286 tokens, restored at 8,192, 96 greedy tokens with top-20 logprobs. The cold reference was each donor's own run.
| SSM storage | restored text = cold | max / mean |Δ logprob| of the chosen token | state error (normwise RMS, worst layer, max abs of max |x|≈1,800) |
|---|---|---|---|
| fp32 (shipped) | 3/3 | 0 / 0 (bit-identical) | 0 |
| bf16 | 2/3: diverges at token 61 | 0.167 / ≤ 0.014 | 1.6–1.8e-3, 2.2e-3, 3.8 |
| fp16 | 2/3: diverges at token 61 | 0.161 / ≤ 0.013 | 1.9–2.3e-4, 2.8e-4, 0.50 |
Why prompt 2 diverges. At token 61 the cold distribution had an exact tie: ' Every' and ' Items' both at −1.578899. Super's bf16 logits put logprobs on a 0.25 grid, so ties are common; that run had two within 96 tokens. Exact fp32 storage reproduces the tie-break, and any half-precision rounding of the state can flip it. The SSM state therefore stays fp32. Halving it would have cut a checkpoint from 192.8 to 108.9 MB at 2,048 tokens and from 249.5 to 165.6 MB at 8,192. The only lossless saving left is storing the MTP history codes in 1 byte instead of 2 (0.5 KiB per token, about 1.7 % at 8,192). That needs the shared manifest change in the GLM half-precision work.
…lx-swift-lm#354 44bdae77 -> 91bdc989: the Super adapter resolves its recurrent spec and its complete-checkpoint KV types through one probe cache instead of two copies. No behavior or checkpoint-format change.
…and docs - NemotronSuperDurablePrefixCacheTests.ready polls through the evidence suite's `eventually` (the same 5 s bound) instead of a copy of it. - The managed-slot durable test names the receipt boundary mode `boundaryMode` instead of shadowing its `mode: MTPMode` argument. - The gated bank live test documents DARKBLOOM_PREFIX_CACHE_MEMORY=1 and checks it before loading: under the SSD default the slot keeps no bank, so without the switch the test could only fail after an 80 GB load. - Rewraps the two docs paragraphs that the Phase A and B edits left with a stub line and over-long lines. No runtime change.
|
Superseded by #1592; consolidated per owner request |
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.
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.
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>
Stacked on #1586 (base
feat/nemotron-super-prefix-cache). Needs Layr-Labs/mlx-swift-lm#354; the submodule is bumped to its head,91bdc989(its refactor pass).Summary
The managed Nemotron 3.5 Super slot now keeps exact text prefix reuse as complete encrypted SSD checkpoints by default, like the other cache-enabled models. Before this, its only reuse was the 16 GiB resident bank. With #1586 that bank gets only 30-second coordinator holders and is lost on every restart. With this PR, checkpoints survive restarts within the store TTL. The slot advertises
prefix_cache_v2_models, which gets durable coordinator holders (up to 25 min), and the bank's grant goes back to KV.Before (with #1586):
flowchart LR R[coordinator request + scope] --> E[engine] E --> B[(resident bank, 16 GiB of KV grant)] B -. process exit .-> X[lost] E --> M[prefix_cache_memory_models: holder TTL min 30 s]After:
flowchart LR R[coordinator request + scope + repeat hint] --> E[engine] E --> C[complete codec: KV + conv/SSM + MTP history] C --> S[(SSDHybridCheckpointStore: encrypted, owner-only, daily write budget)] S -. restart .-> S E --> D[prefix_cache_v2_models: durable holders up to 25 min]Durable identity. A durable checkpoint outlives the process, so its identity rests on this load. The load staged every shard against its pinned SHA-256 (the managed GLM load does the same instead of a bracketing hash). The prompt contract hashes the prompt files this load read. The aggregate is the one the provider published, and post-load drift refuses the load.
Evidence
NemotronSuperDurablePrefixCacheTests(synthetic Super, plain and MTP owners): the owner has a store and no bank or bank reservation, and advertises a durable capability with the routing identity. The donor writes the checkpoint at 512 (filesWritten > 0, ready receipt tierssd). The next turn restores 512 tokens from the store, with text identical to another tenant's cold run and identical MTP rounds / drafted / accepted tokens. After an owner restart (new installation, engine and store on the same root and key) it restores 512 again, with identical text and drafting.NemotronSuperManagedSlotTests.coordinatorRequestsWriteAndRestoreDurableCheckpoints(encrypted coordinator path, plain and MTP):ssd@ 512.inference_completehit/ssd/512, SSEcached_tokens: 512), with identical text.swift test --filter 'InferenceHandler|PrefixCache|NemotronSuper|UsageSignal|Receipt|LocalInferenceHTTP|ResidentPrefix|SSDHybrid|CompleteCheckpoint': 515 Swift Testing tests in 85 suites pass. The only XCTest failures are in MiMo tests gated on fixtures that this environment does not prepare (fixtureRequired).Limitations
DARKBLOOM_PREFIX_CACHE_MEMORY=1, reuses them. Coordinator media requests never had a cache scope.completeCheckpointIdentitytest seam, which no production caller sets.DARKBLOOM_PREFIX_CACHE_ALLOW_EPHEMERALthe store then uses a new key at every launch and retires its files on restart, for every model. Production signed builds use the Keychain key. The platform rollout procedure (Layr-Labs/darkbloom-platform#463) requires the restart check on the signed build.usageSignal,donationDemand); the conflicts are mechanical.prepareCompletePrefixCache). Both PRs editdocs/architecture/inference.mdandprefix-cache.mdand bumplibs/mlx-swift-lm, so whichever merges second needs a submodule commit that contains both SDK changes.Refactor pass
Done: two signed commits, no runtime change in this repository (head
bb1046872→8533941c5). A dedicated refactor pass reviewed this PR's diff against #1586 (9e627ae8f) and found nothing in #1586 to change.cd83fe7dfmoves the SDK pin44bdae77→91bdc989, the refactor pass of Complete (durable) prefix checkpoints for the Nemotron Super owners mlx-swift-lm#354. The Super adapter now resolves its recurrent spec and its complete-checkpoint KV types through one probe cache instead of two copies. No behavior or format change.8533941c5covers tests and docs:NemotronSuperDurablePrefixCacheTests.readypolls through the evidence suite'seventually(the same 5 s bound) instead of a copy of it.coordinatorRequestsWriteAndRestoreDurableCheckpointsnames the receipt boundary modeboundaryModeinstead of shadowing itsmode: MTPModeargument.pinnedCheckpointReusesPrefixesExactlywas stale. Under this PR's SSD default the slot keeps no bank, so the test could only fail, and only after an 80 GB load. Its doc now namesDARKBLOOM_PREFIX_CACHE_MEMORY=1, and it checks that switch before loading.inference.mdandprefix-cache.mdlines that the Phase A and B edits left as a stub line and 120-character lines are rewrapped.EngineV2SlotFactory'sprepareProductionBackend→prepareCompletePrefixCache→makeBridge.prepareDurableStoreis single-use, but it names the operation and keepsmakefrom growing.donationDemandthreading: see Route Nemotron Super prefix reuse through the coordinator (resident capability, receipts, cached-token usage) #1586's note on per-request parameters.makeBridgeruns, the prepared store is never closed and stays registered with the disk budget until exit.EngineV2SlotFactoryhas the same gap for throws betweenprepareCompletePrefixCacheandmakeBridge.Validation
Focused suites. Debug test build of
8533941c5(SDK91bdc989, metallib156f2624…), with isolated state: daemon state, loaded models, verified weights, and the usage journal viaCFFIXED_USER_HOME. The real~/.darkbloom/usage-history.jsonwas unchanged after every run. MiMo fixtures were prepared as indocs/developer/test.md.InferenceHandler|PrefixCache|NemotronSuper|UsageSignal|Receipt|LocalInferenceHTTP|ResidentPrefix|SSDHybrid|CompleteCheckpoint: 515 tests in 85 suites pass. XCTest: 54 executed, 5 skipped (native-lane MiMo and the real-tokenizer golden), 0 failures.Docs and changelog.
make docs-check,make docs-impact-check BASE=origin/masterandBASE=origin/feat/nemotron-super-prefix-cache,make changelog-checkandmake changelog-previewpass. CI on8533941c5is all green.Real checkpoint, M3 Ultra, under the GPU lane locks, because the SDK pin changes runtime code. Pinned
2026-10-20-nvfp4-r2, production loader, encrypted coordinator path, 8,693-token prompt:pinnedCheckpointReusesPrefixesExactly,DARKBLOOM_PREFIX_CACHE_MEMORY=1)ssdThe plain runs shared the GPU with a local cluster worker that started during them, which explains their higher TTFTs. These runs check exactness, not speed.
SSD details. Each SSD run wrote the 2,048- and 8,192-token checkpoints in an isolated root under an ephemeral key: 192.8 and 249.5 MB with MTP, 187.0 and 237.4 MB plain. The check ran in the test process: it binds the staged metallib the way the CLI does (as
DiffusionGemmaPrefixLiveTestsdoes), and the store then computes its own runtime identity. So the in-process limitation above holds only for processes that bind no metallib, and a committed, gated durable live test is possible (follow-up). Like the coordinator, the check must echocache_receipt_boundary_mode; without it, the SSD store sends no ready receipt.Merge readiness (morning)
git merge-treeonmaster9034a5a0f, with every head as of this pass:libs/mlx-swift-lmgitlink only (91bdc989vs mlx-swift-lm#353's184b5a93);inference.mdandprefix-cache.mdauto-merge. Resolve by pinning amaincommit that contains both #353 and #354.docs/reference/ssd-kv-cache.md(#1587) citesCheckpointHalfPrecision.swift, somake docs-checkpasses only with #353 in the checked-out SDK.54a1004a) and the same four Super files as #1586 + #1564. Keeplogprobs,usageSignal,donationDemand, in that order. Both PRs edit the binding test's two fixture closures identically, so git does not flag them, but they need nine arguments.A local, signed integration that was not pushed validates this resolution.
integration/morning-merge(38c89a015) merges master + #1585 + #1564 + #1586 + #1588 + #1587, with the SDK pinned to a localmain+ #342 + #353 + #354 (5fe0f152). It builds, andInferenceHandler|PrefixCache|NemotronSuper|UsageSignal|Receipt|LocalInferenceHTTP|ResidentPrefix|SSDHybrid|CompleteCheckpoint|Logprobs|GLM5Next|Reasoning|ProviderLoopStreamChunk|LocalChatUpload|Flintpasses: 888 tests in 150 suites, and XCTest 60 executed, 5 skipped, 0 failures. docs-check, docs-impact and the changelog checks pass.Order that keeps each SDK change attributed to its own provider PR:
S1, chore(release): v0.6.9 — Gemma 4 batched-attention NaN fix #354 →S2, Detect boot policy in doctor #353 →S3. There are no conflicts in any order.54a1004a→S1in a signed commit, then squash.masterwith a signed, non-force merge: four conflicts plus the eight-argument fixture closures. Run the focused suites, then squash.S2.python3 scripts/restack-after-squash.py 1586 1588 --check, then--push --retarget. Squash.master: the gitlink →S3, docs clean. Run docs-check with the SDK checked out. Squash.Each push dismisses the earlier approval, because the ruleset requires approval of the last push. To merge GLM before Super, squash SDK #353 before #354 and swap the
S2/S3pins.Merge Danger
Door: two-way
Blast Radius: Super-only
Components touched
Protocol / interface changes
cache_receipt_boundary_mode.Documentation impact
docs/architecture/inference.md(managed Super slot: SSD default, identity, bank as operator choice, images),docs/architecture/prefix-cache.md(default-on list),docs/provider/direct-mode.md(local image reuse), andchangelog.d/nemotron-super-ssd-checkpoints.md.make docs-checkandmake docs-impact-check BASE=origin/masterpass.