diff options
author | Jingbei Li | 2019-07-02 16:22:21 +0800 |
---|---|---|
committer | Jingbei Li | 2019-07-02 16:22:21 +0800 |
commit | f99d6a57af078abff57555f9e14e0b7d41f64f1b (patch) | |
tree | 322496f27d30a63f7fa0223c90924eb9dda24e41 | |
download | aur-cntk-cuda.tar.gz |
Initial commit
-rw-r--r-- | .SRCINFO | 71 | ||||
-rw-r--r-- | .gitignore | 5 | ||||
-rw-r--r-- | PKGBUILD | 171 |
3 files changed, 247 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..c86d8672e71c --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,71 @@ +pkgbase = cntk-cuda + pkgdesc = Microsoft Cognitive Toolkit (CNTK), an open source deep-learning toolkit + pkgver = 2.7 + pkgrel = 1 + url = https://github.com/Microsoft/cntk + arch = x86_64 + license = CUSTOM + makedepends = cmake + makedepends = gcc7 + makedepends = git + makedepends = inetutils + makedepends = python-pip + makedepends = python-setuptools + makedepends = python-wheel + makedepends = swig + depends = boost + depends = cub + depends = cuda + depends = cudnn + depends = libzip + depends = nccl + depends = openblas-lapack + depends = openmp + depends = openmpi + depends = protobuf-static + depends = python-numpy + depends = python-scipy + optdepends = swig + source = cntk-cuda::git+https://github.com/Microsoft/cntk#tag=v2.7 + source = git+https://github.com/onnx/onnx + source = git+https://github.com/Microsoft/onnxruntime + source = git+https://github.com/Microsoft/Multiverso + source = gsl::git+https://github.com/Microsoft/GSL + source = git+https://github.com/google/benchmark + source = git+https://github.com/pybind/pybind11 + source = git+https://github.com/wjakob/clang-cindex-python3 + source = git+https://github.com/HowardHinnant/date + source = git+https://github.com/google/gemmlowp + source = git+https://github.com/google/googletest + source = git+https://github.com/google/nsync + source = git+https://github.com/stevenlix/onnx-tensorrt + source = git+https://github.com/google/protobuf + source = git+https://github.com/google/re2 + source = git+https://github.com/dmlc/tvm + source = git+https://github.com/dmlc/HalideIR + source = git+https://github.com/dmlc/dlpack + source = git+https://github.com/dmlc/dmlc-core + source = dcasgd::git+https://github.com/Microsoft/Delayed-Compensation-Asynchronous-Stochastic-Gradient-Descent-for-Multiverso + md5sums = SKIP + md5sums = SKIP + md5sums = SKIP + md5sums = SKIP + md5sums = SKIP + md5sums = SKIP + md5sums = SKIP + md5sums = SKIP + md5sums = SKIP + md5sums = SKIP + md5sums = SKIP + md5sums = SKIP + md5sums = SKIP + md5sums = SKIP + md5sums = SKIP + md5sums = SKIP + md5sums = SKIP + md5sums = SKIP + md5sums = SKIP + md5sums = SKIP + +pkgname = cntk-cuda + diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..2269feac6eec --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +*/ +*.sw* +*.pkg* +*.tar.gz +*.log diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..56c060c14434 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,171 @@ +# Maintainer: Jingbei Li <i@jingbei.li> +pkgname=cntk-cuda +pkgver=2.7 +pkgrel=1 +pkgdesc="Microsoft Cognitive Toolkit (CNTK), an open source deep-learning toolkit" +arch=('x86_64') +url="https://github.com/Microsoft/cntk" +license=('CUSTOM') +depends=('boost' 'cub' 'cuda' 'cudnn' 'libzip' 'nccl' 'openblas-lapack' 'openmp' 'openmpi' 'protobuf-static' 'python-numpy' 'python-scipy') +makedepends=('cmake' 'gcc7' 'git' 'inetutils' 'python-pip' 'python-setuptools' 'python-wheel' 'swig') +optdepends=('swig') +source=("${pkgname}::git+$url#tag=v$pkgver" + 'git+https://github.com/onnx/onnx' + 'git+https://github.com/Microsoft/onnxruntime' + 'git+https://github.com/Microsoft/Multiverso' + 'gsl::git+https://github.com/Microsoft/GSL' + 'git+https://github.com/google/benchmark' + 'git+https://github.com/pybind/pybind11' + 'git+https://github.com/wjakob/clang-cindex-python3' + 'git+https://github.com/HowardHinnant/date' + 'git+https://github.com/google/gemmlowp' + 'git+https://github.com/google/googletest' + 'git+https://github.com/google/nsync' + 'git+https://github.com/stevenlix/onnx-tensorrt' + 'git+https://github.com/google/protobuf' + 'git+https://github.com/google/re2' + 'git+https://github.com/dmlc/tvm' + 'git+https://github.com/dmlc/HalideIR' + 'git+https://github.com/dmlc/dlpack' + 'git+https://github.com/dmlc/dmlc-core' + 'dcasgd::git+https://github.com/Microsoft/Delayed-Compensation-Asynchronous-Stochastic-Gradient-Descent-for-Multiverso' +) +md5sums=('SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP') + +prepare(){ + cd $srcdir/$pkgname + git config submodule.Source/CNTKv2LibraryDll/proto/onnx/onnx_repo.url $srcdir/onnx + git config submodule.Source/CNTKv2LibraryDll/proto/onnx/onnxruntime.url $srcdir/onnxruntime + git config submodule.Source/Multiverso.url $srcdir/Multiverso + git config submodule.external/gsl.url $srcdir/gsl + git submodule update --init + + cd $srcdir/$pkgname/Source/CNTKv2LibraryDll/proto/onnx/onnx_repo + git config submodule.third_party/benchmark.url $srcdir/benchmark + git config submodule.third_party/pybind11.url $srcdir/pybind11 + git submodule update --init + + cd $srcdir/$pkgname/Source/CNTKv2LibraryDll/proto/onnx/onnx_repo/third_party/pybind11 + git config submodule.tools/clang.url $srcdir/clang-cindex-python3 + git submodule update --init + + cd $srcdir/$pkgname/Source/CNTKv2LibraryDll/proto/onnx/onnxruntime + for i in date gemmlowp googletest gsl nsync onnx onnx-tensorrt re2 tvm + do + git config submodule.cmake/external/$i.url $srcdir/$i + done + git config submodule.external/protobuf.url $srcdir/protobuf + git submodule update --init + + cd $srcdir/$pkgname/Source/CNTKv2LibraryDll/proto/onnx/onnxruntime/cmake/external/onnx + git config submodule.third_party/benchmark.url $srcdir/benchmark + git config submodule.third_party/pybind11.url $srcdir/pybind11 + git submodule update --init + + cd $srcdir/$pkgname/Source/CNTKv2LibraryDll/proto/onnx/onnxruntime/cmake/external/onnx/third_party/pybind11 + git config submodule.tools/clang.url $srcdir/clang-cindex-python3 + git submodule update --init + + cd $srcdir/$pkgname/Source/CNTKv2LibraryDll/proto/onnx/onnxruntime/cmake/external/onnx-tensorrt + git config submodule.third_party/onnx.url $srcdir/onnx + git submodule update --init + + cd $srcdir/$pkgname/Source/CNTKv2LibraryDll/proto/onnx/onnxruntime/cmake/external/onnx-tensorrt/third_party/onnx + git config submodule.third_party/benchmark.url $srcdir/benchmark + git config submodule.third_party/pybind11.url $srcdir/pybind11 + git submodule update --init + + cd $srcdir/$pkgname/Source/CNTKv2LibraryDll/proto/onnx/onnxruntime/cmake/external/onnx-tensorrt/third_party/onnx/third_party/pybind11 + git config submodule.tools/clang.url $srcdir/clang-cindex-python3 + git submodule update --init + + cd $srcdir/$pkgname/Source/CNTKv2LibraryDll/proto/onnx/onnxruntime/cmake/external/protobuf + git config submodule.third_party/benchmark.url $srcdir/benchmark + git config submodule.third_party/googletest.url $srcdir/googletest + git submodule update --init + + cd $srcdir/$pkgname/Source/CNTKv2LibraryDll/proto/onnx/onnxruntime/cmake/external/tvm + git config submodule.HalideIR.url $srcdir/HalideIR + git config submodule.dlpack.url $srcdir/dlpack + git config submodule.dmlc-core.url $srcdir/dmlc-core + git submodule update --init + + cd $srcdir/$pkgname/Source/Multiverso + git config submodule.include/multiverso/updater/dcasgd.url $srcdir/dcasgd + git submodule update --init + + cd $srcdir/$pkgname + git submodule update --init --recursive + + sed \ + -e 's|cuda/include/cudnn.h|include/cudnn.h|' \ + -e 's/36/37/g' \ + -i configure + + # https://github.com/Microsoft/CNTK/issues/62 + sed 's|/var/lock/|/tmp/cntk/|g' -i `grep '/var/lock' . -rIl` + + # https://github.com/Microsoft/CNTK/issues/3191 + sed '120s/.*/return cub::ShuffleIndex<CUB_PTX_WARP_THREADS>(input, srcLane, mask);/' -i Source/Math/CntkBatchNormalization.cuh + + # CUDA 10 + #sed 's|device_functions.h|cuda_runtime_api.h|' -i Source/Math/GPUMatrixCUDAKernels.cuh + + mkdir -p build + sed \ + -e 's|$(CUDNN_PATH)/cuda|$(CUDNN_PATH)|g'\ + -e 's/36/37/g'\ + -i Makefile + sed \ + -e 's|libmpi.so.12|libmpi.so|g' \ + -i bindings/python/cntk/train/distributed.py + + common_flags="--with-build-top=build --with-py37-path --with-swig" + cuda_flags="--with-cuda=/opt/cuda --with-cub=/usr/include --with-gdk-include=/opt/cuda/include --with-gdk-nvml-lib=/opt/cuda/lib64/stubs --with-cudnn=/usr --with-nccl=/usr" + + cd $srcdir/$pkgname + export OMPI_MPICXX=g++-7 + ./configure $common_flags \ + --with-openblas \ + $cuda_flags + +} + +build() { + cd $srcdir/$pkgname/build + export OMPI_MPICXX=g++-7 + make CXXFLAGS='-Wno-sign-compare -fPIC' +} + +package() { + cd $srcdir/$pkgname/build + + mkdir -p $pkgdir/usr + cp -r bin lib $pkgdir/usr + + cd $srcdir/$pkgname/build/python + PIP_CONFIG_FILE=/dev/null pip install --isolated --root="$pkgdir" --ignore-installed --no-deps cntk*-$pkgver-cp37-cp37m-linux_x86_64.whl + + rm -rf $pkgdir/usr/lib/python3.7/site-packages/$pkgname/libs + + install -Dm644 $srcdir/$pkgname/LICENSE.md "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" +} |