Repository navigation
fix(deps): validate mlx 0.32.3 for the exact paths - #171
Merged
Merged
Conversation
mlx-vlm main already requires mlx 0.32.3, so the release that carries the packed gated-delta prefill kernel (Neywa-Labs/mlx-vlm#2442) will too (#167). This moves the mlx pin and lock to 0.32.3 and adds it to verifyattn.VALIDATED_MLX, keeping 0.32.2 for tool environments still on it. Re-read against v0.32.2..v0.32.3: - scaled_dot_product_attention.cpp: for head dim 256, GQA 6 and 1-8 rows, has_fused_kernel, use_fallback's tail, the one-pass/two-pass rule and the two-pass block table (s, d and the rest) are unchanged; 65536 keys is still the last threshold and MLX_SDPA_BLOCKS is read the same way. The new paths need head dim 512, qL > 8 (prefill only) or the GQA 8/12/16 kernels at head dims 64/128. - sdpa_vector.h: lines 1-324 are byte-identical; the only hunk is inside sdpa_vector_2pass_1_gqa, which head dim 256 never reaches. - device.cpp is_nax_available() and steel/gemm/nax.h BaseNAXFrag::get_coord() are unchanged, so nax.py and kernels/nax.h still mirror them. - custom_kernel.cpp and the metal_kernel binding are unchanged; mlx/fast.cpp only adds gated_delta_update, which neither sous nor mlx-vlm 0.7.2 calls. - nn.QuantizedLinear.__call__ hashes the same, so the projection kernel's mlx pin holds. - Thread-local streams: a fresh thread still gets its default stream lazily (#4514 changes only the compile-cache lookup), clear_streams clears the same state and now drops the GIL, and #4462/#4576 are unreachable from sous's threads. Prefill attention changes on both GPU families (#4487 on NAX, #4505's fused path for qL == kL >= 2048 elsewhere) and compiled sigmoid uses precise exp (#4461), so prefill KV and greedy text may differ from 0.32.2; the mlx version is in the fork key, so every fork store starts cold once. Co-Authored-By: Claude <noreply@anthropic.com>
Naming the releases by hand in nine comments and docs meant every mlx bump had to edit each of them, and the three probe docstrings asserted the exception-path deadlock was seen on 0.32.3 without a re-check. The prose now refers to the set the gates read, and the deadlock note is version-free as projkernel's other mention already was. Co-Authored-By: Claude <noreply@anthropic.com>
nax.py and kernels/nax.h now say their mirrors of is_nax_available() and BaseNAXFrag::get_coord() hold across the releases in VALIDATED_MLX, but the instruction for extending the set named only scaled_dot_product_attention.cpp, so a bump that followed it could make both claims false without anyone re-reading those functions. Co-Authored-By: Claude <noreply@anthropic.com>
This was referenced Oct 11, 2026
Closed
engine: spike — tensor-unit verify attention over GQA-packed rows at 57K, with bf16 and int8 KV
#132
Closed
Closed
Closed
engine: spike — the projection kernel without the attention tile on M1–M4 (M2 microbench first)
#158
Closed
Closed
Closed
engine: greedy vs sampled default — the greedy DFlash path needs sampler=None, not temperature=0
#87
Closed
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.
Stage 1 of #167: move mlx to 0.32.3 and validate the exact paths on it. mlx-vlm main already requires mlx 0.32.3, so the mlx-vlm release that carries the packed gated-delta prefill kernel (Neywa-Labs/mlx-vlm#2442, stage 2) will need this first. mlx-vlm stays at 0.7.2.
Change
verifyattn.VALIDATED_MLXgains 0.32.3. 0.32.2 stays in the set, so a tool environment still on it keeps the exact paths.pyproject.tomlpinsmlx==0.32.3, and the lock moves mlx and mlx-metal to 0.32.3.VALIDATED_MLXinstead of naming them, so the next bump has one set to extend, and one test name no longer names a version. The bump checklist (the comment onVALIDATED_MLXand CLAUDE.md) now names all three mirrors to re-read: the SDPA dispatchplan()follows,is_nax_available()(mirrored bynax.py) andBaseNAXFrag::get_coord()(mirrored bykernels/nax.h). Some of these comments sit inprojkernel.py,tileattn.py,int8prefill.pyandkernels/nax.h, which the fork store hashes; editing them costs nothing, because the mlx version is already in the fork key.Re-read, v0.32.2 → v0.32.3
scaled_dot_product_attention.cpp. For head dim 256, GQA 6 and 1–8 rows, everythingplan()mirrors is unchanged:has_fused_kerneland the tail ofuse_fallback;s,dand the rest);MLX_SDPA_BLOCKSis read.The new paths need head dim 512, the asymmetric (96, 64) head-dim pair, more than 8 query rows (prefill only), or the two-pass GQA kernels: factor 8 at head dims 64 and 128 (renamed, with a batch-index fix) and new factors 12 and 16 at head dim 128. None of them is reachable at head dim 256 and GQA 6 with 1–8 rows.
sdpa_vector.h. Lines 1–324 are byte-identical. The one hunk is insidesdpa_vector_2pass_1_gqa, which head dim 256 never reaches.NAX mirrors.
is_nax_available()andBaseNAXFrag::get_coord()are unchanged, sonax.pyandkernels/nax.hstill mirror them.Custom kernels.
custom_kernel.cppand themetal_kernelbinding are unchanged.mlx/fast.cpponly addsgated_delta_update, which neither sous nor mlx-vlm 0.7.2 calls.Projection-kernel pin.
nn.QuantizedLinear.__call__hashes the same, so the pin holds.Thread-local streams.
evaland the compile-cache lookup from creating one when they don't need it; its other changes are CUDA-only.clear_streamsclears the same state, and now releases the GIL.What moves anyway
nn.siluinternally, so every silu and swiglu runs the changed kernel. A lonemx.sigmoid, compiled or not, is bit-identical. Measured on the M2 over a 2^20-point grid, silu's bits change on 546 bf16 values (about 0.05%) and 441,565 fp32 values; lone sigmoid's change on none.Gate (M5 Pro unless noted)
The rule was written down before any M5 run. Each speed comparison ran main, branch, branch, main, each run in its own process; the decode, parity and daemon runs each used their own isolated daemon (own config, data directory and fork store), never the maintainer's. A harness defect was fixed only by re-running that job; no threshold moved.
verify_attention=active,attention_tile=active,projection_kernel=active,positions=engineanddraft_block=5, and routes 336 int8 projections. The drafter-off parity run has the same tile, kernel and positions, withverify_attention=offand nodraft_block, as expected without a drafter. The projection kernel's warm-up and probe take 3.76 s cold (bar 10) and 0.32 s warm (bar 1).test_engine_vlm(24),test_verifyattn_model,test_tileattn_model,test_projkernel_model,test_int8prefill_model(2),test_api_model(3) andtest_engine_lm(8) all passed.scripts/api_smoke.py, plus a run through the daemon's main mlx threads (endpoint pool, session, model load, preload, idle sweep, status and unload): two turns of one conversation, idle unload then reload,/sous/unloadtwice, a/sous/holdpreload, a decode under/sous/statuspolled at 10 Hz, twosous stops, and fork restores from disk in both daemon lives. One pid per life; no stream, thread or crash errors.count_tokens,/sous/eventsand a stalled-session retirement were not exercised.The tile cell. In one gate run,
kt-tile-br1, that cell was slow for every variant in the process: the tile at 37.76 ms, the stock grouped baseline at 105.2 ms against 73–89 in the other runs. The other branch run was the fastest of all four, at 30.16 ms. T = 1 and T = 8 ran at normal speed in every one of these processes.Two report-only repeats at 131072 keys:
Counting a process as slow when its stock baseline reached 88 ms, the slow mode hit the branch in 3 of 15 processes and main in 2 of 15. The maintainer ruled criterion 3 a pass on these repeats.
Report only.
After merge
Reinstall the M5 tool environment with
uv tool install --reinstall(the pins carry 0.32.3). Expect one cold rebuild of each fork store. #167 stays open for stage 2.Refs #167
🤖 Generated with Claude Code