vvchernov opened a new pull request #9980:
URL: https://github.com/apache/tvm/pull/9980


   The issue was observed during generation of VirtulaMachine Module on python 
side and using it on c++ one.
   Work case: when we work in one python session the lib (exec) object is 
generated and used for VirtualMachine compilation. Inside VM the raw pointer to 
the lib (exec) is copied. Due to the lib object is alive along the session the 
VM object can use the pointer and execute different methods like "set_input", 
"invoke" and so on.
   Unworkable case: if we use python session for generation VM and try to use 
it on c++ side it does not work. The reason is the lib object died after the 
session is closed. Thus VM uses the pointer to the spoiled object and it leads 
to failure.
   
   To fix this problem Executable* pointer was replaced by solid 
ObjectPtr<Executable> and other depended methods were corrected. 
   The weak place is Downcasting From ObjectPtr<Object> to 
ObjectPtr<Executable> due to it is prohibited by special check in direct 
constructor (it is commented in the PR).
   
   @jwfromm @tmoreau89 please see. 
   


-- 
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