Skip to content

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

Merged
inureyes merged 4 commits into
mainfrom
update/issue-3133-rocm-absorbed-default
Nov 18, 2026
Merged

inureyes merged 4 commits into
mainfrom
update/issue-3133-rocm-absorbed-default

Conversation

@inureyes

@inureyes inureyes commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Summary

Issue #3133 measured the 2026-11 MLA and prefill-memory changes on CUDA (#3149) and left ROCm unmeasured because no host was available. This adds the ROCm row on a gfx1151 host (Ryzen AI MAX+ 395, Radeon 8060S, 30 GiB unified memory) and lets the DeepSeek V2 default follow that measurement: with MLXCEL_MLA_ABSORBED unset, a ROCm build now caches the MLA latent and runs absorbed decode on the composed path, which is the same rule #3102 and #3131 applied on Metal and #3133 applied on CUDA.

Correctness (section 3)

ROCm has no fused absorbed-decode kernel, so MLXCEL_MLA_ABSORBED=1 takes the composed path. MLXCEL_TRACE_MLA_STATS=1 prints absorbed_composed for every decode step and absorbed_fused=0, on DeepSeek V2-Lite and on Kimi-VL (deepseek_v3, absorbed unconditionally).

shape decided disagree, =1 vs =0 top-1 disagree ppl =0 / =1
decode width 1 behind 1024 0 of 208 6 of 512 14.6489 / 14.6297
decode width 1 behind 4096 0 of 105 3 of 256 12.9619 / 12.9590

Every disagreement sits where the reference's own top two were within 0.25 logits, which is the rounding class rather than a behaviour change. The unset default on the measured commit still resolved to decompressed and traced byte-identical to =0, with only decompressed steps, which is what made the switch a change to make rather than one already made.

Decode throughput (section 4)

mlxcel-bench-decode, deepseek-v2-lite-chat-4bit-mlx, --ignore-eos, tg128, ABBA order with 60 s idle between runs.

prompt =0 =1 (composed)
512 (five runs per arm) 42.72 (41.62 to 43.57) 41.28 (36.94 to 41.78) -3.4%
2048 35.28 (35.87, 34.68) 41.41 (40.88, 41.93) +17%
16384 22.04 (22.05, 22.02) 36.49 (36.19, 36.78) +65%

The 512 cell was measured twice: an initial pair read +5.6% with a 14% spread in the decompressed arm, so it was repeated five times per arm, which puts the composed path 3.4% behind. That is inside the "within a few percent" band the Metal default was switched under (-1.7% there, with the fused kernel), and the 17% and 65% gains at longer prompts plus a 3.7 GB smaller peak behind 16K make it a trade worth taking on this backend too.

Prefill peak memory (section 5)

GLM-4.7-Flash 2048-token chunks go from 25.26 to 20.53 GB, a 28K single pass that fails to allocate 62.72 GB on the pre-#3114 tree now fits in 21.13 GB, and generate prefill drops from 919.2 s to 306.9 s (3.0x). gpt-oss-20b stays between 26.21 and 26.43 GB on both trees and its single pass fails on both (100.35 GB requested), as designed.

Sizing

kv_arch already reads mla::absorbed_enabled(), so no sizing code changes: DeepSeek V2-Lite at 32K now estimates 972.0 MiB of KV instead of 8.44 GiB, which is what mlxcel inspect prints on a ROCm build of this branch. src/execution/kv_arch.rs only gains the ROCm reference in its module comment.

Not covered here

Llama 4 Scout (about 61 GB of weights) does not fit this host's 30 GiB and is not recorded; the CUDA record covers #3117 and #3126 instead.

Test plan

  • make verify-rocm-held ROCM_JOBS="-j 3": every prerequisite passed (verify-env-var-docs, verify-fmt, workspace clippy with -D warnings, the ROCm smoke build/link/generate) and the workspace test run finished with 192 test binaries, 15,954 passed, 0 failed and 524 ignored
  • cargo test -p mlxcel-core --features rocm --lib mla:: (61 passed, including the_default_absorbs_where_the_fused_kernel_runs_and_on_cuda_and_rocm)
  • Default resolution checked with the branch binary: unset absorbs (972.0 MiB of KV, 12.12 GiB total), =0 keeps the decompressed layout (8.44 GiB of KV, 21.10 GiB total)
  • Every GPU run under scripts/rocm_gpu_guard.sh --hold, no build during a throughput run
  • Results recorded under docs/benchmark_results/ with the measured commit, the host, and per-run CSV rows

The gate outranks the host's memory only with the job cap lowered: its default of 6 jobs ran the 30 GiB machine out of memory while building the test binaries, and the same gate passed at 3.

Changes during review

81a588d5 records the results document's provenance to the standard the sibling CUDA record uses (a commit column in decode.csv and trace.csv, the MLX pin and the ROCm overlay commit in Setup), replaces the gate section's placeholder with what was actually run, and qualifies two overstatements: the composed path at 512 tokens is within a few percent (ROCm is 3.4% behind, not level), and gpt-oss is a 26.21 to 26.43 GB range rather than a single figure. 080edf70 then records the completed gate, after the run was repeated at the lower job cap.

Review also found a pre-existing gap that this PR does not fix: the DeepSeek V2 KV estimate models only an int8 decline, while the runtime declines every non-FP16 cache mode, so a turbo-quant cache can make the estimate undercount (the dangerous direction). Making absorption the default on ROCm makes that path reachable by default, so it is filed as #3153.

Refs #3133

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.
@inureyes inureyes added type:performance Performance improvements priority:medium Medium priority area:benchmark Benchmark harness and performance measurement (bench_*.sh, /update-benchmarks) platform:linux Linux (CUDA / packaging) specific labels Nov 18, 2026
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
@inureyes

Copy link
Copy Markdown
Member Author

CUDA check (GB10, sm_121, head 81a588d5)

The change only adds Rocm to default_absorbs_on, so the CUDA default should be exactly what #3149 shipped. Checked on a --features cuda build of this branch:

  • mla:: unit tests (61) and the kv_arch, deepseek_v2, kv_cache_advisor, snapshot_sizing and memory_estimate lib tests (154) pass with --test-threads=1.
  • mlxcel inspect -m deepseek-v2-lite-chat-4bit-mlx --max-tokens 32768: unset and =1 give 972.0 MiB of KV (11.12 GiB total), =0 gives 8.44 GiB (20.10 GiB total), the same figures as update(mla): absorb DeepSeek V2 by default on CUDA, add GB10 results #3149.
  • mlxcel generate with the unset default decodes coherent greedy text, with the FP16 cache and with --cache-type-v turbo4-asym.

With --cache-type-v turbo4-asym, inspect still reports 972.0 MiB, so the #3153 undercount reproduces on CUDA as well. That fix stays in #3153.

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
@inureyes
inureyes merged commit 44c26ce into main Nov 18, 2026
32 checks passed
@inureyes
inureyes deleted the update/issue-3133-rocm-absorbed-default branch November 18, 2026 17:42
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 type:performance Performance improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant