Skip to content

Commit

Permalink
Disable default sdpa in Albert (#22) (huggingface#1517)
Browse files Browse the repository at this point in the history
Co-authored-by: Urszula Golowicz <[email protected]>
  • Loading branch information
2 people authored and Liangyx2 committed Jan 20, 2025
1 parent 9d06117 commit f31f050
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion optimum/habana/transformers/models/modeling_all_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def gaudi_conv1d_forward(self, x):
@classmethod
def gaudi_check_and_enable_sdpa(cls, config, hard_check_only: bool = False) -> PretrainedConfig:
# This model doesn't support SDPA in Gaudi yet, fallback to original code.
MODELS_ATTN_IMPLEMENTATION_EAGER = ["bart", "gpt_bigcode", "mistral", "mixtral", "wav2vec2", "roberta"]
MODELS_ATTN_IMPLEMENTATION_EAGER = ["albert", "bart", "gpt_bigcode", "mistral", "mixtral", "wav2vec2", "roberta"]

if config.model_type in MODELS_ATTN_IMPLEMENTATION_EAGER:
config._attn_implementation = "eager"
Expand Down

0 comments on commit f31f050

Please sign in to comment.