-
Notifications
You must be signed in to change notification settings - Fork 9
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
Leak the fit
function environment
#74
Comments
Hi Daniel, I've been working with the luz API recently, and found a memory leak similar to this one. It seems that after the algorithm converges, it does not get deleted and the memory is not freed. Is this issue resolved through the commit above? |
Yes, even though the leak is not yet resolved, with the current version the amount of leaked memory should be very small. FWIW we found that the leak is caused by r-lib/coro#36 |
Is the temporary fix currently implemented on the development branch or the mem-leak branch? When I used the development branch I get the following error: `Error in on.exit(add = TRUE, {: invalid 'add' argument
Otherwise, using the main branch, I still get the memory leak error. |
It's in the main branch - installed with I will change the order of the arguments, but it seems that using a more recent R version should also fix. |
So it seems that while the memory leak is small, my algorithm requires multiple calls to the optimization routine during the maximization step in an E-M algorithm, and it seems that calling the luz fit function multiple times does not fully free up GPU information after fitting. My algorithm is able to do 4-5 EM loops and then it gives the CUDA out of memory error. Not sure how reduce the impact of this. |
Are you storing the results of each call to
Could you share a snippet of what you are doing so I can investigate further? Thanks |
This would be part of the maximization step that gets called every time we go through an EM step.
|
Can you try doing:
This way the fitted model parameters should go to the CPU and don't hold your GPU memory. |
For some reason the
fit
function environment is being leaked and never gets deleted. See for example:See the
mem-leak
branch for an example.The text was updated successfully, but these errors were encountered: