Repository navigation
[AMD] Fix AITER unified decode page table for page size one - #40410
vorapolsiloai wants to merge 2 commits into
Conversation
7df1038 to
42ff68a
Compare
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
42ff68a to
ee754ea
Compare
This comment has been minimized.
This comment has been minimized.
…ph test The test builds AiterAttnBackend without __init__, and _apply_cuda_graph_metadata now reads decode_uses_page_table on the decode path, so the test raised AttributeError. Set it as __init__ does for unified attention.
This comment has been minimized.
This comment has been minimized.
|
Required checks failed on 93079c4; this PR cannot be merged until they pass. PR title (run)
|
Motivation
With AITER unified attention, page size 1 and CUDA graphs, decode reads a page table that graph replay never filled, so the output is wrong.
_apply_cuda_graph_metadata()skippedpage_size == 1; eager decode builds the table for every page size.MI355X: the new test fails on
main(all 6 checked page-table entries differ) and passes with it; Qwen3.8-27B MXFP4 GPQA 48.48%, same as the BF16-query reference. Not claimed: any performance change.Modifications
cuda_graph_page_table; convert with_transform_table_1_to_realonly whenpage_size > 1.test_cuda_graph_decode_copies_page_size_one_table.Motivation and modifications in full
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.
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
Accuracy detail
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
Correctness fix, one device-to-device copy per graph replay; not meant to change performance.
Checklist
CI States
Latest PR Test (Base): ❌ Run #41333427316
Latest PR Test (Extra): ❌ Run #41333427253
Latest PR Test (AMD ROCm 10): ❌ Run #41333427179
Tip
Base CI only covers the core cases, and its workload may not exercise your change. Use
/rerun-testto run the tests your change touches, or copy this prompt for an agent: