microsoft / CNTK

Microsoft Cognitive Toolkit (CNTK), an open source deep-learning toolkit
https://docs.microsoft.com/cognitive-toolkit/
Other
17.53k stars 4.28k forks source link

Enable/Update MKL-DNN #3266

Open TechnikEmpire opened 6 years ago

TechnikEmpire commented 6 years ago

In master in MKL-DNN, the library now supports OpenMP on Windows/MSVC and it is enabled by default. There are some dramatic improvements in performance that the CPU-only distro could benefit from here. I took a quick peek to see what it would take in a PR and noticed that detection for MKL-DNN is commented out presently. There's some reference to a bug that looks like it was fixed long ago. It also looks like you're trying to detect the library prebuilt and bundled with MKL?

If that's the case, might I suggest adding it as a submodule rather than trying to detect a bundled version. This way you can jump bump your referenced commit on the submodule to keep current.

See https://github.com/intel/mkl-dnn/commit/dae437dd6289ba1798983747930b2d1a70dcfded

ke1337 commented 6 years ago

Thanks for the reminder @TechnikEmpire. Does it mean that MKL-DNN build in MSVC would have reasonable performance? If so we'd be happy to make it a submodule.

TechnikEmpire commented 6 years ago

@KeDengMS I saw a dramatic increase in performance for my particular use-case (~50% increase in perf), although it was using mkl-dnn outside of CNTK and wasn't a "real" perf test. However, in short, the goal with the linked PR was to make features and performance with OpenMP enabled on MSVC equal to or within a slim margin of what you'd get from any other toolchain.

TechnikEmpire commented 6 years ago

@KeDengMS @spandantiwari v0.15 of MKL-DNN has been released and includes the new MSVC OpenMP support, which massively improves CPU performance.

TechnikEmpire commented 6 years ago

It's been suggested to use CNTK-CPU as a possible back-end for ML.NET's in-flux image recognition.