Skip to content

update(mla): absorb DeepSeek V2 by default on CUDA, add GB10 results - #3149

Merged
inureyes merged 1 commit into
mainfrom
update/issue-3133-cuda-mla-default
Nov 18, 2026
Merged

inureyes merged 1 commit into
mainfrom
update/issue-3133-cuda-mla-default

Conversation

@inureyes

Copy link
Copy Markdown
Member

Completes #3133 on CUDA (GB10, sm_121, driver 580.178.04, CUDA 13.0, 121 GB unified memory). No ROCm host was available. Full tables and per-run CSVs: docs/benchmark_results/mla-and-prefill-memory-cuda-gb10-2026-11-18.md.

Change

Unset MLXCEL_MLA_ABSORBED now absorbs DeepSeek V2 on CUDA as well as where the fused kernel runs (mla::default_absorbs_on). ROCm, the CPU backend and Metal with MLXCEL_MLA_FUSED_DECODE=0 keep the decompressed default. kv_arch already follows mla::absorbed_enabled() (#3137), so mlxcel inspect on V2-Lite at 32K now reports 972.0 MiB of KV on CUDA instead of 8.44 GiB (total 11.12 vs 20.10 GiB). The PR also updates the docs and CHANGELOG and corrects two statements in the #3138 report (below).

V2-Lite decode, =0 vs =1 (composed), median tok/s

prompt cell =0 =1
512 tg128, 5 runs 96.05 98.52 +2.6%
512 tg128, 160 warmup, 5 runs 98.63 98.92 +0.3%
512 tg512, 3 runs 93.47 94.43 +1.0%
2048 tg128, 2 runs 81.48 97.78 +20%
16384 tg128, 2 runs 30.23 72.85 2.4x

Teacher-forced trace =1 vs =0: 0/208 decided behind 1024 and 0/106 behind 4096 (Metal 0/209, 0/106). Every =1 run counts absorbed_composed and absorbed_fused=0. On this branch the unset default traces byte-identical to =1, and deepseek_v2_greedy_parity passes.

Prefill peak, 28K prompt (MLX phase peak)

model path before after
GLM-4.7-flash (vs b21825cf) 2048 chunks 24.79 GB 22.73 GB
GLM-4.7-flash single pass 74.56 GB 30.18 GB
gpt-oss-20b (vs 3efb3fb2) 2048 chunks / single pass 14.52 / 26.63 GB unchanged

gpt-oss is unchanged on CUDA by design: the sink causal-mode route is Metal only.

Llama 4 Scout past 8192

  • One 9216 forward vs two 4608 forwards: 0/3642 decided (Metal 0/3651).
  • MLX peak for the 9216 single pass: 68.03 GB.
  • Decode past 8192 was broken on CUDA; fix(cuda): reject mid-buffer KV slices in the cuDNN decode test #3138 fixed it. With the fix, decode after an 8720 prefill shows 0/149 decided disagreements, and the chunked and single-pass generations match.

Gate

On fab141b1, with glm4v_moe_maskless_padded_prefill_matches_unpadded skipped: 184 binaries, 15910 passed, 0 failed. Without that skip, the kernel OOM killer stops the gate on this host; that and a port-race flake are filed as #3147. #3140 was also found.

#3138 report correction

The Scout decode reference was a single-pass prefill trace, not MLXCEL_SDPA_DETERMINISTIC=1. The 8001-token run's last three steps, where the window reaches 256 keys, already show the defect.

Validation: mla:: (61) and kv_arch/deepseek_v2/advisor/snapshot (85) unit tests on CUDA, deepseek_v2_greedy_parity, dead_doc_pointers, and cargo clippy -p mlxcel-core --features cuda --all-targets -D warnings.

Closes #3133

Issue #3133 measured the 2026-11 MLA and prefill-memory changes on CUDA (GB10). Absorbed decode on CUDA takes the composed path, which on Metal had cost about 10% at 512 tokens before the fused kernel. On GB10 it decodes within run-to-run noise of the decompressed path at 512 tokens (medians +0.3 to +2.6% over three five-run cells), about 20% faster behind 2K and 2.4x behind 16K, with 0 decided disagreements in the teacher-forced trace, so #3102's switch rule holds.

`mla::default_absorbs_on` now makes the unset `MLXCEL_MLA_ABSORBED` absorb where the fused kernel runs and on CUDA; ROCm, the CPU backend and Metal with the kernel off keep the decompressed default. `kv_arch` already reads `mla::absorbed_enabled()`, so V2-Lite at 32K now estimates 972.0 MiB of KV on CUDA instead of 8.44 GiB.

Adds the GB10 results (decode, prefill peak, traces, gate) under `docs/benchmark_results/`, updates the MLA and environment docs and the CHANGELOG, and corrects the #3138 report: its Scout reference was a single-pass prefill trace, not the deterministic SDPA path, and the 8001-token run's last three steps already showed the defect.

Closes #3133
@inureyes inureyes added type:performance Performance improvements status:review Under review priority:medium Medium priority platform:linux Linux (CUDA / packaging) specific area:benchmark Benchmark harness and performance measurement (bench_*.sh, /update-benchmarks) labels Nov 18, 2026
@inureyes
inureyes merged commit 7f8b6c9 into main Nov 18, 2026
32 checks passed
@inureyes
inureyes deleted the update/issue-3133-cuda-mla-default branch November 18, 2026 01:10
@inureyes inureyes added status:done Completed and removed status:review Under review labels Nov 18, 2026
inureyes added a commit that referenced this pull request Nov 18, 2026
…ts (#3152)

* update(mla): absorb DeepSeek V2 by default on ROCm, add gfx1151 results

Issue #3133 measured the 2026-11 MLA and prefill-memory changes on CUDA (#3149) and left ROCm unmeasured for lack of a host. On a gfx1151 host the composed absorbed path decodes 3.4% behind the decompressed layout at 512 tokens (median of five runs per arm), 17% ahead behind 2K and 65% ahead behind 16K, where the phase peak drops from 16.06 to 12.39 GB, with 0 decided disagreements in the teacher-forced trace, so #3102's switch rule holds there too.

`mla::default_absorbs_on` now makes the unset `MLXCEL_MLA_ABSORBED` absorb on ROCm as well; the CPU backend and Metal with the fused kernel off keep the decompressed default. `kv_arch` already reads `mla::absorbed_enabled()`, so V2-Lite at 32K now estimates 972.0 MiB of KV instead of 8.44 GiB.

Adds the gfx1151 decode, trace and prefill-peak results: GLM-4.7-Flash fits a 28K single pass in 21.13 GB where the pre-#3114 tree asks for 62.72 GB, prefills 3.0x faster with 2048-token chunks, and gpt-oss-20b stays unchanged as designed. Llama 4 Scout did not fit on the host and is not recorded.

* docs(mla): record ROCm results provenance and qualify the sizing claim

The gfx1151 record is the evidence behind the new ROCm default, so its provenance and its weakest cell have to stand on their own. The CSVs now carry the measured commit (`c27b86f4`) like the CUDA rows, section 7 says which binary produced the `inspect` rows, and the record lists the MLX pin and ROCm overlay commit.

Section 4 notes the 26.43 GB gpt-oss branch run instead of presenting both arms as 26.21 GB, the GLM failure is recorded as an allocation rather than an inferred mask array, and the Gate section replaces `PENDING` with what actually ran: the two narrow suites pass and the full local `make verify-rocm-held` was stopped by the memory guard, so hosted CI carries the rest.

The docs no longer say the composed path is level with or ahead at 512 tokens on ROCm; the measured median is 3.4% behind there, and the claim is now within a few percent at 512 and ahead from 2K. The top-level layout summary and the family table now name ROCm.

Refs #3133

* docs(mla): record the completed ROCm gate for the gfx1151 run

The full local gate did run: a second attempt with the job cap lowered to three passed every prerequisite and the workspace tests (192 binaries, 15,954 passed). The first attempt was the one the memory guard stopped, so the record now says both.

Refs #3133

* docs: add technical report for PR #3152
inureyes added a commit that referenced this pull request Nov 18, 2026
Bumps every version-tracking workspace crate (mlxcel, mlxcel-core, mlxcel-mlx-pin, mlxcel-surgery, mlxcel-xla) to 0.9.0-beta.1 through `make bump-version` and syncs Cargo.lock. `make verify-versions` passes.

Renames the Unreleased changelog section to v0.9.0-beta.1 and records the 190 commits since v0.8.1. The existing entries covered the MLA, prefill-memory and OpenXLA decode work; the section gains grouped bullets for background Responses, the qwen4_exp prompt-cache snapshots and the opt-in checkpoints, MiMo-V2.6, IndicOCR, YOLO11, compressed-tensors FP8, the OpenXLA CUDA GEMV and 31 fixes, plus Performance, Dependencies, CI/CD and Docs sections and the v0.8.1...v0.9.0-beta.1 compare link. The stale Known Issues entry that said DeepSeek V2 keeps the decompressed cache on CUDA and ROCm is removed, since #3149 and #3152 made the latent the default there, and the open issues (#3142, #3144, #2817, the qwen4_exp chained-hit rounding from #2975, and the fp16 fallback for quantized KV on MLA latents) are listed.

Regenerates `recipes/registry/` with the 0.9.0-beta.1 snapshot and repoints CURRENT. The snapshot came from `mlxcel arch --json` on a debug build of this tree instead of the release build `make recipes-registry` runs; its output matches a release binary built from the same code apart from the version field. The only family delta from 0.8.1 is the new `mimo_v2_vlm` entry.

Updates the release pointers: the README main-branch line with highlights for the DeepSeek V2 latent default and background Responses, the bug report placeholder, CITATION.cff, and the cluster note in `docs/distributed.md` and `cluster_handshake.rs`, since v0.8.1 and v0.9.0-beta.1 cannot share a cluster. SECURITY.md is unchanged because 0.8.x remains the supported stable line.
@inureyes inureyes added this to the 0.9 milestone Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:benchmark Benchmark harness and performance measurement (bench_*.sh, /update-benchmarks) platform:linux Linux (CUDA / packaging) specific priority:medium Medium priority status:done Completed type:performance Performance improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(bench): measure the 2026-11 memory and MLA changes on CUDA and ROCm

1 participant