Skip to content

[CUDA] Address cuDNN paged SDPA review feedback - #32624

Merged
Tianlei Wu (tianleiwu) merged 3 commits into
microsoft:mainfrom
tianleiwu:tlwu/20260915/cudnn-paged-review-fixes-main
Oct 2, 2026
Merged

Tianlei Wu (tianleiwu) merged 3 commits into
microsoft:mainfrom
tianleiwu:tlwu/20260915/cudnn-paged-review-fixes-main

Conversation

@tianleiwu

Copy link
Copy Markdown
Contributor

Description

Follow-up to #32493 that addresses the remaining review feedback after the original PR was merged.

  • Resolve the default attention scale once for the cuDNN paged path and carry the exact value from the buildability probe through dispatch, keeping the byte-keyed graph cache stable during CUDA graph capture.
  • Clear the stale FlashAttention selection when a late XQA-to-cuDNN retry succeeds.
  • Remove the unused max_sequence_length_kv shape-gate argument, document the unbounded thread-local graph-cache growth, and include cuDNN in backend diagnostics.
  • Exercise default-scale cache-key canonicalization with head_size=96 in the cuDNN paged tests.

Testing

  • clang-format --dry-run --Werror on all changed files
  • git diff --check
  • Direct compilation of paged_attention.cc, paged_attention_impl.cu, and cudnn_flash_attention.cc in the CUDA 13.0 / cuDNN 9.23 H200 build
  • Standalone compilation of paged_attention_op_test.cc with the CUDA provider flags

The available CUDA build was configured with onnxruntime_BUILD_UNIT_TESTS=OFF, so the focused PagedAttention.Cuda_CudnnPaged* runtime tests could not be executed locally.

Copilot AI balanced review requested due to automatic review settings September 16, 2026 00:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟑 Changes recommended

The cache-key and late XQA fallback fixes lack regression tests that would fail if those behaviors regress.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Refines CUDA PagedAttention’s cuDNN paged-SDPA dispatch and cache behavior.

Changes:

  • Reuses one canonical attention scale for probing and execution.
  • Corrects XQA-to-cuDNN fallback state and diagnostics.
  • Updates cuDNN tests to use head size 96.
File summaries
File Description
attention_data.h Carries the resolved cuDNN scale.
cudnn_flash_attention.cc Simplifies eligibility and documents cache growth.
cudnn_flash_attention.h Updates the paged-support API.
paged_attention.cc Canonicalizes scale and corrects backend selection.
paged_attention_impl.cu Uses the stored canonical scale.
paged_attention_op_test.cc Changes cuDNN test shape to head size 96.
Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 2
  • Review effort level: Balanced (auto)

Note

Copilot is running an experiment and ran this review at Balanced.


πŸ’‘ Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@tianleiwu
Tianlei Wu (tianleiwu) force-pushed the tlwu/20260915/cudnn-paged-review-fixes-main branch from b61cdf8 to 512fb9a Compare October 2, 2026 04:17
@tianleiwu
Tianlei Wu (tianleiwu) enabled auto-merge (squash) October 2, 2026 04:17
@tianleiwu
Tianlei Wu (tianleiwu) merged commit e721a97 into microsoft:main Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants