Skip to content

Fix dk/dv autograd error on TPU flash attention#8685

Merged
qihqi merged 1 commit intopytorch:masterfrom
zmelumian972:flash_attention_autograd_dkv_fix
Feb 7, 2025
Merged

Fix dk/dv autograd error on TPU flash attention#8685
qihqi merged 1 commit intopytorch:masterfrom
zmelumian972:flash_attention_autograd_dkv_fix

Conversation

@zmelumian972
Copy link
Copy Markdown
Collaborator

grads not extracting on flash attention if autograd activated on dv

flash attention backward function on TPU will only return keys and values gradients if the key gradients is requested by torch.autograd

…ed on dv

flash attention backward function on TPU will only return keys and values gradients if the key gradients is requested by torch.autograd
Copy link
Copy Markdown
Collaborator

@lsy323 lsy323 left a comment

Choose a reason for hiding this comment

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

Thank you for the fix!

@qihqi qihqi merged commit 0cd1fc2 into pytorch:master Feb 7, 2025
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.

3 participants