Skip to content

CUDA: increase D256 FlashAttention staging for two-column RDNA tiles - #31761

Draft
ravel7524 wants to merge 1 commit into
ggml-org:masterfrom
ravel7524:hip-fattn-tile-d256-nbatchk128
Draft

ravel7524 wants to merge 1 commit into
ggml-org:masterfrom
ravel7524:hip-fattn-tile-d256-nbatchk128

Conversation

@ravel7524

@ravel7524 ravel7524 commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Overview

This PR increases nbatch_K from 64 to 128 and lowers the launch-bounds occupancy hint from 8 to 6 for D256 two-column HIP/RDNA FlashAttention, halving K/V staging passes.

Additional information

W7800 (gfx1100), ROCm 10.1. Candidate 555cab640 vs. master 10d4846a5, with alternating runs.

Measurement Result vs. master Runs per build
Qwen3.8-27B Q8_0, non-speculative decode at 131,072-token context +13.51% throughput 2
TG128 at KV depth 0 +0.04% throughput 4
Single-token attention, 131k/184k KV, GQA 2 and 6 0.700× time (geomean) 3

At GQA 6 and KV 2k/8k/32k, single-token attention takes 0.844× time (geomean), worst case 0.914×. The tuning is shared across RDNA; runtime evidence covers W7800.

Testing

Both added F16 tests (GQA 2/6, one query, 4,096 KV) passed against the stock CPU reference in a filtered run. Separately, 175 D256 cases passed on both builds using a local CPU reference accumulating V in FP32 instead of F16; that reference change is not included.

KV repartitioning changes accumulation order and long-context greedy output.

PPL/KLD checks use -ub 1. Controls below compare master at ubatch 512 versus 1.

Model / coverage PPL (master → candidate) KLD / control Same top-1 / control
Qwen3.8-27B Q8_0, 6 × 2,048 tokens 5.3487 → 5.3483 0.000342 / 0.000448 99.20% / 99.01%
Gemma-3-4B Q8_0, GQA 2, 2 × 8,192 tokens 10.7437 → 10.7120 0.00220 / 0.00247 98.63% / 98.61%

For Qwen3.8-27B Q8_0, teacher-forced wikitext-2 NLL over 16,384 positions after a 65,536-token prompt gave a mean difference (candidate − master) of −0.00055 nats/token; lower is better; 95% CI: −0.00095 to −0.00016.

PR #31234 touches the same configuration function.

Requirements

  • Yes, I have read and agree with the contributing guidelines
  • AI usage disclosure: YES, AI was used to write the Code and test the changes. I understand all the code and can explain all the changes.

@github-actions github-actions Bot added testing Everything test related ggml changes relating to the ggml tensor library for machine learning CUDA Related to the CUDA backend labels Nov 5, 2026
abeloin added a commit to abeloin/llama.cpp-mix that referenced this pull request Nov 24, 2026
…8 jetons, fusions delta-net / porte d'expert partagé, IQ2/IQ3, FA indépendante des rangées masquées (rafasmour/llama.cpp-RDNA3, master @ 91c1855, commits 95bcd0c..e3a7e9c)

Commits cherry-pickés (-x, auteur d'origine) sur import/rdna3-sel-r3 puis
merge --no-ff. cefeb9b (ggml-org#43) vide ici (changement déjà présent). Ports
de PR amont ouvertes : 0fffeee (ggml-org#61 ← ggml-org ggml-org#31746), 855e1bf (ggml-org#75
← ggml-org ggml-org#31761). 7a0f09e et e3a7e9c : tests/test-backend-ops.cpp
côté mix. ggml-org#108 écarté (dépend de ggml_cuda_mmvq_q8_1_args, plus loin dans
la pile).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01QBjnvFeJ4P7Jp71oC6pzWf

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CUDA Related to the CUDA backend ggml changes relating to the ggml tensor library for machine learning testing Everything test related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant