benchmarks icon indicating copy to clipboard operation
benchmarks copied to clipboard

Environment settings not used for MKL

Open tonyreina opened this issue 7 years ago • 2 comments

I realize that there are now runtime MKL flags for KMP_AFFINITY, KMP_BLOCKTIME, and KMP_SETTINGS. However, I often set these variables in my environment via export KMP_BLOCKTIME=0.

Currently, the benchmark script overwrites these environment defaults in favor of its preset ones (which may not be optimal). In particular, setting KMP_BLOCKTIME from 30 to 0 will cause the FPS for googlenet (batch size 64) to increase from ~ 200 FPS to ~ 245 FPS. Could the script be modified so that the environment variables are used as default if they exist?

Thanks.

tonyreina avatar Aug 20 '18 15:08 tonyreina

I would set them with the flags. At some point they will be set "under the hood". One thing you could do and I may do it you do not is send a PR to change the default KMP_BLOCKTIME to 0, which is a better default. I do not recall why I left it at 30 given I never used 30 when testing. I believe the other defaults are good. I will leave this open until the default is changed to 0.

tfboyd avatar Aug 20 '18 15:08 tfboyd

Thanks! Yes. I agree it will hopefully end up just being an "under the hood" setting at some point. I know that for certain topologies that tweaking KMP_BLOCKTIME and the intra/inter threads can yield significant bumps in performance. I'd love if the default could be set to 0 (which basically just allows the machine to choose the right blocktime automagically).

tonyreina avatar Aug 20 '18 15:08 tonyreina