dzabraev commented on issue #12393: Deadlock in save_checkpoint when using 
threading
URL: 
https://github.com/apache/incubator-mxnet/issues/12393#issuecomment-417007354
 
 
   I realized that I shouldn't use mx.nd.array in different threads, because it 
uses Push API.
   
   I found [here](https://mxnet.incubator.apache.org/architecture/overview.html)
   
   > Push APIs are not thread-safe. To be specific, only one thread should make 
engine API calls at a time.
   
   I think you should mention in python API documentation what exactly python 
API functions should be called only from main thread.
   
   It will be useful to make function for creating ndarray in non-block 
fashion. Because mx.nd.array very slow and this function blocks main thread 
long time.
   
   ```
   heavy_nparray = ...
   ndarr = mx.nd.array_nonblock(heavy_nparray)
   # do something
   ndarr.wait()
   ```
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to