[Attention] Expose paged MQA SplitKV override - #4775
Draft
AMD-yanfeiwang wants to merge 2 commits into
Draft
Conversation
Contributor
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
|
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.
Summary
SplitKVoverride ondeepgemm_fp8_paged_mqa_logitsVarCtxScheduleMotivation
The paged MQA kernel already accepts a runtime split count, but the public wrapper always derives it from
TotalCuCount,TileQCount, andWavePerEU. This prevents callers from tuning the split independently for production shapes.On MI355X (
gfx950), a diagnostic three-process sweep for the DSV4 shaperows=6144,width=33280,ChunkK=256foundSplitKV=2consistently faster than the current automatic value of 10:Aggregate producer gain was 1.382%; all tested split values passed bitwise correctness probes. This PR exposes the mechanism only. It intentionally does not hard-code a shape policy from a single diagnostic shape.
Compatibility
SplitKV=Noneexecutes the exact previous formula, so existing callers and launch behavior are unchanged. The underlying Triton/Gluon kernel already accepts a dynamic split count; no kernel ABI or cache-key change is needed.Validation
13 passedintest_pa_mqa_logits_split_kv.pySplitKV=2py_compile, andgit diff --checkpass