Skip to content

generate.py blows up GPU memory #12

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

Closed
soumith opened this issue Nov 18, 2016 · 2 comments
Closed

generate.py blows up GPU memory #12

soumith opened this issue Nov 18, 2016 · 2 comments

Comments

@soumith
Copy link
Member

soumith commented Nov 18, 2016

When I ran language model example, generate.py blew up GPU memory as it generated sentences (starting from ~500MB to ~4GB). In the end I got out of memory error: RuntimeError: cuda runtime error (2) : out of memory at /data/users/soumith/miniconda2/conda-bld/pytorch-0.1.5_1479441063232/work/torch/lib/THC/generic/THCStorage.cu:65 .

Some info:

  • Ubuntu 14.04
  • Geforce GTX 970 (Memory size: 4GB)
  • Python 3.5.2

cc: @adamlerer

@colesbury
Copy link
Member

If you're doing inference only, you might need to set volatile=True. Otherwise you often end up with reference cycles which aren't collected immediately. (This is something we should fix in PyTorch)

@soumith
Copy link
Member Author

soumith commented Nov 18, 2016

fixed via 4c93238

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

2 participants