Skip to content

Override sdpa option in Gaudi#771

Merged
regisss merged 1 commit into
mainfrom
jha/disablesdpa
Mar 7, 2024
Merged

Override sdpa option in Gaudi#771
regisss merged 1 commit into
mainfrom
jha/disablesdpa

Conversation

@jiminha
Copy link
Copy Markdown
Contributor

@jiminha jiminha commented Mar 6, 2024

From torch 2.1 and above, SDPA attention is enabled by default. Due to this some models that we enabled are failing due to SDPA attention layer is not comparable with our code. Affected models are bart,gpt_bigcode,mistral and mixtral

TypeError: GPTBigCodeSdpaAttention.forward() got an unexpected keyword argument 'token_idx'
TypeError: BartSdpaAttention.forward() got an unexpected keyword argument 'token_idx'

We are overriding check sdpa method for Gaudi for these model to disable sdpa until we have fusedSDPA support for them. All other models will follow original implementation.
https://github.com/huggingface/transformers/blob/v4.37.2/src/transformers/modeling_utils.py#L1542

@jiminha jiminha requested a review from regisss as a code owner March 6, 2024 19:22
@jiminha jiminha requested a review from libinta March 6, 2024 19:22
@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@libinta libinta added run-test Run CI for PRs from external contributors synapse 1.15 labels Mar 6, 2024
@regisss regisss added run-test Run CI for PRs from external contributors and removed run-test Run CI for PRs from external contributors labels Mar 7, 2024
Copy link
Copy Markdown
Collaborator

@regisss regisss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

This can be merged now I think no?

@regisss regisss merged commit 3fbc6d6 into main Mar 7, 2024
@regisss regisss deleted the jha/disablesdpa branch March 7, 2024 02:41
jiminha added a commit that referenced this pull request Mar 7, 2024
puneeshkhanna pushed a commit to puneeshkhanna/optimum-habana-fork that referenced this pull request Mar 11, 2024
HolyFalafel pushed a commit to HabanaAI/optimum-habana-fork that referenced this pull request Mar 11, 2024
gplutop7 pushed a commit to HabanaAI/optimum-habana-fork that referenced this pull request Nov 6, 2025
…ransformers version, even in HF. (huggingface#2306) (huggingface#771)

Signed-off-by: Artur Kloniecki <arturx.kloniecki@intel.com>
Co-authored-by: Artur KlonieckiX <arturx.kloniecki@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-test Run CI for PRs from external contributors synapse 1.15

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants