Repository navigation
provider: Gemma 4 coupled MTP drafting switch (off by default); re-pin mlx-swift-lm - #2828
Merged
Merged
Conversation
Re-pin libs/mlx-swift-lm to the SDK main commit that adds CBv2MTPCoupledStepDrafter, which Gemma4CBv2MTPDrafter adopts: in a round with coupled proposals, a sampled row proposes the keyed race its verify draw runs at that output index instead of the draft's argmax. Only the mlx-swift-lm pin moves; mlx and mlx-swift are unchanged. DARKBLOOM_GEMMA4_MTP_COUPLED turns it on for Gemma 4's drafter (Gemma4MTPCoupledPolicy; 1/true/yes/on, 0/false/no/off; off by default), as DARKBLOOM_INKLING_MTP_COUPLED does for Inkling 2 Mini. Output is the same with it on or off: exact acceptance commits only the target's draws, so only acceptance can move. The LaunchAgent forwards the key. Tests: the policy's default, its Gemma-only rule and the LaunchAgent key; a benchmark session built on a tiny Gemma 4 pair has coupling off by default and on with the key set.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
jonathan308
changed the base branch from
fix/kv-regrow-floors-dev
to
ink-engine/inkling-mtp-fixes
December 2, 2026 01:53
libs/mlx-swift-lm moves to the mlx-swift-lm main that carries the prefix-checkpoint stride (DARKBLOOM_PREFIX_CHECKPOINT_STRIDE, default all) and Inkling 2's MTP-round command buffers (DARKBLOOM_INKLING2_MTP_CB_OPS, default 400; 0 keeps MLX's defaults). No other SDK change rides the move. LaunchAgent forwards both SDK-read keys (inferencePassthroughEnvKeys), so an operator's rollback reaches a background provider. The configuration reference gets a row for each key. Tests: SDKInklingSpeedSwitchesTests (each key is forwarded when set and absent when unset).
Brings in the base branch's head, the KV regrow floors work with its sub-floor switch and that switch's LaunchAgent key, so this branch's tests run on it. The merge is clean: nothing is resolved by hand.
Brings in the base branch's head so this branch is up to date with it. Both sides add rows at the same place in docs/reference/configuration.md (after DARKBLOOM_INKLING_MTP_COUPLED): the resolution keeps every row from both sides. Every other file merges cleanly.
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.
What changes
libs/mlx-swift-lmmoves to the SDK main merge commit 01abffbe1f (Layr-Labs/mlx-swift-lm PR feat(tools): enforce Gemma tool choices at inference #561). It addsCBv2MTPCoupledStepDrafter, whichGemma4CBv2MTPDrafteradopts. Only this pin moves:libs/mlx(72dffa2d)and
libs/mlx-swift(b1c94d29) are unchanged, so the metallib is unchanged.Gemma4MTPCoupledPolicy(new):DARKBLOOM_GEMMA4_MTP_COUPLEDsetsCBv2MTPConfig.coupledProposalsfor Gemma 4'sdrafter only, in
EngineV2SlotFactory.makeProductionBundlebeside Inkling 2's switch.docs/reference/configuration.md,docs/architecture/inference.mdand achangelog fragment describe it.
Default and switch
Gemma4MTPCoupledPolicy.coupledByDefault = false). Inkling 2's coupled drafting is also off bydefault in production, and Gemma takes the SDK's step-drafter branch, not Inkling's block-drafter branch, so the
default stays off until it is measured.
DARKBLOOM_GEMMA4_MTP_COUPLED:1,true,yes,onenable;0,false,no,offdisable (trimmed, anycase); other values keep the default. Never on for another drafter.
speed, can move. Greedy rows, rows under a grammar and typical acceptance are unaffected.
Before / after
flowchart LR subgraph Before A1[sampled Gemma 4 row] --> B1[drafter proposes argmax] B1 --> C1[exact verify keeps the draft if it equals the keyed target draw] end subgraph After A2[sampled Gemma 4 row] --> K2{DARKBLOOM_GEMMA4_MTP_COUPLED} K2 -- off, default --> B2[drafter proposes argmax] K2 -- on --> D2[drafter proposes the keyed race of the verify draw] B2 --> C2[exact verify: same output] D2 --> C2 endflowchart LR subgraph Before F1[makeProductionBundle] --> M1[mtpConfig: coupledProposals false for Gemma] end subgraph After F2[makeProductionBundle] --> P2[Gemma4MTPCoupledPolicy.coupledProposals] P2 --> M2[mtpConfig.coupledProposals] M2 --> E2[EngineV2 plain-drafter branch: coupled draftStep when a selection exists] endTests
Gemma4MTPCoupledSwitchTests: the key, the off default, the pinned SDK'sGemma4CBv2MTPDrafteradoptingCBv2MTPCoupledStepDrafter, no coupling without a Gemma 4 drafter, and the LaunchAgent forwarding the key.EngineV2BenchmarkMTPAcceptanceTests: a benchmark session on a tiny Gemma 4 target and assistant hasmtpEffectiveConfig.coupledProposals == falseby default andtruewithDARKBLOOM_GEMMA4_MTP_COUPLED= ON,with exact acceptance in both.
Validation
swiftc -parsepasses on the changed Swift files;scripts/changelog.py checkpasses with the base's fragments plus this one.Limitations
1.0 decides the default.
Refactor pass
One independent review read of the diff before the commit (lean release mode); no separate refactor pass was run.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.