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

fairseq multihead_attention, torch.cat cause RuntimeError: CUDA out of memory #83

Open
Fizzbb opened this issue Jan 25, 2022 · 0 comments

Comments

@Fizzbb
Copy link
Collaborator

Fizzbb commented Jan 25, 2022

In the transformer training(validation phase),
Nvidia's fairseq multihead_ ttention file is different from Facebook's latest version
line 354 causing oom issues at the end of a epoch when calcuate bleu score for validation.
https://github.com/NVIDIA/DeepLearningExamples/blob/master/PyTorch/Translation/Transformer/fairseq/modules/multihead_attention.py

https://github.com/pytorch/fairseq/blob/main/fairseq/modules/multihead_attention.py (line 418)

File "/workspace/translation/fairseq/modules/multihead_attention, in forward
v = torch.cat((saved_state['prev_value'], v), dim=0)
RuntimeError: CUDA out of memory. Tried to allocate 314.00 MiB (GP total capacity; 8.63 GiB already allocated; 11.00 MiB free; 11.19in total by PyTorch)
Killing subprocess 558
Killing subprocess 559

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

No branches or pull requests

1 participant