Repository navigation
perf(glm): store GLM-5.3-Flash SSD checkpoints at BF16 - #1587
Closed
jonathan308 wants to merge 4 commits into
Closed
jonathan308 wants to merge 4 commits into
jonathan308 wants to merge 4 commits into
Conversation
Bump mlx-swift-lm to 39a12e1d (Layr-Labs/mlx-swift-lm#353): GLM complete checkpoints write the latent keys, the index/gate/validity values row and the KDA convolution history at their BF16 activation dtype and widen them back to the identical FP32 bits on restore; the FP32 KDA recurrent state is unchanged and any value BF16 cannot hold refuses the donation. The layout becomes native-paged-glm5next-full-state-v2 (new namespace; v1 files expire through the whole-root TTL sweep). Measured on an M5 Ultra against the v0.10.1 build: checkpoints at 2,048 / 8,192 / 30,720 tokens shrink 18 / 33 / 42 %, bytes per token 48 %, SSD bytes for an identical workload 30 %, and restore stage 25-29 %. Document the v2 layout and sizes in the SSD reference and prefix-cache architecture pages.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Bump mlx-swift-lm to 9abc8090 (Layr-Labs/mlx-swift-lm#353): the restore-time validity check strides through the values row's validity column instead of testing every element (one 30,720-token checkpoint: 51.3 ms -> 0.53 ms on an M3 Ultra).
Refactor pass. The SSD reference owns the GLM full-state v2 format; the prefix-cache and inference explanations now name the identifiers and link to it instead of restating its values (BF16, the payload ratio, the FP32 recurrent state). The reference cites the helper by its symbol and tabulates the current v2 checkpoint sizes; the retired v1 comparison stays in the changelog fragment and the PR evidence.
…-swift-lm#353 Bumps libs/mlx-swift-lm 9abc8090 -> 184b5a93: the paged export walk is shared by the native and narrowing branches, a wire dtype equal to the page dtype is the native layout, the import sink drops its force unwraps, and the half-precision tests are split into unit and kernel suites. The checkpoint format and every GLM checkpoint byte are unchanged.
This was referenced Oct 24, 2026
Collaborator
Author
|
Superseded by #1592; consolidated per owner request |
jonathan308
added a commit
that referenced
this pull request
Oct 24, 2026
…otron 3.5 Super (601a97d) into provider 0.10.2 features GLM-5.3-Flash and Nemotron 3.5 Super now default to the 4-bit balanced SSD checkpoint profile; #1587's BF16 layout remains the native fallback. Resolves the libs/mlx-swift-lm pin to the 0.10.2 SDK set bc4e5f57 (main + #360 + #357 + #359 + #362 + #363).
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
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.
Summary
GLM-5.3-Flash SSD checkpoints are now stored at half precision where the values are half precision. This bumps
libs/mlx-swift-lmto Layr-Labs/mlx-swift-lm#353 (9abc8090) and adds docs and a changelog fragment. The latent keys, the[index keys | pool gates | validity]values row and the KDA convolution history are FP32 copies of BF16 activations, so they are written at BF16 and widened back to the same FP32 bits on restore. The accumulated KDA recurrent state stays FP32. The export refuses any value BF16 cannot hold exactly.flowchart LR subgraph Before["Before (v1)"] D1[donation] --> W1["DBK3 all FP32<br/>30,720 tok = 1,242.8 MB"] W1 --> R1["restore: decrypt + copy<br/>stage 1.84 s"] end subgraph After["After (v2)"] D2[donation] --> N2{exact in BF16?} N2 -- no --> X2[no file] N2 -- yes --> W2["DBK3 BF16 roles + FP32 recurrent<br/>30,720 tok = 716.4 MB"] W2 --> R2["restore: decrypt + widen<br/>stage 1.38 s"] endEvery SSD invariant is untouched: encryption and authentication per segment, owner-only paths, volume identity, missing-disk refusal, daily write accounting (it is now charged fewer bytes) and bounded retirement. The provider code is unchanged; the store sees smaller, differently typed descriptors through the existing manifest.
Linked issue
None; follow-up from the GLM-5.3-Flash cache-routing qualification (store GLM SSD snapshots at half precision). Depends on Layr-Labs/mlx-swift-lm#353.
Test plan
aabb9056…(SDK6148b6da) and0a98171c…(SDK2c512cda, the same code before formatting). Each ran the real GLM-5.3-Flash weights and the production metallib156f2624…, against the same loopback coordinator (realapi.Server, registry and prompt sidecar, cache routing on) and the same prompts. Each build ran 2k/8k/32k sequences (2 uncached, warm hit, hit aftersudo purge, q2 hit vs other-account miss) and a 6-donor concurrent burst.DARKBLOOM_TEST_NATIVE_COMPLETE_PREFIX=1). See mlx-swift-lm#353../scripts/docs-check.sh(196 files OK),python3 scripts/docs-impact-check.py --base 9034a5a0f(OK),python3 scripts/changelog.py check.Every v2 donation succeeded, so no element needed rounding. Cold TTFT also differed by ~0.4 s between the two processes, so stage time is the clean restore metric.
Second commit (
f8a270ae4): the SDK's restore-time GLM validity check now strides through the validity column (1 element in 257) instead of testing every element. One 30,720-token checkpoint validates in 0.53 ms instead of 51.3 ms (M3 Ultra micro-benchmark); see mlx-swift-lm#353.Components touched
Protocol / interface changes
None on the wire. The checkpoint layout string becomes
native-paged-glm5next-full-state-v2, which changes the SSD layout epoch and namespace. Receipts, usage and routing fields are unchanged.Merge Danger
Door: two-way
Providers start a fresh GLM namespace after upgrading, so warm GLM checkpoints are lost once; the cache is regenerable. A rollback ignores v2 files the same way, and whole-root maintenance expires the stale namespace by TTL.
Blast Radius: GLM-SSD-cache
Only GLM's codec records a half wire dtype. Other models' manifests keep
storage == nil, so the FP32/native wire is byte-identical to before.Refactor pass
Done, in two signed commits. The provider code and the changelog fragment are unchanged.
6e076fe30docs: the SSD reference owns the GLM v2 format.prefix-cache.mdandinference.mdnow name the identifiers and link to it instead of restating its values (BF16, "roughly halves", the FP32 recurrent state), following docs rule 7. The reference citesCBv2CheckpointHalfPrecisionby symbol and lists only the current v2 sizes. The v1 comparison remains in the changelog fragment and in this PR's evidence.b2d77d6efpin:libs/mlx-swift-lmmoves9abc8090→184b5a93, the refactor pass of feat(glm5next): write GLM complete checkpoints at their BF16 activation dtype mlx-swift-lm#353. It preserves behavior and the format, and supersedes the9abc8090cited above.Validation on
b2d77d6ef:GLM5NextEncryptedCheckpointTests(real tiny GLM through the encrypted store, with and without MTP),SSDHybridCheckpoint*,SSDCheckpoint*,SSDPrefixCache*,SSDCompleteCheckpointStageCapTests,CompletePrefixCacheCapabilityTestsandPrefixCache*. Opt-in live and benchmark cases skip by design.DARKBLOOM_TEST_GLM5_PROTECTED_FACTORY=1,GLM5NextProtectedFactoryTests|GLM5NextProviderLoopTests: 11 tests in 2 suites passed../scripts/docs-check.sh(196 OK),python3 scripts/docs-impact-check.py --base origin/master(OK),python3 scripts/changelog.py check(2 valid) andpython3 scripts/test-docs-impact-check.py(OK).