Repository navigation
[AMD] Fix AITER unified decode page table for page size one - #40410
Open
vorapolsiloai wants to merge 1 commit into
Open
vorapolsiloai wants to merge 1 commit into
vorapolsiloai wants to merge 1 commit into
Conversation
8 of 9 tasks
vorapolsiloai
marked this pull request as ready for review
September 21, 2026 10:16
vorapolsiloai
requested review from
Fridge003,
HaiShaw,
Qiaolin-Yu,
hebiao064,
ispobock and
merrymercy
as code owners
September 21, 2026 10:16
Unified decode reuses a capture-stable page table during CUDA graph replay, but the page-size-one path never populated it. Copy the request-to-token indices into that table just as the paged paths do. - Populate generic unified-decode metadata for page size one - Add a regression that fails with the zero-initialized graph table
vorapolsiloai
force-pushed
the
fix/aiter-page1-cuda-graph-table
branch
from
October 8, 2026 19:59
7df1038 to
42ff68a
Compare
3 of 5 tasks
2 tasks done
This branch has not been deployed
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
With AITER unified attention (
SGLANG_USE_AITER_UNIFIED_ATTN=1), page size 1 (the default), and CUDA graphs enabled, decode reads a page table that was never filled in, so the output is wrong.Before each CUDA graph replay,
AiterAttnBackend._apply_cuda_graph_metadata()copies the request-to-token indices into the persistentcuda_graph_page_table. It did this for the sliding-window KV pool and forpage_size > 1. It skippedpage_size == 1, so the replay read the table's initial or stale contents. Eager decode (init_forward_metadata) builds this table for every page size, so only graph replay is affected. Query and KV dtypes do not matter.I found this while validating #39998. The bug is in the existing decode metadata path, so the fix is a separate PR.
Modifications
cuda_graph_page_table. Convert them with_transform_table_1_to_realonly whenpage_size > 1. This matches the eager path.test_cuda_graph_decode_copies_page_size_one_table. It calls_apply_cuda_graph_metadata()withpage_size=1and checks that the graph page table holds thereq_to_tokenrows.Accuracy Tests
test/registered/attention/test_aiter_fp8_q_unified_attention.pypasses on MI355X.test_cuda_graph_decode_copies_page_size_one_tableand all 4 unit tests intest/registered/attention/test_aiter_fp8_q_unified_attention.pypass cleanly.Speed Tests and Profiling
This is a correctness fix. It adds one device-to-device copy per graph replay, the same copy that page sizes above 1 already do. It is not meant to change performance.
Checklist
CI States
Latest PR Test (Base): ❌ Run #37836097801
Latest PR Test (Extra): ❌ Run #37836097439
Latest PR Test (AMD ROCm 10): ❌ Run #37836097712