Repository navigation
update mla qh16 to support global load kv - #4156
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
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.
Contributor
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
|
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]>
shengnxu
approved these changes
Jul 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
Submission Checklist