You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/05/07 15:35:33 UTC
[GitHub] TaoLv commented on issue #10836: mxnet-mkldnn(v1.2.0) to use whole
CPU cores on machines without hyperthreading
TaoLv commented on issue #10836: mxnet-mkldnn(v1.2.0) to use whole CPU cores on machines without hyperthreading
URL: https://github.com/apache/incubator-mxnet/issues/10836#issuecomment-387105065
Great analysis. I think setting `OMP_NUM_THREADS` to the number of physical core is a good choice and you'd better bind all threads to physical cores by setting `KMP_AFFINITY`.
I'm afraid below code is not portable and cannot run other OS.
```
int physical_cpus = std::stoi(exec_shell("cat /proc/cpuinfo |grep 'physical id'|sort -u|wc -l"));
//get the physical core count of each physical cpu
int cores = std::stoi(exec_shell("cat /proc/cpuinfo |grep 'cores'|sort -u|awk '{print $4}' "));
```
FYI, here are some previous discussions about it: https://github.com/apache/incubator-mxnet/issues/9545#issuecomment-361874591 Contribution is welcome :)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services