Skip to content

update mla qh16 to support global load kv - #4156

Merged
shengnxu merged 3 commits into
mainfrom
chefang_mla_global_load_a16w16_2
Jul 12, 2026
Merged

shengnxu merged 3 commits into
mainfrom
chefang_mla_global_load_a16w16_2

Conversation

@fangche123

@fangche123 fangche123 commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

The MLA qh64 bf16 decode kernel loads the CKV cache via buffer_load_dwordx4 ... lds:1, whose addressing is bounded by a 32-bit (4 GB) buffer resource. When the KV-cache pool or the per-request KV byte offset exceeds 4 GB, the buffer load wraps around and returns wrong results. This PR adds a full 64-bit global_load_lds path so MLA decode is correct for KV caches larger than 4 GB, and then optimizes that path so its overhead over the original buffer load is minimal.

Technical Details

Test Plan

python3 op_tests/test_mla_persistent.py -n 16,1 -d bf16 -kvd bf16 -b 2

Test Result

The buffer baseline is incorrect for KV caches > 4 GB (address wrap-around); the global-load path is correct in all cases.
The remaining overhead of correct >4 GB support is only ~4.4% at large ctx:
image
image

Submission Checklist

@fangche123
fangche123 requested review from a team and Copilot July 9, 2026 08:04

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.

Copilot wasn't able to review any files in this pull request.


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

@github-actions

github-actions Bot commented Jul 9, 2026

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 4156 --add-label <label>

@fangche123
fangche123 requested a review from shengnxu July 9, 2026 09:11
valarLip pushed a commit that referenced this pull request Jul 9, 2026
Adds a Claude Code skill at .claude/skills/review-pr/SKILL.md that
provides a structured, multi-section checklist for reviewing aiter PRs.

Covers: backbone tier safety (B1-B5), data-type consistency (D1-D8),
fake/abstract function correctness (D6-D7), correctness hazards (C1-C3),
performance flags (P1-P4), hardware-specific checks (HK1-HK11), FP8
correctness (F1-F6), multi-stream sync (G1), and a blind-spot self-check
before verdict generation (Step 7.5).

Tested against 4 real PRs: aiter #4156, #4157 and ATOM #1527, #1526.

Co-authored-by: root <[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