Overriding the new default of 'sdpa'#108
Open
ParthaEth wants to merge 5 commits intoMeiGen-AI:mainfrom
Open
Conversation
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.
The default value of the attn_implementation argument in Wav2Vec2Model.from_pretrained() depends on the underlying version of Transformers (Hugging Face) you’re using.
As of Transformers v4.38+, the attn_implementation argument can be one of the following:
"eager" — standard PyTorch attention (default prior to v4.37)
"flash_attention_2" — uses FlashAttention v2 if available (faster and more memory-efficient)
"sdpa" — uses PyTorch’s scaled dot-product attention if available
I have not tested with -
flash_attention_2. It would be great if that can speed things up.