ZhennanQin commented on issue #15465: [RFC] Integrate TVM into Apache MXNet
URL: 
https://github.com/apache/incubator-mxnet/issues/15465#issuecomment-509859385
 
 
   @tqchen I agree with you that this is a technical issue and shouldn't block 
this PFC. As thread management should be considered from high level design, I 
bring this topic here.
   
   > (1) and (2) likely won't be an issue because: TVM's thread number 
configurations and core settings are consistent with OMP(OMP_NUM_THREADS).
   
   `OMP_NUM_THREADS` can't help for either of them. For (1), consider the 
executing sequence: OMP operator -> TVM operator. When OMP operator finished, 
OMP threads won't sleep immediately, but spin for a while. Then when TVM 
operator starts, there will be 2x threads active, making TVM threads can't 
fully occupy all physical cores. You can check `OMP_WAIT_POLICY` for details.
   For (2), it's about how to manage threads. OMP manages threads per engine 
worker. If TVM uses single global thread pool, then it will has problem for 
multi-worker usage.
   
   Another thing worth to mention is, as OMP is the MXNet thread management 
protocol, user may use many OMP environment to change their thread policy. For 
example, `KMP_AFFINITY` and `OMP_WAIT_POLICY ` are used frequently. I doubt if 
TVM threads pool can support them.
   
   It's good to know TVM can support OMP as a threadpool backend. Then let's 
performance data make the decision if integrated TVM will switch to use OMP. 
Also thanks @yidawang for the explanation.
    

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to