You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am new to Jax so this might be a silly question.
My question is about memory allocation on GPU when running jitted functions.
First, do I understand correctly that when a jitted function is run, device memory will be allocated at the beginning or during this function for those intermediate variables, such as grads? And then such memory will be released after the end of the function if they are not part of the outputs?
If so, then wouldn't this cause the issue of memory fragmentation on the device if we have multiple jitted functions and each of them runs from time to time such as in RL settings?
In Jax, is there a way then to pin memory for these intermediate variables within a jitted function to avoid memory fragmentation? This avoids memory allocation.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I am new to Jax so this might be a silly question.
My question is about memory allocation on GPU when running jitted functions.
First, do I understand correctly that when a jitted function is run, device memory will be allocated at the beginning or during this function for those intermediate variables, such as grads? And then such memory will be released after the end of the function if they are not part of the outputs?
If so, then wouldn't this cause the issue of memory fragmentation on the device if we have multiple jitted functions and each of them runs from time to time such as in RL settings?
In Jax, is there a way then to pin memory for these intermediate variables within a jitted function to avoid memory fragmentation? This avoids memory allocation.
Thank you very much for any help.
Beta Was this translation helpful? Give feedback.
All reactions