Repository navigation
perf(glm): faster long-context decode — SDK pin for bounded paged reads and decode/MTP command buffers (folds into #1592) - #1598
Merged
jonathan308 merged 3 commits intoOct 24, 2026
Conversation
…buffers Re-pins libs/mlx-swift-lm to ed573083 (perf/glm-long-context-decode on efd38585): - paged GLM history and selection reads bind up to 17 KV segments per launch and copy only each segment's pages, with no zero fill (exact copies); - plain GLM decode steps take op-count-only command buffers (100 ops, no input bound), as Nemotron Super and Flint do. Docs: the GLM paged-read and command-buffer behaviour in docs/architecture/inference.md. Changelog fragment glm-long-context-decode.
…unds Re-pins libs/mlx-swift-lm to 5fba64c0 (perf/glm-long-context-decode): GLM MTP rounds whose rows are all decode or verification rows take the same op-count-only command buffers as plain decode; rounds that carry a prompt chunk keep MLX's defaults. Docs and the changelog fragment state the scope and the measured M5 Ultra speeds.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Refactor pass. The pinned SDK (ed573083 onward) binds up to PagedSegmentDispatchPlan.maximumBindings (17) segments per paged read launch; inference.md still said one launch per 64 MiB segment. Also rewraps the paragraph. Docs only.
This was referenced Oct 24, 2026
jonathan308
merged commit Oct 24, 2026
f45964e
into
release/provider-0.10.2-features
5 checks passed
jonathan308
added a commit
that referenced
this pull request
Oct 24, 2026
…0.2 features GLM long-context decode: the SDK's bounded paged reads and decode command buffers, and the command-buffer scope for MTP verification rounds (with SDK #362). Folded into #1592 per the parent. The libs/mlx-swift-lm gitlink keeps HEAD's here; the final pin follows SDK main FINAL. # Conflicts: # libs/mlx-swift-lm
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.
This was referenced Oct 24, 2026
Merged
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.
Folds into #1592 (
release/provider-0.10.2-features): this branch is #1592's headcc7a611f3plus two commits, so the PR targets #1592's branch (a stacked child, per the linear-stack rule) and its diff is only those commits. SDK side: mlx-swift-lm #362 (Layr-Labs/mlx-swift-lm#362) (same commits on the #356 fold branchperf/glm-long-context-decode@5fba64c0).Summary
Re-pins
libs/mlx-swift-lmto5fba64c0so GLM-5.3-Flash's paged long-context decode stops paying one full-history launch per 64 MiB KV segment, and GLM plain decode gets op-count-only command buffers. Docs (docs/architecture/inference.md) and a changelog fragment (glm-long-context-decode.md).Before / after flow:
flowchart TB A[decode step] --> B{paged DSA read} B -->|before| C["S launches × full history<br/>(+ zero fill)"] B -->|after| D["ceil(S/17) launches × own pages"] A --> E{plain decode?} E -->|before| F[MLX default command buffers] E -->|after| G[100 ops / no input bound]Evidence
M5 Ultra 256 GB (#1, native GLM path), c=1, adaptive MTP, T=1.0 / top_p 0.95, reasoning on, production
262,144-token selection, one cold request per cell. Before = #1592 head
cc7a611f3(SDKefd38585); after =the same provider with this SDK head.
MTP acceptance 0.79–0.90 in every cell. Concurrency (short prompts, 256 tokens; plain-decode scope only, before the
MTP-round commit): c=3 aggregate 84.1 / 86.4 → 92.2 / 91.9 tok/s (+8 %), 8K-prompt c=3 aggregate 59.3 → 78.3.
The MTP-round scope alone (same build, switch): 80.2 / 66.8 / 57.1 → 82.4 / 71.4 / 62.3 tok/s at 1K / 8K / 32K.
Kernel profile (M3 Ultra, the SDK's kernel sources before/after at GLM-5.3 geometry, 12 DSA layers per step,
reads_equal= bit-identical bytes at every size):Exactness:
and after.
xcodebuild test-without-building):Test run with 82 tests in 4 suites passed— GLM5NextCBv2Tests(
deviceTableMetadataReadsMatchHostRecordswith two-page segments, growth and a copy-on-write fork;deviceTableMetadataEngineMatchesContiguousTarget;latentHistoryReadMatchesSelectedReadsBitwise;latentHistoryPagedEngineMatchesContiguousEngine), GLM5NextKernelSpecializationTests (single binding equals theformer kernel bitwise; new
boundSelectedLatentReadMatchesPerSegmentReadsfor 1/3/4/5/9/17 segments; templates carryno history length), GLM5NextMTPTests (new
nativeResourcesDeclarePlainDecodeCommandBufferLimits).Not in this PR (measured, documented for 0.10.3): paged split-K is within noise after these fixes (69.5 / 58.1 / 42.9
vs 66.8 / 57.1 / 44.3 at 8K / 32K / 64K) and is not bit-exact, so it stays off. The next long-context cost is MLX
allocator churn: history-sized read outputs grow every step, miss MLX's buffer cache and pay a residency-set commit
(25 % of the engine thread at 64K after this PR).
Merge Danger
Door: two-way (a gitlink bump; outputs bit-identical; no protocol, catalog, pricing or checkpoint-identity change).
Blast Radius: GLM-5.3-Flash serving speed only.
Refactor pass: done, docs-only change (
8bd2d66f7): inference.md said every paged read launches once per 64 MiB segment; the pinned SDK binds up to 17 segments per launch (PagedSegmentDispatchPlan.maximumBindings), as the changelog fragment already said. The paragraph was rewrapped. docs-check, docs-impact and changelog check pass. The pin and fragment were reviewed, unchanged. On the combined debug build of #1592d85f7e71a+ #1593 + #1595 (2994a65a8) + #1598 with SDK4d962e39+5d3bf208+5fba64c0merged; M3, isolated state, usage journal unchanged:GLM5NextProtectedFactoryTests+GLM5NextProviderLoopTests13/2 andGLM5NextLogprobsTests2/1 pass.