Repository navigation
update: advance MLX pin to 5a48f9cc - #3517
Conversation
Move the MLX pin from fc344c98 to 5a48f9cc, the head of upstream main on 2026-11-28 (87 commits, past v0.32.5 and the 0.33.0 version bump). - Retire the CPU quantized-matmul overlay (#2248): upstream now accumulates the fp qmm loops in float (ml-explore/mlx#4879). cpu_qmm_accum_tests now guard the upstream loops. - Rebase 24 Metal and CUDA overlays by 3-way merge. CUDA layer_norm and row_reduce shrink to their remaining deltas now that upstream carries #4866 and #4916; SDPA threads upstream's window_size through mlxcel's deterministic and bucketed plan paths; qmm_sm80 keeps the #637 sm_120/121 cap beside #4851's 128-row tile and renames the affected JIT modules so a pre-#4851 cached PTX is not reused. - ROCm overlay: retarget onto the pin, move the fork's fusion limits into mlx/compile/fuse.cpp after upstream split compile.cpp (#4953), define the new allocator hooks as no-ops and add NO_GPU stubs for GroupedMM and SignBit (LOCAL_FIXES 76 to 78). - On M5, int8 activation QMM (#4802) stays on as in upstream. Validated on M3 Ultra: release build, make verify-test (17374 passed, 0 failed), greedy generation on gemma-3n and qwen3.5, make verify-rocm-overlay, fmt. CUDA and ROCm were not compiled (no GB10 or AMD host); the GB10 build and the #637 cap decision are left to a GB10 run.
GB10 verification and decision (handoff to the GB10 agent)This branch was built and tested only on M3 Ultra. The CUDA overlay merges were not compiled. Please run the following on spark-101 or spark-102, under
Push any fix to this branch, post the numbers here, and merge once the CUDA gate passes. |
…#3500) Turbo4 K/V quantization stays on the device, and unmasked single-token decode queries read the packed CUDA cache directly through a new fused attention kernel (one block per batch element and query head, FP32 softmax partials) instead of dequantizing the cold rows first. Dense Turbo4 and the MLA latent codec share the 4-bit packing and #3497's boundary-count lookup, with the former scalar codec kept as the test reference. Merged on the maintainer's instruction without a fresh local CUDA run: the branch was brought onto main by merging main into it, with the resulting tree set equal to a clean cherry-pick of the PR's own commit onto current main (the stacked #3497 commit is already on main as `241a59a3`), so main..head is exactly the PR's 28-file change. The upcoming MLX pin change in #3517 would force the same rebuild and revalidation again. Closes #3272
# Conflicts: # CHANGELOG.md # src/lib/mlxcelverse/overlays/cuda/mlx/backend/cuda/device.cpp
At MLX 5a48f9cc the overlay header no longer gets int64_t through a transitive include, so the CUDA build failed at grouped_gemm.h:59 with `int64_t has not been declared`. Include <cstdint> directly and note it in the overlay header comment. Refs #3517
… SDPA The row-wise DSpark gates compare drafted tokens with classic decode token for token. On CUDA that comparison holds only under MLXCEL_SDPA_DETERMINISTIC=1: otherwise decode attention takes cuDNN stream-K, which does not reduce in a fixed order, and the engine a shape gets depends on what ran earlier in the process. At MLX 5a48f9cc the MiniCPM5 gate passed alone but failed in the lib suite after hy_v4 sink_sdpa_matches_the_written_out_softmax_at_checkpoint_geometry, flipping a near-tie on the 290-token prompt; with the flag it passes in either order. A CUDA build now skips both gates without the flag and fails under MLXCEL_REQUIRE_MODELS=1, as scheduler_real_batch_parity_tests.rs does. Refs #3261 Refs #3517
At MLX 5a48f9cc the 128-row qmm_sm80 tile is #4851's kernel (pipeline depth 2, 1x4 MMA) and upstream picks it by its own wave heuristic. On GB10, a build with the #637 cap against one with upstream's large_tiles ? 128 : 64 gave prefill ratios (cap / upstream, medians of three alternating runs) of 1.021, 0.996 and 0.991 at 512, 2048 and 8192 tokens on llama-3.1-8b-4bit, and 1.168, 0.966 and 1.003 on qwen2.5-7b-4bit, with byte-identical 200-token greedy output. The pin's rule keeps the cap only for a gain at 2048 or 8192 tokens beyond the run-to-run spread, so the overlay follows upstream. mlxcel_tile_m_cap, the 128p2 tag and the gather module's r2 marker go; the #910 r2 marker on the main module and the MLXCEL_QMM_TILE_{M,N,K} overrides stay. Without the cap a 128-row tile launches only from the grouped 64_128 module, a name the previous pin never used, so no pre-#4851 cached PTX can be picked up. The autotuner's TILE_M_CAP_BLACKWELL follows the kernel to 64, or its entries would not be found at startup. The 512-token gain on qwen2.5-7b-4bit (about +10%, re-measured) is recorded in the pin doc for a later look. Refs #637 Refs #3517
# Conflicts: # src/lib/mlxcelverse/overlays/rocm/LOCAL_FIXES.md # src/lib/mlxcelverse/overlays/rocm/README.md
|
GB10 (spark-102, sm_121) handoff results, on Build. The CUDA build failed at #637 cap A/B. This branch against a build where
Decode within 1% except qwen at 2048 (49.6 against 51.6 tok/s, for upstream). 200-token greedy output byte-identical on both models. No gain at 2048 or 8192, so per the decision rule the cap is dropped ( Gate.
Fixes found on the way.
|
The pin's mlx/scheduler.h calls std::atomic<int>::notify_all(), a C++20 member, and every .hip file reaches it through mlx/array.h, so the -std=c++17 that the ROCm overlay passed to hipcc failed the Windows compile-only job. The .hip command now uses -std=c++20, matching the host sources (ROCm LOCAL_FIXES.md item 80). The device/unary_ops.cuh overlay that #3540 added was copied at the old pin fc344c98; upstream added the SignBit functor between that pin and 5a48f9cc, so the overlay now carries it and is stamped at 5a48f9cc. It is the only one of the CUDA overlay files from #3540 that upstream changed between the pins. check_nvrtc_headers.py (static and --require-nvrtc against the new-pin build tree), make verify-rocm-overlay, the CUDA compile and jit lib tests and both real-checkpoint DSpark gates pass on spark-102.
The router WebUI Playwright harness from #3552 indexed `completed_by_handle[index][generation]` inside `for generation in 0..COMPLETING_GENERATIONS`, which `clippy::needless_range_loop` rejects under `-D warnings`. Main's clippy job did not run for that WebUI-only change, so the lint first failed on this PR. The loop now walks the row with `iter_mut().enumerate().take(COMPLETING_GENERATIONS)`; behaviour is unchanged. `cargo clippy --lib --tests --features cuda -- -D warnings` and the module's tests pass.
Advance the reproducible MLX pin from
fc344c98to5a48f9cc, the head of upstreammainon 2026-11-28 (87 commits, past v0.32.5 and the 0.33.0 version bump). Review record:docs/mlxcelverse/mlx-pin-2026-11-28.md.Changes
cpu_qmm_accum_testsguard the upstream loops.layer_norm.cuandrow_reduce.cukeep only their remaining deltas now that upstream has #4866 and #4916. SDPA threads upstream'swindow_size(#4927) through mlxcel's deterministic and bucketed plan paths.qmm_sm80.cukeeps the perf(cuda/quant): sm_120/sm_121-tuned quantized GEMM for Blackwell prefill #637 sm_120/121 cap beside #4851's 128-row tile; modules whose 128-row kernel changed get new names (128p2, gatherr2) because the PTX cache is keyed by module name only.mlx/compile/fuse.cppafter upstream splitcompile.cpp(#4953); the new allocator hooks are no-ops;GroupedMMandSignBitgetNO_GPUstubs (LOCAL_FIXES 76 to 78).Validation
On M3 Ultra: release build at
5a48f9cc,make verify-test(17374 passed, 0 failed, 515 ignored), greedy generation on gemma-3n-e2b-it-4bit and qwen3.5-4b-4bit,make verify-rocm-overlay, overlay drift check, pin parser tests, fmt.Not validated: no CUDA or ROCm compile (no GB10 or AMD host from this machine). The GB10 build, test and the #637 cap decision are delegated to a GB10 run; see the comment below.