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
ONNXRunTime objects release their memory through a finalizer, which calls the CAPI.release function. As noted in the docstring, garbage collection should normally handle this automatically. However if you have a large GPU model you might have extreme GPU memory pressure without any CPU memory pressure at all, and the garbage collection won't be in any hurry to destroy your objects, which would release your GPU memory.
Obviously CAPI.release gives you the tool to handle this manually but it's quite clunky both to dip down into the C API, and to separately extract the api and session fields for the release call.
My proposal is to add a highlevel release function/method for InferenceSession. Thoughts?
The text was updated successfully, but these errors were encountered:
ONNXRunTime objects release their memory through a finalizer, which calls the
CAPI.release
function. As noted in the docstring, garbage collection should normally handle this automatically. However if you have a large GPU model you might have extreme GPU memory pressure without any CPU memory pressure at all, and the garbage collection won't be in any hurry to destroy your objects, which would release your GPU memory.Obviously
CAPI.release
gives you the tool to handle this manually but it's quite clunky both to dip down into the C API, and to separately extract theapi
andsession
fields for therelease
call.My proposal is to add a highlevel
release
function/method forInferenceSession
. Thoughts?The text was updated successfully, but these errors were encountered: