Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions changelog.d/nemotron-super-native-checkpoints.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
### Nemotron Super's prompt cache now restores exactly

- Nemotron Super's prompt cache now restores exactly: an answer from a cached prompt is the answer the same prompt gets without the cache. Super now saves its prompt checkpoints at native precision. Before, they used the provider-wide `balanced` default, which stores older attention rows at 4 bits.
- Measured on the production weights on an M5 Ultra, with 3 reasoning prompts of about 8,600 tokens restored from an 8,192-token checkpoint: `balanced` checkpoints changed all 3 answers, and native checkpoints matched the uncached answers bit for bit in all 3, tokens and logprobs alike.
- Checkpoints are larger. At 8,192 tokens one is about 249 MB instead of 204 MB, so about 15 % more is written per prompt; at 30,720 tokens it is about 457 MB instead of 285 MB. The SSD cache keeps its shared disk budget, so it holds fewer Super checkpoints.
- Super's own per-model setting or the process switch still selects another precision. A global setting, even an explicit `k4v4`, `k8v4` or `k8v8`, no longer applies to Super. Existing Super checkpoints stop matching and age out within their 30-minute lifetime.
17 changes: 12 additions & 5 deletions docs/architecture/inference.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Provider inference engine

> Last updated: 2026-11-09
> Last updated: 2026-11-11

How a chat-completion request is served inside the `darkbloom` provider
process: one in-process engine (`mlx-swift-lm`
Expand Down Expand Up @@ -1252,10 +1252,17 @@ Without a bank (the default) the builder keeps them in an
`SSDHybridCheckpointStore` (`NemotronSuperLocalPrefixCache.durableIdentity`):
the SDK's complete codec writes each chunk checkpoint's KV, conv/SSM state and
the assistant's prompt history encrypted under the provider's cache root, at
the slot's effective checkpoint precision (`engine_v2_kv_checkpoint_quantization`,
`balanced` by default): older attention rows are coded, while the conv/SSM
state and the assistant's history stay exact
([checkpoint precision](kv-cache-quantization.md#native-execution-with-quantized-checkpoints)). The
Super's checkpoint precision (`NemotronSuperLocalPrefixCache.checkpointPrecision`).
That is native unless Super's own `engine_v2_kv_checkpoint_quantization_by_model`
entry or `DARKBLOOM_CBV2_CHECKPOINT_QUANTIZATION` selects a profile; the global
`engine_v2_kv_checkpoint_quantization` does not apply to Super. A native restore
continues a cold prefill bit for bit. Under a profile such as `balanced`, older
attention rows are coded while the conv/SSM state and the assistant's history
stay exact
([checkpoint precision](kv-cache-quantization.md#native-execution-with-quantized-checkpoints)),
and on the pinned checkpoint that moved restored reasoning answers off the cold
ones. A native checkpoint of 8,192 tokens is about 249 MB, against about 204 MB
under `balanced`. The
slot then advertises a durable capability (`prefix_cache_v2_models`), its
checkpoints survive restarts within the store's TTL, and the coordinator's
repeat hint gates their writes as for every other model. A durable checkpoint
Expand Down
6 changes: 6 additions & 0 deletions docs/architecture/kv-cache-quantization.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ execution remains available. This page explains the numerical and ownership
contracts, not completed model qualification or a release. The
[CLI reference](../provider/cli-reference.md#providertoml-keys-read-by-the-cli)
owns the controls and their defaults.
Nemotron Super's managed slot requests native checkpoints unless its own
per-model entry or `DARKBLOOM_CBV2_CHECKPOINT_QUANTIZATION` selects a profile;
the global setting does not apply to it
(`NemotronSuperLocalPrefixCache.checkpointPrecision`). A native restore
continues a cold prefill bit for bit, while `balanced` rows changed restored
answers ([Super's checkpoints](../reference/ssd-kv-cache.md#complete-checkpoint-payload)).

## Context

Expand Down
1 change: 1 addition & 0 deletions docs/provider/cli-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -3727,6 +3727,7 @@ override `provider.toml` for one process, are in
| `[backend] engine_v2_kv_quantization_by_model` | `{}` | Exact model-ID live precision overrides the global setting; `DARKBLOOM_CBV2_KV_QUANTIZATION` overrides both. Existing explicit live `balanced` settings remain live packed. MiMo exclusion precedes parsing. |
| `[backend] engine_v2_kv_checkpoint_quantization` | `"balanced"` | Independent complete-checkpoint encoding request with the same four values. Eligible native paged and contiguous targets encode older attention rows and restore to native state. Unsupported layouts retain native encoding; live-packed targets keep their existing packed format. This does not enable caching, force paging or reduce native memory admission. See [numerical limits and fallback](../architecture/kv-cache-quantization.md#native-execution-with-quantized-checkpoints). On a two-Mac cluster it also sets the pair's SSD prompt-prefix record precision for the pair's public model; both Macs must resolve the same value ([cluster record precision](../reference/configuration.md#cluster-ssd-prefix-record-precision)). |
| `[backend] engine_v2_kv_checkpoint_quantization_by_model` | `{}` | Exact model-ID checkpoint request overrides the global setting; `DARKBLOOM_CBV2_CHECKPOINT_QUANTIZATION` overrides both. MiMo remains native before parsing. |
| `[backend] engine_v2_kv_checkpoint_quantization_by_model."nvidia-nemotron-3.5-super"` | absent: `native` | Nemotron Super's managed slot gives its own entry a built-in `native` default, so a cache hit restores exactly what a cold prefill computes; the global `engine_v2_kv_checkpoint_quantization` does not apply to Super. An explicit entry or `DARKBLOOM_CBV2_CHECKPOINT_QUANTIZATION` selects a profile ([Super's durable checkpoints](../reference/ssd-kv-cache.md#complete-checkpoint-payload)). |
| `[backend] mtp_mode` | `auto` | Written by `darkbloom beta enable|disable mtp` |
| `[backend] mtp_acceptance` | unset (resolves to `typical`, delta `0.2`) | `exact` / `typical` draft acceptance for eligible sampled target-prefix requests. `typical` keeps a draft when the target's filtered probability for it is above `min(1, 0.2 * exp(-H))` (`H` = the target row's entropy in nats); sampled output is approximate, not distribution-exact. Greedy requests never change. Native MiMo remains exact and does not apply this preference. This setting does not enable disabled MTP or widen eligibility. Parsing ignores case and surrounding whitespace; unknown values warn and resolve to `exact` (`provider-swift/Sources/ProviderCore/Inference/MTP/MTPAcceptancePolicy.swift`, `resolve`) |
| `[backend] mtp_acceptance_by_model` | `{}` | Exact model ID to acceptance string; overrides `mtp_acceptance` for that model. An unknown override resolves to `exact`, not the global value. Same eligibility and native MiMo exclusion as above (`MTPAcceptancePolicy.resolve`) |
Expand Down
1 change: 1 addition & 0 deletions docs/reference/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,7 @@ the qualification hook's keys, for speculation and width
| `DARKBLOOM_NEMOTRON_SUPER_MTP_DEPTH`, `_MTP_VERIFICATION`, `_PREFILL_CHUNK`, `_KV_BACKEND`, `_VIDEO_PRUNING` | depth `3,2,2,2,1` (`3,2,1,1,0` on an M5); the [builder defaults](../architecture/inference.md#context) otherwise | Kept when set in the provider process |
| `DARKBLOOM_NEMOTRON_SUPER_DECODE_STEPS_BETWEEN_CHUNKS` | `4` (`NemotronSuperLocalPrefill.defaultDecodeStepsBetweenChunks`); `0`…`64`, any other value fails the load | Decode-only steps after each prompt chunk while requests decode; `0` is the rollback. Forwarded to the launchd provider job |
| `DARKBLOOM_PREFIX_CACHE_MEMORY` | on for either owner when the grant holds every request's fixed bytes and the bank | An explicit value, `DARKBLOOM_PREFIX_CACHE` negative or `DARKBLOOM_CBV2_HYBRID_PREFIX_CACHE=0` keeps the bank off |
| `backend.engine_v2_kv_checkpoint_quantization_by_model."nvidia-nemotron-3.5-super"`, `DARKBLOOM_CBV2_CHECKPOINT_QUANTIZATION` | absent: `native` (`NemotronSuperLocalPrefixCache.checkpointPrecision`) | Complete SSD checkpoints store native rows, so a restore continues a cold prefill bit for bit. The global `engine_v2_kv_checkpoint_quantization` does not apply to Super; Super's own entry or the switch selects a profile such as `balanced` ([layouts and sizes](ssd-kv-cache.md#complete-checkpoint-payload)) |

### Native MiMo V2.6 candidate

Expand Down
22 changes: 15 additions & 7 deletions docs/reference/ssd-kv-cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,13 +207,21 @@ writes 904 MB. A full 262,144-token context checkpoint is about 5.0 GB, inside
the 7 GiB large-memory staging cap.
See the [GLM integration gates](../design/glm53-flash-native.md).

The managed `nvidia-nemotron-3.5-super` slot writes
`native-paged-affine-checkpoint-full-recurrent-mtp-v1` while it speculates and
`native-paged-affine-checkpoint-full-recurrent-v1` target-only at the default
`balanced` precision. Its 8 attention layers (2 KV heads × 128) shrink from
8 KiB to 2.5 KiB per token past the exact 128-token band; the MTP history
(1 KiB per token) and the fixed part (the FP32 SSM state, convolution state and
MTP frontier, 173.9 MB) stay exact.
The managed `nvidia-nemotron-3.5-super` slot writes `native-paged-full-recurrent-v1`
by default (`NemotronSuperLocalPrefixCache.checkpointPrecision`), so a restore
continues a cold prefill bit for bit. The global
`engine_v2_kv_checkpoint_quantization` does not apply to Super; Super's own
`engine_v2_kv_checkpoint_quantization_by_model` entry or
`DARKBLOOM_CBV2_CHECKPOINT_QUANTIZATION` still selects a profile. A profile such
as `balanced` writes `native-paged-affine-checkpoint-full-recurrent-mtp-v1`
while the slot speculates and `native-paged-affine-checkpoint-full-recurrent-v1`
target-only. It shrinks the 8 attention layers (2 KV heads × 128) from 8 KiB to
2.5 KiB per token past the exact 128-token band; the MTP history (1 KiB per
token) and the fixed part (the FP32 SSM state, convolution state and MTP
frontier, 173.9 MB) stay exact. Native files can be
[delta checkpoints](#delta-complete-checkpoints) on the target-only owner. The
speculating owner's MTP history (`[1, heads, rows, headDim]`) has no delta row
layout, so it writes complete files.

| `nvidia-nemotron-3.5-super` checkpoint (DBK3 file, measured on an M3 Ultra) | `native` | `balanced` |
|---|---:|---:|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,9 @@ enum NemotronSuperLocalBridgeBuilder {
/// prefix reuse; with a `routingIdentity` its bank also advertises and
/// proves its checkpoints to the coordinator, and without a bank its
/// checkpoints are complete SSD checkpoints bound to it, encoded at the
/// effective profile of the operator's checkpoint precision
/// (`checkpointQuantizationConfig`, its per-model table and
/// `DARKBLOOM_CBV2_CHECKPOINT_QUANTIZATION`, as for every other model).
/// effective profile of `NemotronSuperLocalPrefixCache.checkpointPrecision`:
/// native unless the per-model table (`checkpointQuantizationConfigByModel`)
/// or `DARKBLOOM_CBV2_CHECKPOINT_QUANTIZATION` selects a profile.
/// Test seam: `completeCheckpointIdentity` replaces the store's runtime
/// disk identity (binary, metallib and numerics), which a test process
/// cannot compute.
Expand Down Expand Up @@ -410,10 +410,9 @@ enum NemotronSuperLocalBridgeBuilder {
routingIdentity: routingIdentity)
: nil
let exactPrefixCheckpoints = prefixCache != nil || durable != nil
let checkpointPrecision = try EngineV2KVQuantizationPolicy.resolve(
modelType: "nemotron_h_omni", global: checkpointQuantizationConfig,
byModel: checkpointQuantizationConfigByModel, modelID: modelID,
environment: environment, purpose: .checkpoint)
let checkpointPrecision = try NemotronSuperLocalPrefixCache.checkpointPrecision(
global: checkpointQuantizationConfig, byModel: checkpointQuantizationConfigByModel,
modelID: modelID, environment: environment)
let kvBackend = try NemotronSuperLocalKVBackend.resolve(environment: environment)
try Task.checkCancellation()
let assembly = try installed.withNativeSetup(construction: construction) { model in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,19 @@ enum NemotronSuperLocalPrefixCache {
return routingIdentity
}

/// The precision a durable store encodes its checkpoints at. Native is
/// Super's per-model default, so a restore continues a cold prefill bit
/// for bit (`balanced` rows moved restored reasoning answers off the cold
/// ones on the pinned checkpoint). The operator's per-model setting for
/// `modelID` or the process switch still selects a profile; the global
/// setting does not apply.
static func checkpointPrecision(global: String, byModel: [String: String], modelID: String,
environment: [String: String]) throws -> EngineV2KVQuantizationSelection {
try EngineV2KVQuantizationPolicy.resolve(modelType: "nemotron_h_omni", global: global,
byModel: [modelID: EngineV2KVQuantizationSelection.native.rawValue].merging(byModel) { $1 },
modelID: modelID, environment: environment, purpose: .checkpoint)
}

/// nil leaves the owner without a bank. The same bank serves both owners:
/// the speculating owner's `NemotronSuperMTPAssistant` checkpoints its
/// prompt history, so `hybridConfig`'s drafter gate stays off
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ import Testing
/// routed owner without a bank keeps its chunk checkpoints in an encrypted
/// store: they restore within the owner and, after the owner is retired, in a
/// new installation, engine and store on the same root and key (a restart).
/// Native checkpoints restore exactly (the cold text); `balanced` ones, the
/// default, code older attention rows and restore the same state every time.
/// Native checkpoints, the default, restore exactly (the cold text);
/// `balanced` ones code older attention rows and restore the same state every
/// time.
/// Lookups and publications carry the SSD tier, another scope never hits, and
/// the store holds no shared-budget reservation.
struct NemotronSuperDurablePrefixCacheTests {
Expand Down Expand Up @@ -82,6 +83,32 @@ struct NemotronSuperDurablePrefixCacheTests {
routingIdentity: Self.routing) == Self.routing)
}

/// Checkpoints store native rows unless the operator's setting for Super or
/// the process switch selects a profile: a native restore continues a cold
/// prefill bit for bit, while `balanced` rows moved restored reasoning
/// answers off the cold ones. The global setting, which a saved
/// provider.toml spells out as `balanced`, does not select Super's.
@Test func checkpointsDefaultToNativePrecision() {
let key = EngineV2KVQuantizationPolicy.checkpointEnvironmentKey
/// nil when the settings are refused.
func precision(global: String = "balanced", byModel: [String: String] = [:],
environment: [String: String] = [:],
modelID: String = Self.modelID) -> EngineV2KVQuantizationSelection? {
try? Prefix.checkpointPrecision(global: global, byModel: byModel, modelID: modelID,
environment: environment)
}
for global in ["balanced", "", "k4v4", "k8v4", "k8v8", "native"] {
#expect(precision(global: global) == .native, "global \(global)")
}
#expect(precision(modelID: NemotronSuperLocalBinding.modelID) == .native)
#expect(precision(byModel: ["another-model": "balanced"]) == .native)
// The operator's own choices for Super still win, in the shared order.
#expect(precision(byModel: [Self.modelID: "balanced"]) == .balanced)
#expect(precision(global: "native", byModel: [Self.modelID: "k8v8"]) == .k8v8)
#expect(precision(environment: [key: "balanced"]) == .balanced)
#expect(precision(byModel: [Self.modelID: "balanced"], environment: [key: "native"]) == .native)
}

/// The store layout for a checkpoint precision: `balanced` codes the
/// attention rows, beside the speculating owner's exact assistant history.
static func layout(profile: String, speculates: Bool) -> String {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import Testing
/// Gated qualification of the managed Super slot's checkpoint profile on the
/// pinned checkpoint, one storage arm per process: the operator's
/// `DARKBLOOM_CBV2_CHECKPOINT_QUANTIZATION` (`native` or `balanced`) selects
/// it. The loop's complete SSD store lives in an isolated ephemeral-key root
/// it; unset, the arm is the slot's default (native). The loop's complete SSD
/// store lives in an isolated ephemeral-key root
/// (`DARKBLOOM_PREFIX_CACHE_ALLOW_EPHEMERAL=1`, `DARKBLOOM_PREFIX_CACHE_TEST_ROOT`).
/// For each prompt length (`DARKBLOOM_SUPER_CHECKPOINT_LENGTHS`) it records
/// cold, donor, restored and repeated speculating runs (answer, TTFT, restored
Expand Down Expand Up @@ -44,8 +45,8 @@ extension NemotronSuperManagedSlotTests {
.timeLimit(.minutes(120)))
func pinnedCheckpointCheckpointProfileQualification() async throws {
let environment = ProcessInfo.processInfo.environment
let arm = try #require(environment["DARKBLOOM_CBV2_CHECKPOINT_QUANTIZATION"])
try #require(["native", "balanced"].contains(arm))
let arm = environment["DARKBLOOM_CBV2_CHECKPOINT_QUANTIZATION"] ?? "default"
try #require(["default", "native", "balanced"].contains(arm))
try #require(environment[PrefixCachePolicy.memoryEnvironmentFlag] != "1",
"the resident bank replaces the complete SSD store")
// Just past whole 2,048-token chunks, so each restores 2,048, 8,192 and 30,720 tokens.
Expand All @@ -68,7 +69,7 @@ extension NemotronSuperManagedSlotTests {
"\(owner.bridge.prefixCacheModelStatus()) \(String(describing: owner.bridge.prefixCacheConstructionFailure))")
let engine = try #require(await owner.bridge.ownedEngine as? EngineV2)
let layout = store.config.backendLayout
let expectedLayout = arm == "native" ? CBv2CompleteCheckpointManifest.pagedLayout
let expectedLayout = arm != "balanced" ? CBv2CompleteCheckpointManifest.pagedLayout
: owner.speculates ? CBv2CompleteCheckpointManifest.nativeQuantizedPagedMTPLayout
: CBv2CompleteCheckpointManifest.nativeQuantizedPagedLayout
try #require(layout == expectedLayout, "layout \(layout)")
Expand Down Expand Up @@ -275,6 +276,10 @@ extension NemotronSuperManagedSlotTests {
if row.saved != restored.saved { failures.append("\(length): \(label) restore covered a different depth") }
if row.tokens != restored.tokens { failures.append("\(length): \(label) restore differs from the first") }
}
// A native restore continues the cold prefill bit for bit.
if arm != "balanced" && (restored.tokens != cold.tokens || restoredRow.tokens != coldRow.tokens) {
failures.append("\(length): a native restore differs from cold")
}
for (label, row) in [("cold", cold), ("donor", donor), ("restored", restored), ("repeated", repeated),
("after-cancel", afterCancel)]
where !answered(row, target: target) {
Expand Down
Loading
Loading