Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test_eager_matches_sdpa_inference for XPU backend #34889

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

dvrogozh
Copy link
Contributor

Included fixes:

  • Use torch.nn.attention.sdpa_kernel instead of deprecated torch.backends.cuda.sdp_kernel
  • Use torch.amp.autocast instead of deprecated torch.cuda.amp.autocast in nemotron
  • Use CPU thresholds in some test_eager_matches_sdpa_inference tests when running on XPU device since torch.nn.attention.sdpa_kernel falls back to CPU on pytorch XPU backend

Fixes: #34888
CC: @amyeroberts @ydshieh

Currently torch.nn.attention.sdpa_kernel falls back to CPU when torch
works with XPU backend. So, cpu thresholds should be used in associated
tests.

Fixes: huggingface#34888
Signed-off-by: Dmitry Rogozhkin <[email protected]>
@dvrogozh
Copy link
Contributor Author

Looks like Friday evening is not the best time to run ci. Pushed same code 3 times, seeing different errors on each run:). Not related to the change I think. Will continue on Monday :).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

xpu: test_eager_matches_sdpa_inference tests fail with pytorch XPU backend
1 participant