Repository navigation
[CUDA] Fix PagedAttention build without FlashAttention - #32327
Merged
Merged
Conversation
flash_block_size_ok and max_kv_len_lower_bound are only read inside #if USE_FLASH_ATTENTION, so a --disable_flash_attention build fails on -Werror=unused-variable and -Werror=unused-but-set-variable.
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes CUDA PagedAttention compilation when FlashAttention is disabled.
Changes:
- Guards FlashAttention-only eligibility state.
- Explicitly marks the split-KV lower bound unused without FlashAttention.
- Preserves runtime behavior.
No actionable findings.
π‘ Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Nenad Banfic (nenad1002)
approved these changes
Sep 3, 2026
Tianlei Wu (tianleiwu)
deleted the
tlwu/paged_attention_no_flash_werror
branch
September 3, 2026 20:12
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
Fix the CUDA PagedAttention build when FlashAttention is disabled. Two values used only by the FlashAttention path otherwise trigger
-Werror=unused-variableand-Werror=unused-but-set-variable.Summary of Changes
flash_block_size_okonly whenUSE_FLASH_ATTENTIONis enabled.max_kv_len_lower_boundunused in builds without FlashAttention.Testing
onnxruntime_providers_cudawithonnxruntime_USE_FLASH_ATTENTION=OFFand-Werror.paged_attention.ccdirectly with the same CUDA Debug configuration.Checklist