Use CUDART_VERSION reduction compatibility in GQA attention#28296
Merged
Use CUDART_VERSION reduction compatibility in GQA attention#28296
Conversation
…s in gqa_unfused_attention.cu Agent-Logs-Url: https://github.com/microsoft/onnxruntime/sessions/f48f1b22-0b97-4e82-a3e0-6c98fcd0317c Co-authored-by: tianleiwu <30328909+tianleiwu@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/onnxruntime/sessions/748706c1-e89d-4bbb-bb9f-dc129f909727 Co-authored-by: tianleiwu <30328909+tianleiwu@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
tianleiwu
April 30, 2026 16:20
View session
tianleiwu
approved these changes
Apr 30, 2026
sanaa-hamel-microsoft
approved these changes
Apr 30, 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.
Description
Update
/home/runner/work/onnxruntime/onnxruntime/onnxruntime/contrib_ops/cuda/bert/gqa_unfused_attention.cuto match the existing CUDA attention compatibility pattern used elsewhere in the repo.CUDART_VERSION >= 12090guards.::cuda::maximum()and::cuda::std::plus()for CUDA 12.9+.cub::Max()andcub::Sum()as the fallback for older toolkits.Motivation and Context
This keeps the GQA unfused attention kernel consistent with nearby CUDA attention code and avoids the CUDA 12.9+ deprecation issue around the old CUB reduction functors while preserving compatibility with older CUDA toolkits.
Validation:
git diff --check