-
Notifications
You must be signed in to change notification settings - Fork 174
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
OOM with clearState() and DataParallelTable #441
Comments
I have what seems to be the exact same issue. I thought I was going crazy; my model trains fine for many iterations, but then when I call Unfortunately, I'm not able to replicate it with the code you posted on a Titan X (Pascal) with a higher batch size, but I do see the same symptoms with a model containing custom layers. I've been trying on-and-off for days to see if I can isolate this issue, but haven't had luck yet :(. Any leads or suggestions would be great! |
Update: For me, the issue seems to be with nn.MapTable, and not DataParallellTable. I've filed my issue separately here: torch/nn#1141 |
Calling clearState() seems to cause issues that, after 4-5 days of debugging, I haven't been able to fix. See, for example: torch/nn#1141 torch/cunn#441 Further, it's unclear to me if `getParameters` and memory management in general works well when a call to `clearState` can destroy modules (and therefore weight tensors). The easiest solution to all of this is simply to never call clearState on the model while it is training. When saving the model, we create a copy of it on the CPU, and call clearState on this CPU copy, which we then save to disk.
I wanted to reduce the size of the model for saving, but got out of memory when doing clearState()
Here is the code that gives error:
From my understanding the code should be able to finish running. But the memory is not freed successfully and it gives out of memory error after some iterations. I got out of memory error at the 7th iteration with 4 K80.
The code seems to run fine without DataParallelTable, so I guess it should be something about DataParallelTable.
Thanks!
The text was updated successfully, but these errors were encountered: