# PyTorch == 2.5.0 Breaks Transformers' SDPAttention!
text
# PyTorch == 2.5.0 Breaks Transformers' SDPAttention!
new_line
new_line
When you encounter "RuntimeError: cuDNN Frontend error: [cudnn_frontend] Error: No execution plans support the graph." 
text
When you encounter "RuntimeError: cuDNN Frontend error: [cudnn_frontend] Error: No execution plans support the graph." 
new_line
new_line
We can use workaround like this:
text
We can use workaround like this:
new_line
new_line
torch.backends.cuda.enable_cudnn_sdp(False)
python
```python
torch.backends.cuda.enable_cudnn_sdp(False)
```
code_fence
new_line
new_line
but this slow downs the performance gain from PyTorch 2.5.
text
but this slow downs the performance gain from PyTorch 2.5.
new_line
new_line
Although it is fixed(not "fixed" but default option is turn-off the cuDNN SDPA) at here -- 
text
Although it is fixed(not "fixed" but default option is turn-off the cuDNN SDPA) at here -- 
https://github.com/pytorch/pytorch/pull/138587
https://github.com/pytorch/pytorch/pull/138587
link
 , but not released yet. (you need to install directly from source)
text
 , but not released yet. (you need to install directly from source)
new_line
new_line
Fastest way for now : pip install "torch<2.5"
text
Fastest way for now : pip install "torch<2.5"
new_line
new_line
Ref: 
text
Ref: 
https://github.com/huggingface/diffusers/issues/9704#issuecomment-2422585273
https://github.com/huggingface/diffusers/issues/9704#issuecomment-2422585273
link
# PyTorch == 2.5.0 Breaks Transformers' SDPAttention!

When you encounter "RuntimeError: cuDNN Frontend error: [cudnn_frontend] Error: No execution plans support the graph." 

We can use workaround like this:

```python
torch.backends.cuda.enable_cudnn_sdp(False)
```

but this slow downs the performance gain from PyTorch 2.5.

Although it is fixed(not "fixed" but default option is turn-off the cuDNN SDPA) at here -- https://github.com/pytorch/pytorch/pull/138587 , but not released yet. (you need to install directly from source)

Fastest way for now : pip install "torch<2.5"

Ref: https://github.com/huggingface/diffusers/issues/9704#issuecomment-2422585273
🔥
maywell John6666 kaki-paper razPie Word2Li GoDjMike achilou spyker77 qmin2 r3ihiq jyoung105 dddddcyy Programmer0-0 ZY-Dijkstra
😎
John6666 raincandy-u dingo-actual qmin2
👍
Pretergeek Mactarvish
🤯
John6666
😔
John6666