convolution - Parfor loops not giving speedup on 12 core than 4 core machine

1 回表示 (過去 30 日間)
Hello,
I am using "Matcovnet" to work on the Imagenet dataset for training and inference using fixed point operands. I am working on two machines simultaneously, both having different number of cores
1) 4 cores
2) 12 cores
I am running same dataset and same fixed point training code on both the machines simultaneously. I am getting 0.2 Hz frequency (0.2 images/sec) on both the machines, which ideally should not happen as the number of cores are different for both machines. I am having various parfor loops in the code.
The parfor loops are in the codegen files which are converted in the MEX functions by Matlabcoder toolbox.
My main question is:
1) Even if I use for loops instead of parfor my both machines uses all the cores by default with around 90% CPU-Utilization (just having parallel computing toolbox has this effect?) and also, my speed of computation/training is still the same that is 0.2 Hz, Can you please let me know about it ?
2) My 2nd question is, if I use parfor loop and run the code on this two machines why am I not getting any speedup on the machine with 12 cores compared to 4 cores ? Also, here on both machines I am getting the same training speed, that is 0.2 Hz.
Thank you in advance for your help !
Bhushan

採用された回答

BHUSHAN MUTHIYAN
BHUSHAN MUTHIYAN 2017 年 8 月 17 日
編集済み: Walter Roberson 2017 年 8 月 17 日
Hello,
I am answering my own question.
After doing some research I found out that my compiler(Microsoft Windows SDK 7.1) does not support openMP according to the link.
For using parfor loop while generating MEX file the compiler must support openMP. Below link gives this explanation.
So my question is, can you provide me the compiler which will support
1) Matcovnet 2) Parallel Computing toolbox 3) OpenMP 4) Matlab coder
I am not able to get the clear explanation about the compiler supporting openMP from the link.
https://www.mathworks.com/support/compilers.html
Thank you for your kind help.

その他の回答 (2 件)

Walter Roberson
Walter Roberson 2017 年 8 月 18 日
1) Matcovnet
In R2017a, for MS Windows, in order to support Matcovnet with the CUDA component, you need a compiler supported by CUDA 8.0.
The MS Windows compilers fully supported by CUDA 8.0 are:
  • Visual Studio 2015 (Professional); this is supported by MATLAB R2017a
  • Visual Studio Community 2015; however, this is not supported by MATLAB R2017a
  • Visual Studio 2013 (Professional); this is supported by MATLAB R2017a
  • Visual Studio 2012 (Professional); this is supported by MATLAB R2017a
2) Parallel Computing toolbox
The Parallel Computing Toolbox itself does not need a compiler. However, if you wish to compile custom .cu kernels, you need one of the compilers listed above for Matconvnet
3) OpenMP
OpenMP is not part of MATLAB, but is sometimes used by programs that people might compile for use with MATLAB. The compiler support is as follows:
  • MinGW 4.9.2 did support OpenMP, and is supported by MATLAB R2017a.
  • SDK 7.1 did not support OpenMP, but is supported by MATLAB R2017a.
  • VS 2008 Professional did support OpenMP with a patch, but is not supported by MATLAB R2017a.
  • VS 2010 Express did not support OpenMP, and is also not supported by MATLAB R2017a.
  • VS 2010 Professional did support OpenMP, but is not supported by MATLAB R2017a.
  • VS 2012 Professional, VS 2013 Professional, and VS 2015 Professional did support OpenMP, and are all supported by MATLAB R2017a
  • VS 2012 Express, VS 2013 Express, and VS 2015 Community did support OpenMP, but are not supported by MATLAB R2017a.
  • VS 2017 Professional and VS 2017 Community did support OpenMP, and both are supported by MATLAB R2017a after a patch has been installed
4) Matlab coder
The compilers supported by MATLAB Coder in R2017a for MS Windows are:
  • MinGW 4.9.2
  • SDK 7.1
  • VS 2015 Professional, VS 2013 Professional, and VS 2012 Professional
  • VS 2017 Professional and VS 2017 Community are not supported for MATLAB Coder for R2017a.
====
Putting all of this information together:
  • There are no free compilers that are supported for all four of these aspects.
  • VS 2015 Professional, VS 2013 Professional, and VS 2012 Professional support all of these aspects
  • Take special note that VS 2017 Professional and VS 2017 Community are not supported by NVCC for building CUDA kernels, and are not supported by MATLAB Coder.

BHUSHAN MUTHIYAN
BHUSHAN MUTHIYAN 2017 年 8 月 18 日
Hello Walter,
Thank you for your kind help.
That solves my problem.

カテゴリ

Help Center および File ExchangeExecution Speed についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by