Repository navigation
[Bugfix][PA] Fix D192 query staging and 64-bit cache offsets - #1064
Merged
coderfeli merged 2 commits intoAug 27, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes tile paged attention for D192 queries and 64-bit physical KV-cache offsets.
Changes:
- Completes D192 query staging with three 64-bit loads.
- Promotes K/V page-offset arithmetic to 64-bit.
- Adds D192 and large-offset regression tests.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Summary |
|---|---|
tests/kernels/test_pa_decode_tile.py |
Adds focused regressions. Two moderate findings remain (2 votes each): initialize accessed pages with finite values, and make the test K-sensitive with multiple valid tokens. |
kernels/attention/pa_decode_tile.py |
Updates D192 query loading and K/V address arithmetic. |
Suppressed comments (1)
tests/kernels/test_pa_decode_tile.py:23
- The production kernel selects the OCP FP8 path for every
gfx95*target (pa_decode_tile.py:77-79), and existing tests use the same predicate. WithARCHnormalized togfx951/gfx955, both new tests are skipped by the exact-match decorators at lines 72 and 131; if those decorators are broadened without changing line 23, the test also selects the wrong FNUZ dtype. Use a consistentgfx95*predicate for support checks and FP8 selection so this regression runs on all supported CDNA4 variants.
ARCH = str(get_rocm_arch()).split(":", 1)[0]
SUPPORTED_ARCHS = ("gfx942", "gfx950")
FP8_DTYPE = torch.float8_e4m3fn if ARCH == "gfx950" else torch.float8_e4m3fnuz
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
1 task done
sammysun0711
force-pushed
the
upstream/pa-64bit-cache-offsets
branch
2 times, most recently
from
August 25, 2026 01:51
9087a4e to
3b619a1
Compare
Signed-off-by: Xiake Sun <xiake.sun@amd.com>
sammysun0711
force-pushed
the
upstream/pa-64bit-cache-offsets
branch
from
August 25, 2026 05:47
3b619a1 to
fbe0115
Compare
Signed-off-by: Xiake Sun <xiake.sun@amd.com>
fsx950223
approved these changes
Aug 27, 2026
1 task done
1 task done
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
Fix tile paged attention for D192 query staging and serving-sized physical KV cache offsets.
Technical Details
For model w/ head dimension 192 (e.g. MiMO-V2.5-Pro), each lane stages 12 BF16 query elements.
The previous load selection staged only eight. Physical page IDs were also multiplied in 32-bit arithmetic, allowing cache offsets to wrap beyond 2 GiB.
Correctness-only change. Existing schedules are unchanged; D192 now loads the complete query chunk.
Test Plan
pytest -q tests/kernels/test_pa.py -k 'fp8_head_dim_192_matches_torch or fp8_cache_offset_above_2gib' -sTest Result
Submission Checklist