fix: enable _supports_flash_attn_2 for EOMT#45993
Closed
TheShreyanshiDwivedi wants to merge 3 commits into
Closed
Conversation
EomtAttention already routes through ALL_ATTENTION_FUNCTIONS and accepts attn_implementation at runtime, identical to other vision models that have _supports_flash_attn = True (DINOv2, SigLIP, etc.). The flag was missing, causing flash_attention_2 to be rejected at the PreTrainedModel validation level even though the attention forward is fully compatible.
…mt_dinov3) Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Contributor
|
[For maintainers] Suggested jobs to run (before merge) run-slow: eomt, eomt_dinov3, videomt |
Member
|
Hey, these Claude PRs that don't address an existing issue and are just kind of opened randomly are very annoying for us! It's not actually helpful, and we can run Claude ourselves to fix stuff if we need to. |
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.
What does this PR do?
EOMT had full Flash Attention 2 wiring via
ALL_ATTENTION_FUNCTIONSbut the gate flag_supports_flash_attn_2was missing. This one-line fix enables FA2 for EOMT.Root cause:
EomtPreTrainedModelwas missing_supports_flash_attn_2 = Truedespite the attention layer already being correctly wired to the FA2 backend.Changes
_supports_flash_attn_2 = TruetoEomtPreTrainedModelFiles changed
src/transformers/models/eomt/modular_eomt.pysrc/transformers/models/eomt/modeling_eomt.py