Skip to content

chore: bump mlx-swift-lm to pick up DSA stage 2 (lightning indexer) - #159

Merged
solderzzc merged 1 commit into
mainfrom
chore/bump-mlx-swift-lm-dsa-stage2
Aug 26, 2026
Merged

chore: bump mlx-swift-lm to pick up DSA stage 2 (lightning indexer)#159
solderzzc merged 1 commit into
mainfrom
chore/bump-mlx-swift-lm-dsa-stage2

Conversation

@solderzzc

Copy link
Copy Markdown
Member

Summary

Closes #139. Bumps the mlx-swift-lm submodule to pick up mlx-swift-lm#61 — the DSA "lightning indexer" implementation for GLM-5.2/DeepSeek V3.2, restricting attention to the top index_topk cached positions once context grows past that threshold (stage 1 ran dense attention unconditionally).

Includes a follow-up commit fixing a critical bug found in code review before merge: the causal mask was built from a KV cache's post-update .offset instead of pre-update, crashing on any real generation past index_topk (every stage-2 test had used cache: nil, which happened to hide this). Also adds maxKVSize support and fails loudly on cache-type mismatches instead of silently discarding the cache.

Test plan

  • Full mlx-swift-lm test suite: 132/132 passing, including a new real-cache regression test, red-green verified against the reintroduced bug.
  • CI green.
  • Real-weights verification is still open (flagged in GLM-5.2 / DeepSeek V3.2 stage 2: implement the DSA lightning indexer #139) — the smallest glm_moe_dsa checkpoint is 308GB. First real run should use avlp12/GLM-5.2-Alis-MLX-Dynamic-3.5bpw with --stream-experts.

Closes #139. mlx-swift-lm#61 implements the DeepSeek Sparse Attention
lightning indexer for GLM-5.2/DeepSeek V3.2, restricting attention to
the top index_topk cached positions past that threshold (stage 1 ran
dense unconditionally). Includes a follow-up fix commit addressing a
critical crash bug found in review (causal mask built from a KV
cache's post-update offset instead of pre-update, crashing on any real
generation past index_topk) plus maxKVSize support and a fail-loud fix
for cache-type mismatches.

No real-weights verification yet — the smallest glm_moe_dsa checkpoint
is 308GB. First real run should use avlp12/GLM-5.2-Alis-MLX-Dynamic-3.5bpw
with --stream-experts, per #111/#139.
@solderzzc
solderzzc merged commit ec403b1 into main Aug 26, 2026
14 checks passed
@solderzzc
solderzzc deleted the chore/bump-mlx-swift-lm-dsa-stage2 branch August 26, 2026 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GLM-5.2 / DeepSeek V3.2 stage 2: implement the DSA lightning indexer

1 participant