Skip to content

[FlyDSL] Port qk_norm_rope_quant and compress_attn to gfx1250 (wave32) - #3804

Merged
valarLip merged 6 commits into
ROCm:mainfrom
jli-melchior:jli/gfx1250/qk_norm_rope_quant_gfx1250
Jun 19, 2026
Merged

valarLip merged 6 commits into
ROCm:mainfrom
jli-melchior:jli/gfx1250/qk_norm_rope_quant_gfx1250

Conversation

@jli-melchior

@jli-melchior jli-melchior commented Jun 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Port compress_attn (standard + HCA variants) FlyDSL kernels to gfx1250 (wave32), adapting MFMA→WMMA, disabling preshuffle, and adjusting for RDNA4's 512 VGPRs/wave
  • Port qk_norm_rope_quant kernel to gfx1250 (wave32) with similar wave32/WMMA adaptations
  • Add gfx1250 compress_attn test suite
  • Apply ruff format and lint fixes

Test plan

  • Run op_tests/test_flydsl_compress_attn_gfx1250.py on gfx1250 hardware
  • Run op_tests/test_flydsl_qk_norm_rope_quant.py to verify qk_norm_rope_quant correctness on gfx1250
  • Confirm no regression on existing gfx942 kernels

@jli-melchior
jli-melchior requested a review from a team June 18, 2026 15:22
@github-actions

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

  • ✅ Pre-checks (submodule verification, code formatting)
  • ✅ Aiter op tests (gfx942 + gfx950)
  • ✅ Triton tests on MI35X (only when aiter/ops/triton/** or related paths are changed)

Extended tests (opt-in via labels):

Label Tests
ci:triton-300x Run an additional Triton test job on MI300X in PRs; main branch always runs both MI35X and MI300X
ci:sglang SGLang integration tests: DeepSeek-R1-MXFP4 accuracy, Qwen 3.5 accuracy
ci:atom ATOM benchmark: DeepSeek-R1-0528, GPT-OSS-120B
ci:atom_full ATOM accuracy suite for PR and main models from ATOM models_accuracy.json
ci:vllm vLLM benchmark: GPT-OSS-120B, DeepSeek-R1-0528, Kimi-K2.5
ci:all All standard extended tests (excludes ci:atom_full)

Only add ci:atom_full for FlyDSL or Triton upgrades.
Add labels via the sidebar or gh pr edit 3804 --add-label <label>

@jli-melchior
jli-melchior force-pushed the jli/gfx1250/qk_norm_rope_quant_gfx1250 branch from aa72bf9 to 604fa8f Compare June 18, 2026 16:37
jli-melchior and others added 5 commits June 19, 2026 06:08
Port CSA and HCA fused_compress_attn kernels from wave64 (CDNA) to
wave32 (RDNA4/gfx1250). Key changes: BLOCK_THREADS=32, VEC=16 for
D=512, generalized load/store paths for >dwordx4, shuffle width=32,
FP8 linear layout (no preshuffle), and extract_strided_slice API fix.
Adds gfx1250 dispatch routing in existing entry points and a dedicated
test file.

Co-Authored-By: Claude Opus 4 <[email protected]>
Wave32 variant of the fused RMSNorm + GPT-J RoPE + FP8 quant kernel for
RDNA4/gfx1250. BLOCK_THREADS=32, VEC=16 for D=512, generalized load/store
paths (2x dwordx4 split for VEC>8), FP8 packing via VEC/4 dwords, and
butterfly shuffle width=32. BF16 mode verified on cmodel (H=16/64/128).

Co-Authored-By: Claude Opus 4 <[email protected]>
Co-Authored-By: Claude Opus 4 <[email protected]>
@jli-melchior
jli-melchior force-pushed the jli/gfx1250/qk_norm_rope_quant_gfx1250 branch from 8eb5d1f to befcf03 Compare June 19, 2026 06:19
Add the fused SWA cache-write path (batch_id_per_token as int32 per
upstream PR ROCm#3793) to the gfx1250 wave32 variant so the kernel can
scatter post-norm/rope KV rows into swa_kv[slot, pos%cache, :] in the
same launch, and fix the gfx1250 dispatch to forward the new params.

Co-Authored-By: Claude <[email protected]>
@jli-melchior
jli-melchior force-pushed the jli/gfx1250/qk_norm_rope_quant_gfx1250 branch from 2c4c435 to 3c589b7 Compare June 19, 2026 07:00
@valarLip
valarLip merged commit f38d8d9 into ROCm:main Jun 19, 2026
43 checks passed
@jli-melchior jli-melchior self-assigned this Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants