Repository navigation
Move kCutlassSafeMaskFilterValue outside USE_MEMORY_EFFICIENT_ATTENTION guard - #32588
Merged
Tianlei Wu (tianleiwu) merged 1 commit intoSep 14, 2026
Conversation
…ON guard Fixes microsoft#32566. The constant has no CUTLASS dependency and is referenced unconditionally by MaskedBiasSentinel() in core/providers/cuda/llm/attention.cc, so defining it inside the feature guard breaks the CUDA build when onnxruntime_USE_MEMORY_EFFICIENT_ATTENTION=OFF. Signed-off-by: SIDDARTHA REDDY <75976672+SIDDARTHAREDDY8@users.noreply.github.com>
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused change correctly resolves the missing declaration without altering enabled-MEA behavior.
Pull request overview
Moves the mask sentinel outside the MEA feature guard, fixing CUDA builds with MEA disabled.
Changes:
- Defines
kCutlassSafeMaskFilterValueunconditionally. - Documents its use by unfused attention.
File summaries
| File | Description |
|---|---|
onnxruntime/contrib_ops/cuda/bert/cutlass_fmha/memory_efficient_attention.h |
Makes the shared sentinel available when MEA is disabled. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
Author
|
@microsoft-github-policy-service agree |
Tianlei Wu (tianleiwu)
approved these changes
Sep 14, 2026
Tianlei Wu (tianleiwu)
enabled auto-merge (squash)
September 14, 2026 18:34
Tianlei Wu (tianleiwu)
merged commit Sep 14, 2026
bf8b4f1
into
microsoft:main
89 of 90 checks passed
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
Moves the
kCutlassSafeMaskFilterValueconstexpr definition (with its explanatory comment) outside the#if USE_MEMORY_EFFICIENT_ATTENTIONguard inonnxruntime/contrib_ops/cuda/bert/cutlass_fmha/memory_efficient_attention.h, keeping it in theonnxruntime::contrib::cudanamespace. A short NOTE comment documents why it must stay unconditional. The MEA-specific implementation remains conditionally compiled, so there is no behavior change when the flag is enabled.Motivation and Context
Fixes #32566. Building with
-Donnxruntime_USE_CUDA=ON -Donnxruntime_USE_MEMORY_EFFICIENT_ATTENTION=OFFfails becauseMaskedBiasSentinel()incore/providers/cuda/llm/attention.ccunconditionally references::onnxruntime::contrib::cuda::kCutlassSafeMaskFilterValue, while the constant was defined inside the feature guard. The constant has no CUTLASS dependency and is also required by the unfused attention path, so defining it unconditionally is the correct fix (per the discussion with Saad-Mallebhari in the issue).