Skip to content

ggml-cuda: smaller MMQ tile for RDNA3/RDNA4 spec-decode batches (+6–8%)#18

Merged
davide221 merged 1 commit into
Luce-Org:luce-dflashfrom
GeometricAGI:feat/rdna-mmq-tile-override
Jun 25, 2026
Merged

ggml-cuda: smaller MMQ tile for RDNA3/RDNA4 spec-decode batches (+6–8%)#18
davide221 merged 1 commit into
Luce-Org:luce-dflashfrom
GeometricAGI:feat/rdna-mmq-tile-override

Conversation

@DeanoC

@DeanoC DeanoC commented Jun 23, 2026

Copy link
Copy Markdown

Smaller MMQ tile for consumer RDNA3/RDNA4 during DFlash speculative decode.

Why

DFlash issues many small mul_mat_q verify batches — ne[1] ≈ ddtree_budget+1, ~23 at the default --ddtree-budget=22. The stock tile (mmq_x_max=128, mmq_y=128, nwarps=8) is tuned for large GEMMs and under-occupies at that batch. A 48×64 tile with 4 warps runs the same q4_K matmul (~35% of decode time) faster, with bit-identical output (acceptance length unchanged).

Numbers (Qwen3.6-27B Q4_K_M, --ddtree-budget=22, 10-prompt HumanEval mean, n_gen=256)

GPU stock this PR gain
gfx1100 (RX 7900 XTX) 56.78 60.18 +6.0%
gfx1201 (R9700) 54.65 59.37 +8.3%

(mmq_y, nwarps) is the active lever (the nwarps*16 == mmq_y static_assert makes 64/4 the valid optimum); mmq_x_max in 32–64 is within noise. This is the 48/64/4 shape originally proposed upstream for gfx1151 in ggml-org#21344, here measured to help gfx1100/gfx1201 at budget=22 (where the earlier gfx1100-only testing at budget=8 saw only ~+2%).

Scope / safety

  • Gated on RDNA3_0 (gfx1100) + RDNA4 (gfx1201) only. gfx1151/RDNA3.5 is deliberately left on the default — not benchmarked here.
  • Behind LUCEBOX_RDNA_MMQ_TILE_OVERRIDE (default on); set =0 to revert.
  • Output is bit-identical vs stock on both GPUs (AL/accept% unchanged), so no quality risk.

Draft — happy to flip the default to opt-in if you'd prefer. Benchmarks measured on the two GPUs above; developed with AI assistance (Claude Code).

DFlash verify batches are small (ne[1] ~= ddtree_budget+1, ~23 at the
default budget=22); the stock 128x128 / 8-warp MMQ tile under-occupies on
consumer RDNA. A 48x64 / 4-warp tile is faster there, output bit-identical.

Qwen3.6-27B Q4_K_M, --ddtree-budget=22:
  gfx1100 (RX 7900 XTX): 56.78 -> 60.18 tok/s (+6.0%)
  gfx1201 (R9700):       54.65 -> 59.37 tok/s (+8.3%)

Gated on RDNA3_0 + RDNA4; gfx1151/RDNA3.5 left on the default (not
benchmarked). Opt out with -DLUCEBOX_RDNA_MMQ_TILE_OVERRIDE=0.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@DeanoC DeanoC force-pushed the feat/rdna-mmq-tile-override branch from c5c9989 to 0154551 Compare June 25, 2026 05:41
DeanoC added a commit to GeometricAGI/lucebox-hub that referenced this pull request Jun 25, 2026
Bumps server/deps/llama.cpp (luce-dflash) to pick up the smaller 48x64/4-warp
MMQ tile for DFlash spec-decode verify batches on consumer RDNA. Output is
bit-identical; decode at --ddtree-budget=22, Qwen3.6-27B Q4_K_M:
  gfx1201 (R9700):       54.65 -> 59.37 tok/s (+8.3%)
  gfx1100 (RX 7900 XTX): 56.78 -> 60.18 tok/s (+6.0%)

Depends on Luce-Org/lucebox-ggml#18; the submodule SHA should be
repointed to the luce-dflash merge commit before this lands.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@davide221

Copy link
Copy Markdown

lgtm

@davide221 davide221 merged commit ae0e235 into Luce-Org:luce-dflash Jun 25, 2026
9 of 47 checks passed
davide221 pushed a commit to Luce-Org/lucebox-hub that referenced this pull request Jun 25, 2026
Bumps server/deps/llama.cpp (luce-dflash) to pick up the smaller 48x64/4-warp
MMQ tile for DFlash spec-decode verify batches on consumer RDNA. Output is
bit-identical; decode at --ddtree-budget=22, Qwen3.6-27B Q4_K_M:
  gfx1201 (R9700):       54.65 -> 59.37 tok/s (+8.3%)
  gfx1100 (RX 7900 XTX): 56.78 -> 60.18 tok/s (+6.0%)

Depends on Luce-Org/lucebox-ggml#18; the submodule SHA should be
repointed to the luce-dflash merge commit before this lands.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants