- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
It seems that dnnExecute_F32 can not be called in multi-thread, does it?
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
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 copiado
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
dnnExecute_F32 is threaded by OpenMP and will use OpenMP runtime lib if you linked the application with libiomp5 lib
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
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?
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
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
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
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.
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
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
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Thank you Ying, I got it.
While last question: Can I use global conversion primitives? Thank you very much
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
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
- Subscrever fonte RSS
- Marcar tópico como novo
- Marcar tópico como lido
- Flutuar este Tópico para o utilizador atual
- Marcador
- Subscrever
- Página amigável para impressora