Improve PagedAttention dispatch diagnostics - #32099
Open
Baiju Meswani (baijumeswani) wants to merge 2 commits into
Open
Improve PagedAttention dispatch diagnostics#32099Baiju Meswani (baijumeswani) wants to merge 2 commits into
Baiju Meswani (baijumeswani) wants to merge 2 commits into
Conversation
Baiju Meswani (baijumeswani)
requested review from
Tianlei Wu (tianleiwu)
and
a lite review from Copilot
August 14, 2026 22:05
Copilot started reviewing on behalf of
Baiju Meswani (baijumeswani)
August 14, 2026 22:06
View session
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends ONNX Runtime’s CUDA attention kernel diagnostics for the PagedAttention contrib op, adding more dispatch-selection details to the opt-in debug output controlled by ORT_ENABLE_ATTENTION_KERNEL_DEBUG_INFO=1.
Changes:
- Add PagedAttention-specific debug fields (decode split count, GQA group size, and effective KV-length bound) to
AttentionKernelDebugInfoand itsPrint()output. - Populate the new debug fields from
PagedAttention::ComputeInternal()during backend selection. - Add a CUDA unit test that captures stdout and asserts the presence of the new debug markers.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| onnxruntime/test/contrib_ops/paged_attention_op_test.cc | Adds a CUDA test that captures attention debug output and checks for expected PagedAttention dispatch diagnostics. |
| onnxruntime/contrib_ops/cuda/bert/paged_attention.cc | Populates new debug-info fields for PagedAttention dispatch (including splits/GQA group size/effective KV bound). |
| onnxruntime/contrib_ops/cuda/bert/attention_kernel_options.h | Extends AttentionKernelDebugInfo with optional fields for additional dispatch diagnostics. |
| onnxruntime/contrib_ops/cuda/bert/attention_kernel_options.cc | Prints the new optional debug fields when present. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Tianlei Wu (tianleiwu)
left a comment
Contributor
There was a problem hiding this comment.
The decode-path fields follow the final fallback state and remain behind the opt-in debug flag. One supported backend is still misclassified; see the inline comment.
Tianlei Wu (tianleiwu)
approved these changes
Aug 15, 2026
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
Extend the existing CUDA attention debug output with PagedAttention-specific dispatch details.
When
ORT_ENABLE_ATTENTION_KERNEL_DEBUG_INFO=1,PagedAttentionnow reports:This makes it easier to verify that an intended optimized path is selected instead of silently falling back. The diagnostics are opt-in and do not change kernel selection or execution when disabled.