Maratyszcza / NNPACK

Acceleration package for neural networks on multi-core CPUs
BSD 2-Clause "Simplified" License
1.68k stars 316 forks source link

The main thread behavior when given threadpool in computation #148

Closed dongxiao92 closed 6 years ago

dongxiao92 commented 6 years ago

Hi, I'm doing benchmark on the multi threading performance on some CNN models. As I'm not familiar with the pthread functions, I want to know the behavior of the main thread in computation. Specifically, I want to know if the main thread participates the computation as the threads in threadpool.

Thanks

Maratyszcza commented 6 years ago

If you use Maratyszcza/pthreadpool, the main thread does not participate in computations. However, if you build NNPACK as part of Caffe2 / PyTorch, they would use a different thread pool implementation, where the main thread does participate in computations.

dongxiao92 commented 6 years ago

Thank you very much!