echuraev commented on PR #17190:
URL: https://github.com/apache/tvm/pull/17190#issuecomment-2247636436

   @tqchen I modified `__del__` functions only to set `NULL` to `handle`.  
Looking at the code in 
[disco/session.py](https://github.com/apache/tvm/blob/main/python/tvm/runtime/disco/session.py#L93-L96),
 it looks like we shouldn't release memory after calling `del` operator, we 
just need to set `NULL` to `handle` of `dref` object and memory should be 
released by the last instance of this `handle`. 
   
   As a test for these changes, we can use [two 
tests](https://github.com/apache/tvm/blob/main/tests/python/disco/test_session.py#L122-L221)
 from `disco/test_session.py`. Without this fix, these tests are crashed when 
we use cython. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to