mla nps fp8 mode get_meta_param avoid kv_tail_len < max_seqlen_q and fix nhead=128 reduce mgc#2319
Open
minmengdie wants to merge 3 commits intomainfrom
Open
mla nps fp8 mode get_meta_param avoid kv_tail_len < max_seqlen_q and fix nhead=128 reduce mgc#2319minmengdie wants to merge 3 commits intomainfrom
minmengdie wants to merge 3 commits intomainfrom
Conversation
Contributor
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates MLA decode heuristics for FP8/persistent-split (PS) mode to better bound num_kv_splits when KV tail is short relative to max_seqlen_q, and tweaks decode reduction granularity (mgc) for the nhead==128 FP8 case. It also adjusts the MLA op test to exercise an additional head configuration and a padded kv_indices layout.
Changes:
- Add an FP8-specific upper bound on
num_kv_splitsinget_meta_parambased ontotal_kv/bs - max_seqlen_q. - Change
mgcselection to usemgc=32fornhead==128with FP8 KV buffer. - Update
op_tests/test_mla.pyto (a) padkv_indiceslength and (b) allow(128, 4)in CLI--nheadchoices.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
aiter/mla.py |
Adjusts FP8 split-count meta-parameter logic and mgc heuristic used by MLA decode stage2 reduction. |
op_tests/test_mla.py |
Modifies MLA test inputs (padded kv_indices) and expands allowed --nhead choices. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
011c7f7 to
e212b0a
Compare
502b9d0 to
9deb64b
Compare
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
mla nps fp8 mode get_meta_param avoid kv_tail_len < max_seqlen_q
Technical Details
Test Plan
python3 op_tests/test_mla.py -b 1 --nhead 128,4 -d fp8 -kvd fp8 -splits 16 -c $(seq 4 200 | tr '\n' ' ')
rocm/atom:nightly_202601190317
用这个docker搭之后, cd /app ,里面就有aiter和atom代码
cd ATOM
fetch最新之后
git checkout zlr/mtp_dp
pip install .
MORI_SHMEM_MODE=ISOLATION python3 -m atom.examples.simple_inference --model /data/DeepSeek-R1-0528/ -tp 8 --port 5678 --kv_cache_dtype fp8 --torch-profiler-dir ./log --method mtp --num-speculative-tokens 3 --block-size 10000 --gpu-memory-utilization 0.41 --enable-dp-attention --enable-expert-parallel
Test Result
Submission Checklist