Oct 14, 2015 at 9:22 PM
Edited Oct 14, 2015 at 9:23 PM
Hi CNTK contributors,
We are adding a dependency to CNTK which will be mandatory in order to build CUDA-enabled version. Below is the short version of the changes followed by more detailed explanation.
What: NVIDIA CUB library will be required to build CNTK CUDA code.
Why: CNTK currently contains a lot of duplicated and suboptimal/inefficient GPU kernel implementations that perform reductions and scans. CUB provides extremely well optimized routines that will replace all of that code as a part of ongoing refactoring efforts.
How: CUB is a simple, open-source (New BSD license) library distributed as .zip file and does not require any special build/pre-build steps. Download it from:
o Unzip the package to any directory.
o Set environment variable CUB_PATH to CUB folder, e.g.: CUB_PATH=c:\src\cub-1.4.1
o Just unzip the package to: /usr/local directory.
o Alternatively, unzip the package to any directory you like and run: ./configure --with-cub=<full path to CUB directory>
Documentation page on CodePlex has been updated with these steps. Also, if you try building the solution/project without CUB installed, you should receive a meaningful error message which will tell you what’s missing and how to fix it.
You might have questions on why we need this dependency, here is some more information.
NVIDIA CUB (https://nvlabs.github.io/cub/
) is an open source, production quality library fully supported and developed by NVIDIA.
It provides a set of highly optimized routines that perform reductions, scans, sorts etc. These routines are optimized by NVIDIA engineers for every GPU architecture (Tesla, Fermi, Kepler, Maxwell) and new versions will be available immediately after new architecture
The main reason to use the library is to remove old (and duplicated) reduction/scan code from CNTK. This code was written using now-outdated (more than 5 years old) reduction algorithm which worked fine on old Fermi architecture but can be much more efficiently
implemented on newer architectures like Kepler and Maxwell.
CUB is currently not a part of CUDA Toolkit as it’s being actively developed (similar to another popular NVIDIA library, cuDNN). It might be included in CUDA Toolkit sometime in the future.
Let me know if you have any questions or problems building the code.