Skip to content

fix(mla): refresh gfx950 MLA HSACO for large page_id KV addressing - #4452

Merged
shengnxu merged 5 commits into
mainfrom
chefang_mla_fix_global
Aug 5, 2026
Merged

shengnxu merged 5 commits into
mainfrom
chefang_mla_fix_global

Conversation

@fangche123

@fangche123 fangche123 commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Rebuild mi350 MLA decode kernels with 64-bit paged KV byte offsets and add test_mla_ltx co_fix regression for boundary/page16m validation on gfx950.

Motivation

On gfx950 (MI350), MLA decode kernels used 32-bit truncated math when computing paged KV byte offsets from page_id. When the KV pool exceeds 4GB or page_id is large (e.g. 16M), the kernel reads wrong KV data and fails numerical checks.

This PR refreshes the affected gfx950 MLA .co binaries rebuilt from mi350 sp3 with 64-bit page offset fix (v_mul_lo_u32 / v_mul_hi_u32), extending coverage beyond the earlier qh16 fp8 q1 PS fix (#4341).

Technical Details

Test Plan

python3 op_tests/test_mla_ltx.py --preset qh64_fp8_q1 --suites boundary page16m --ctx 4 --ps ps --lse off
python3 op_tests/test_mla_ltx.py --preset qh16_fp8_q4 --suites boundary page16m --ctx 4 --ps ps --lse off
python3 op_tests/test_mla_ltx.py --page-base 19000000 --ctx 4 --preset qh64_fp8_q1 --ps ps --lse off

Test Result

image

n16,4 change buffer_load to global_load

image

configs = number of test configurations in that group: 3 batch sizes (32 / 64 / 128) × 5 context lengths (1024 / 5000 / 8192 / 16384 / 32768) = 15 per group, 105 in total. All speedup and delta figures are aggregated over those configurations.
image

Submission Checklist

Rebuild mi350 MLA decode kernels with 64-bit paged KV byte offsets and add
test_mla_ltx co_fix regression for boundary/page16m validation on gfx950.
@fangche123
fangche123 requested review from a team and Copilot July 30, 2026 06:41
@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 4452 --add-label <label>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the MLA long-context/large-page-id decode test harness to exercise rebuilt gfx950 MLA .co variants (including CPRR/override routing) and to validate boundary/page16m addressing with a safe default ctx that meets kernel requirements.

Changes:

  • Add a --preset-group co_fix sweep (plus --list-co-fix and aggregate report output) to regression-test a curated matrix of rebuilt .co files.
  • Update point-case generation and single-point runs to default ctx to max(4, decode_qlen) instead of 1, avoiding invalid ctx < decode_qlen configurations.
  • Extend .co selection and asm invocation to support CPRR/CP metadata (cprr, g_kv_indptr, cp_world_size, cp_rank) and optional .co overrides / ref skipping for specific runs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread op_tests/test_mla_ltx.py Resolved
@fangche123
fangche123 force-pushed the chefang_mla_fix_global branch from c77b90a to ea12f2c Compare July 30, 2026 06:59
@zufayu
zufayu requested a review from amd-ruitang3 July 31, 2026 01:18
@shengnxu
shengnxu merged commit a63ede7 into main Aug 5, 2026
42 checks passed
@shengnxu
shengnxu deleted the chefang_mla_fix_global branch August 5, 2026 06:00
xiaohuguo2023 added a commit to xiaohuguo2023/InferenceX that referenced this pull request Aug 12, 2026
…5a env build to skill.md

Documents the aiter side of the ASM-MLA env, which was missing:
  * §0a aiter change recipe: cherry-pick ROCm/aiter#4452 (64-bit paged-KV byte
    offsets — asm_mla.cu s_MQA fix + 26 gfx950 MLA .co) onto the K3 base build
    (00cbe979f -> 6fc5733b7); .co load by path, asm_mla.cu needs an aiter rebuild;
    /aiter-latest bind-mount; optional tuned-GEMM config install.
  * §0b aiperf 818c3a5a venv build (the pinned submodule that allows
    --trace-idle-gap-cap-seconds; be758d62 rejects it).
Also corrected §2 sweep to build_replay_cmd's real flags and pointed AIPERF at the
818c3a5a venv.

Signed-off-by: Xiaohu Guo <[email protected]>
xiaohuguo2023 added a commit to xiaohuguo2023/vllm that referenced this pull request Aug 26, 2026
…Cm/aiter#4452 for

>4 GB paged-KV addressing at long context which is included in aiter main since a63ede7.

Signed-off-by: Xiaohu Guo <[email protected]>
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.

3 participants