michaelhwn opened a new issue #9719:
URL: https://github.com/apache/tvm/issues/9719


   ### Background
   
   I am using TVM to perform inference on a Raspberry Pi 4B. Occasionally I 
noticed that when I try to load my model with the tvm.runtime.load_module() 
function, I get a FileExistsError telling me there already exists a directory 
with the name same as my model's name.  I had to manually remove this existing 
directory for the load_module() function to work properly. From the error log, 
I found that this exception occurred in this line: 
https://github.com/apache/tvm/blob/2b35cfd6ddb73afecd3f550f33881e1fdc7c3267/python/tvm/contrib/utils.py#L102
   Since this is a system operation, shouldn't there be some catching and 
handling for the errno.EEXIST exception (or similar exception)? 
   
   ### Expected behaviour
   
   The __init__ function of TempDirectory class should perform the handling of 
errno.EEXIST exception (or similar exception) and make sure the directory can 
be created properly.
   
   ### Actual behaviour
   
   If a directory already exists, the __init__ function of TempDirectory class 
will crash the program as there is no exception handling.
   
   ### Environment
   
   Raspberry Pi 4B with Raspberry Pi OS Bullseye. TVM using v0.7.0 release (The 
v0.8.0 has the same TempDirectory  class code).
   
   ### Steps to reproduce
   
   1. Shutdown the program/Raspberry Pi as soon as the 
tvm.runtime.load_module() function starts. This will cause the temporary 
directory to remain to exist and not being cleaned up. 
   2. Re-run the tvm.runtime.load_module() function and observe the 
FileExistsError Exception. 


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