- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It seems that dnnExecute_F32 can not be called in multi-thread, does it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Xuesong,
Right, you can't create Global DNN primitives, but use them in multiply different threads. You need to take care of the synchronize of the involve data and internal structure (like any global variable, you use it in different threads , you need to add protect mechanism to use it) . But you can create private DDN primitives for each threads, it is thread safe. That is why we suggest to use MKL build the topology directly instead of manage the threads yourself.
Best Regards,
Ying
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
dnnExecute_F32 is threaded by OpenMP and will use OpenMP runtime lib if you linked the application with libiomp5 lib
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Gennady F. (Intel) wrote:
dnnExecute_F32 is threaded by OpenMP and will use OpenMP runtime lib if you linked the application with libiomp5 lib
I use sequential mkl. I want to control thread outside. win32 thread or pthread. Does MKL support this way?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Xuesong,
If needed, right, you can control thread outside by win32 thread or pthread etc. MKL function include MKLDNN function support that way. for example, MKL user guide discuss : https://software.intel.com/en-us/mkl-linux-developer-guide-avoiding-conflicts-in-the-execution-environment.
And if you are build one NN topology, please refer to MKL NN sample under MKL install directory, /mkl/example/*.tgz, unzip it and the folder dnnc
Best Regards,
Ying
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Ying.
Can I create global DNN primitives, then use them in multiple diffrent threads? In my test case, I found this will lead to unstable output.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Xuesong,
Right, you can't create Global DNN primitives, but use them in multiply different threads. You need to take care of the synchronize of the involve data and internal structure (like any global variable, you use it in different threads , you need to add protect mechanism to use it) . But you can create private DDN primitives for each threads, it is thread safe. That is why we suggest to use MKL build the topology directly instead of manage the threads yourself.
Best Regards,
Ying
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you Ying, I got it.
While last question: Can I use global conversion primitives? Thank you very much
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Xuesong,
Yes, the conversion primitives may work as global primitives, if no data conflict in different threads. Not sure how do like design the Muliti-thread NN. Here is one MKL NN Convolution code vs. general C code. https://software.intel.com/sites/default/files/managed/b9/e9/mkl_conv_avx2.c for your reference.
Best Regards,
Ying
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page