From de84f230232f8b036e0933217977ca1d45d69571 Mon Sep 17 00:00:00 2001 From: Sheng Zha Date: Tue, 31 Dec 2019 16:51:31 +0800 Subject: [PATCH] Static Build and CD for mxnet-cu102/mxnet-cu102mkl (#17074) * add cu102 packages * cd job * update dockers * update docker image tag * fix cudnn script * update ar on static build dockers --- cd/Jenkinsfile_cd_pipeline | 2 +- cd/Jenkinsfile_release_job | 2 +- cd/README.md | 4 +- cd/utils/mxnet_base_image.sh | 5 +- ci/docker/Dockerfile.build.ubuntu_gpu_cu100 | 2 +- ci/docker/Dockerfile.build.ubuntu_gpu_cu101 | 2 +- ci/docker/Dockerfile.build.ubuntu_gpu_cu102 | 81 +++++++++ ci/docker/Dockerfile.build.ubuntu_gpu_cu90 | 2 +- ci/docker/Dockerfile.build.ubuntu_gpu_cu92 | 2 +- ci/docker/Dockerfile.publish.ubuntu1404_cpu | 3 + ci/docker/Dockerfile.publish.ubuntu1404_gpu | 3 + ci/docker/install/ubuntu_cudnn.sh | 4 + make/pip/linux_cu102.mk | 188 ++++++++++++++++++++ make/pip/linux_cu102mkl.mk | 173 ++++++++++++++++++ tools/pip/doc/CU101MKL_ADDITIONAL.md | 2 +- tools/pip/doc/CU101_ADDITIONAL.md | 2 +- tools/pip/doc/CU102MKL_ADDITIONAL.md | 46 +++++ tools/pip/doc/CU102_ADDITIONAL.md | 46 +++++ tools/pip/doc/CU75MKL_ADDITIONAL.md | 2 + tools/pip/doc/CU75_ADDITIONAL.md | 2 + tools/pip/doc/CU80MKL_ADDITIONAL.md | 4 + tools/pip/doc/CU80_ADDITIONAL.md | 4 + tools/pip/doc/CU90MKL_ADDITIONAL.md | 2 + tools/pip/doc/CU90_ADDITIONAL.md | 2 + tools/pip/doc/CU92MKL_ADDITIONAL.md | 2 + tools/pip/doc/CU92_ADDITIONAL.md | 2 + tools/pip/setup.py | 6 +- tools/setup_gpu_build_tools.sh | 51 ++++-- 28 files changed, 625 insertions(+), 21 deletions(-) create mode 100644 ci/docker/Dockerfile.build.ubuntu_gpu_cu102 create mode 100644 make/pip/linux_cu102.mk create mode 100644 make/pip/linux_cu102mkl.mk create mode 100644 tools/pip/doc/CU102MKL_ADDITIONAL.md create mode 100644 tools/pip/doc/CU102_ADDITIONAL.md diff --git a/cd/Jenkinsfile_cd_pipeline b/cd/Jenkinsfile_cd_pipeline index afb7b9b6d27f..79b1df0bfcd4 100644 --- a/cd/Jenkinsfile_cd_pipeline +++ b/cd/Jenkinsfile_cd_pipeline @@ -36,7 +36,7 @@ pipeline { parameters { // Release parameters - string(defaultValue: "cpu,mkl,cu90,cu90mkl,cu92,cu92mkl,cu100,cu100mkl,cu101,cu101mkl", description: "Comma separated list of variants", name: "MXNET_VARIANTS") + string(defaultValue: "cpu,mkl,cu90,cu90mkl,cu92,cu92mkl,cu100,cu100mkl,cu101,cu101mkl,cu102,cu102mkl", description: "Comma separated list of variants", name: "MXNET_VARIANTS") booleanParam(defaultValue: false, description: 'Whether this is a release build or not', name: "RELEASE_BUILD") } diff --git a/cd/Jenkinsfile_release_job b/cd/Jenkinsfile_release_job index 4d6f3b5e9012..38620756af41 100644 --- a/cd/Jenkinsfile_release_job +++ b/cd/Jenkinsfile_release_job @@ -43,7 +43,7 @@ pipeline { // any disruption caused by different COMMIT_ID values chaning the job parameter configuration on // Jenkins. string(defaultValue: "mxnet_lib/static", description: "Pipeline to build", name: "RELEASE_JOB_TYPE") - string(defaultValue: "cpu,mkl,cu90,cu90mkl,cu92,cu92mkl,cu100,cu100mkl,cu101,cu101mkl", description: "Comma separated list of variants", name: "MXNET_VARIANTS") + string(defaultValue: "cpu,mkl,cu90,cu90mkl,cu92,cu92mkl,cu100,cu100mkl,cu101,cu101mkl,cu102,cu102mkl", description: "Comma separated list of variants", name: "MXNET_VARIANTS") booleanParam(defaultValue: false, description: 'Whether this is a release build or not', name: "RELEASE_BUILD") } diff --git a/cd/README.md b/cd/README.md index a8e3fb794daf..dccef9add683 100644 --- a/cd/README.md +++ b/cd/README.md @@ -37,8 +37,10 @@ Currently, 10 variants are supported: * *cu92mkl*: CUDA 9.2 w/ MKL-DNN * *cu100*: CUDA 10 * *cu100mkl*: CUDA 10 w/ MKL-DNN -* *cu101*: CUDA 10 +* *cu101*: CUDA 10.1 * *cu101mkl*: CUDA 10.1 w/ MKL-DNN +* *cu102*: CUDA 10.2 +* *cu102mkl*: CUDA 10.2 w/ MKL-DNN *For more on variants, see [here](https://github.com/apache/incubator-mxnet/issues/8671)* diff --git a/cd/utils/mxnet_base_image.sh b/cd/utils/mxnet_base_image.sh index dcfe7216dcb4..c39746797ac9 100755 --- a/cd/utils/mxnet_base_image.sh +++ b/cd/utils/mxnet_base_image.sh @@ -20,7 +20,7 @@ mxnet_variant=${1:?"Please specify the mxnet variant as the first parameter"} -case ${mxnet_variant} in +case ${mxnet_variant} in cu80*) echo "nvidia/cuda:8.0-cudnn7-runtime-ubuntu16.04" ;; @@ -36,6 +36,9 @@ case ${mxnet_variant} in cu101*) echo "nvidia/cuda:10.1-cudnn7-runtime-ubuntu16.04" ;; + cu102*) + echo "nvidia/cuda:10.2-cudnn7-runtime-ubuntu16.04" + ;; cpu) echo "ubuntu:16.04" ;; diff --git a/ci/docker/Dockerfile.build.ubuntu_gpu_cu100 b/ci/docker/Dockerfile.build.ubuntu_gpu_cu100 index 514f6bb1495b..ccf69404ee3a 100644 --- a/ci/docker/Dockerfile.build.ubuntu_gpu_cu100 +++ b/ci/docker/Dockerfile.build.ubuntu_gpu_cu100 @@ -65,7 +65,7 @@ RUN /work/ubuntu_docs.sh COPY install/ubuntu_tutorials.sh /work/ RUN /work/ubuntu_tutorials.sh -ENV CUDNN_VERSION=7.6.0.64 +ENV CUDNN_VERSION=7.6.5.32 COPY install/ubuntu_cudnn.sh /work/ RUN /work/ubuntu_cudnn.sh diff --git a/ci/docker/Dockerfile.build.ubuntu_gpu_cu101 b/ci/docker/Dockerfile.build.ubuntu_gpu_cu101 index 7e0f8d93ed37..a6e59f3435d5 100644 --- a/ci/docker/Dockerfile.build.ubuntu_gpu_cu101 +++ b/ci/docker/Dockerfile.build.ubuntu_gpu_cu101 @@ -65,7 +65,7 @@ RUN /work/ubuntu_docs.sh COPY install/ubuntu_tutorials.sh /work/ RUN /work/ubuntu_tutorials.sh -ENV CUDNN_VERSION=7.5.1.10 +ENV CUDNN_VERSION=7.6.5.32 COPY install/ubuntu_cudnn.sh /work/ RUN /work/ubuntu_cudnn.sh diff --git a/ci/docker/Dockerfile.build.ubuntu_gpu_cu102 b/ci/docker/Dockerfile.build.ubuntu_gpu_cu102 new file mode 100644 index 000000000000..3a6e15bb0f6d --- /dev/null +++ b/ci/docker/Dockerfile.build.ubuntu_gpu_cu102 @@ -0,0 +1,81 @@ +# -*- mode: dockerfile -*- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# Dockerfile to run MXNet on Ubuntu 16.04 for GPU + +FROM nvidia/cuda:10.2-devel-ubuntu16.04 + +WORKDIR /work/deps + +COPY install/ubuntu_core.sh /work/ +RUN /work/ubuntu_core.sh + +COPY install/deb_ubuntu_ccache.sh /work/ +RUN /work/deb_ubuntu_ccache.sh + +COPY install/ubuntu_python.sh /work/ +COPY install/requirements /work/ +RUN /work/ubuntu_python.sh + +COPY install/ubuntu_scala.sh /work/ +COPY install/sbt.gpg /work/ +RUN /work/ubuntu_scala.sh + +COPY install/ubuntu_r.sh /work/ +COPY install/r.gpg /work/ +RUN /work/ubuntu_r.sh + +COPY install/ubuntu_perl.sh /work/ +RUN /work/ubuntu_perl.sh + +COPY install/ubuntu_clang.sh /work/ +RUN /work/ubuntu_clang.sh + +COPY install/ubuntu_tvm.sh /work/ +RUN /work/ubuntu_tvm.sh + +COPY install/ubuntu_llvm.sh /work/ +RUN /work/ubuntu_llvm.sh + +COPY install/ubuntu_caffe.sh /work/ +RUN /work/ubuntu_caffe.sh + +COPY install/ubuntu_onnx.sh /work/ +RUN /work/ubuntu_onnx.sh + +COPY install/ubuntu_docs.sh /work/ +COPY install/requirements /work/ +RUN /work/ubuntu_docs.sh + +COPY install/ubuntu_tutorials.sh /work/ +RUN /work/ubuntu_tutorials.sh + +ENV CUDNN_VERSION=7.6.5.32 +COPY install/ubuntu_cudnn.sh /work/ +RUN /work/ubuntu_cudnn.sh + +# Always last +ARG USER_ID=0 +ARG GROUP_ID=0 +COPY install/ubuntu_adduser.sh /work/ +RUN /work/ubuntu_adduser.sh + +COPY runtime_functions.sh /work/ + +WORKDIR /work/mxnet +ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/cuda/compat diff --git a/ci/docker/Dockerfile.build.ubuntu_gpu_cu90 b/ci/docker/Dockerfile.build.ubuntu_gpu_cu90 index 579ad7bffddf..e1fe585d75bf 100644 --- a/ci/docker/Dockerfile.build.ubuntu_gpu_cu90 +++ b/ci/docker/Dockerfile.build.ubuntu_gpu_cu90 @@ -65,7 +65,7 @@ RUN /work/ubuntu_docs.sh COPY install/ubuntu_tutorials.sh /work/ RUN /work/ubuntu_tutorials.sh -ENV CUDNN_VERSION=7.6.0.64 +ENV CUDNN_VERSION=7.6.5.32 COPY install/ubuntu_cudnn.sh /work/ RUN /work/ubuntu_cudnn.sh diff --git a/ci/docker/Dockerfile.build.ubuntu_gpu_cu92 b/ci/docker/Dockerfile.build.ubuntu_gpu_cu92 index dc125aee371d..0de9d87c6516 100644 --- a/ci/docker/Dockerfile.build.ubuntu_gpu_cu92 +++ b/ci/docker/Dockerfile.build.ubuntu_gpu_cu92 @@ -65,7 +65,7 @@ RUN /work/ubuntu_docs.sh COPY install/ubuntu_tutorials.sh /work/ RUN /work/ubuntu_tutorials.sh -ENV CUDNN_VERSION=7.6.0.64 +ENV CUDNN_VERSION=7.6.5.32 COPY install/ubuntu_cudnn.sh /work/ RUN /work/ubuntu_cudnn.sh diff --git a/ci/docker/Dockerfile.publish.ubuntu1404_cpu b/ci/docker/Dockerfile.publish.ubuntu1404_cpu index 04ce94f95eae..993d9d873075 100644 --- a/ci/docker/Dockerfile.publish.ubuntu1404_cpu +++ b/ci/docker/Dockerfile.publish.ubuntu1404_cpu @@ -25,6 +25,9 @@ WORKDIR /work/deps COPY install/ubuntu_publish.sh /work/ RUN /work/ubuntu_publish.sh +COPY install/ubuntu_ar.sh /work/ +RUN /work/ubuntu_ar.sh + ARG USER_ID=0 ARG GROUP_ID=0 COPY install/ubuntu_adduser.sh /work/ diff --git a/ci/docker/Dockerfile.publish.ubuntu1404_gpu b/ci/docker/Dockerfile.publish.ubuntu1404_gpu index 4d9fa819a39e..eb214a620009 100644 --- a/ci/docker/Dockerfile.publish.ubuntu1404_gpu +++ b/ci/docker/Dockerfile.publish.ubuntu1404_gpu @@ -25,6 +25,9 @@ WORKDIR /work/deps COPY install/ubuntu_publish.sh /work/ RUN /work/ubuntu_publish.sh +COPY install/ubuntu_ar.sh /work/ +RUN /work/ubuntu_ar.sh + ARG USER_ID=0 ARG GROUP_ID=0 COPY install/ubuntu_adduser.sh /work/ diff --git a/ci/docker/install/ubuntu_cudnn.sh b/ci/docker/install/ubuntu_cudnn.sh index b773fea0f82f..eaf50447305c 100755 --- a/ci/docker/install/ubuntu_cudnn.sh +++ b/ci/docker/install/ubuntu_cudnn.sh @@ -32,6 +32,10 @@ fi apt-get update || true case ${CUDA_VERSION} in + 10\.2*) + export libcudnn7_version="${CUDNN_VERSION}-1+cuda10.2" + export libcudnn7_dev_version="${CUDNN_VERSION}-1+cuda10.2" + ;; 10\.1*) export libcudnn7_version="${CUDNN_VERSION}-1+cuda10.1" export libcudnn7_dev_version="${CUDNN_VERSION}-1+cuda10.1" diff --git a/make/pip/linux_cu102.mk b/make/pip/linux_cu102.mk new file mode 100644 index 000000000000..7e2a46e3b411 --- /dev/null +++ b/make/pip/linux_cu102.mk @@ -0,0 +1,188 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +#------------------------------------------------------------------------------- +# Template configuration for compiling mxnet for making python wheel +#------------------------------------------------------------------------------- + +#--------------------- +# choice of compiler +#-------------------- + +export CC = gcc +export CXX = g++ +export NVCC = nvcc + +# whether compile with options for MXNet developer +DEV = 0 + +# whether compile with debug +DEBUG = 0 + +# whether to turn on signal handler (e.g. segfault logger) +USE_SIGNAL_HANDLER = 1 + +# the additional link flags you want to add +ADD_LDFLAGS += -L$(DEPS_PATH)/lib $(DEPS_PATH)/lib/libculibos.a -lpng -ltiff -ljpeg -lz -ldl -lgfortran -Wl,--version-script=$(CURDIR)/make/config/libmxnet.ver,-rpath,'$${ORIGIN}',--gc-sections + +# the additional compile flags you want to add +ADD_CFLAGS += -I$(DEPS_PATH)/include -ffunction-sections -fdata-sections + +#--------------------------------------------- +# matrix computation libraries for CPU/GPU +#--------------------------------------------- + +# choose the version of blas you want to use +# can be: mkl, blas, atlas, openblas +# in default use atlas for linux while apple for osx +USE_BLAS=openblas + +# whether use opencv during compilation +# you can disable it, however, you will not able to use +# imbin iterator +USE_OPENCV = 1 +# Add OpenCV include path, in which the directory `opencv2` exists +USE_OPENCV_INC_PATH = NONE +# Add OpenCV shared library path, in which the shared library exists +USE_OPENCV_LIB_PATH = NONE + +# whether use CUDA during compile +USE_CUDA = 1 + +# add the path to CUDA library to link and compile flag +# if you have already add them to environment variable, leave it as NONE +# USE_CUDA_PATH = /usr/local/cuda +USE_CUDA_PATH = $(DEPS_PATH)/usr/local/cuda-10.2 + +# whether to use CuDNN library +USE_CUDNN = 1 + +# whether to use NCCL library +USE_NCCL = 1 + +# CUDA architecture setting: going with all of them. +# For CUDA < 6.0, comment the *_50 lines for compatibility. +# CUDA_ARCH := + +# whether use cuda runtime compiling for writing kernels in native language (i.e. Python) +ENABLE_CUDA_RTC = 1 + +USE_NVTX=1 + +# use openmp for parallelization +USE_OPENMP = 1 +USE_OPERATOR_TUNING = 1 +USE_LIBJPEG_TURBO = 1 + +# whether use MKL-DNN library +USE_MKLDNN = 0 + + +# MKL ML Library for Intel CPU/Xeon Phi +# Please refer to MKL_README.md for details + +# MKL ML Library folder, need to be root for /usr/local +# Change to User Home directory for standard user +# For USE_BLAS!=mkl only +MKLML_ROOT=/usr/local + +# whether use MKL2017 library +USE_MKL2017 = 0 + +# whether use MKL2017 experimental feature for high performance +# Prerequisite USE_MKL2017=1 +USE_MKL2017_EXPERIMENTAL = 0 + +# whether use NNPACK library +USE_NNPACK = 0 + +# whether use lapack during compilation +# only effective when compiled with blas versions openblas/apple/atlas/mkl +USE_LAPACK = 1 + +# path to lapack library in case of a non-standard installation +USE_LAPACK_PATH = $(DEPS_PATH)/lib + +# add path to intel library, you may need it for MKL, if you did not add the path +# to environment variable +USE_INTEL_PATH = NONE + +# If use MKL, choose static link automatically to allow python wrapper +ifeq ($(USE_BLAS), mkl) +USE_STATIC_MKL = 1 +else +USE_STATIC_MKL = NONE +endif + +#---------------------------- +# Settings for power and arm arch +#---------------------------- +ARCH := $(shell uname -a) +ifneq (,$(filter $(ARCH), armv6l armv7l powerpc64le ppc64le aarch64)) + USE_SSE=0 +else + USE_SSE=1 +endif + +#---------------------------- +# distributed computing +#---------------------------- + +# whether or not to enable multi-machine supporting +USE_DIST_KVSTORE = 1 + +# whether or not allow to read and write HDFS directly. If yes, then hadoop is +# required +USE_HDFS = 0 + +# path to libjvm.so. required if USE_HDFS=1 +LIBJVM=$(JAVA_HOME)/jre/lib/amd64/server + +# whether or not allow to read and write AWS S3 directly. If yes, then +# libcurl4-openssl-dev is required, it can be installed on Ubuntu by +# sudo apt-get install -y libcurl4-openssl-dev +USE_S3 = 1 + +#---------------------------- +# additional operators +#---------------------------- + +# path to folders containing projects specific operators that you don't want to put in src/operators +EXTRA_OPERATORS = + + +#---------------------------- +# plugins +#---------------------------- + +# whether to use caffe integration. This requires installing caffe. +# You also need to add CAFFE_PATH/build/lib to your LD_LIBRARY_PATH +# CAFFE_PATH = $(HOME)/caffe +# MXNET_PLUGINS += plugin/caffe/caffe.mk + +# whether to use torch integration. This requires installing torch. +# You also need to add TORCH_PATH/install/lib to your LD_LIBRARY_PATH +# TORCH_PATH = $(HOME)/torch +# MXNET_PLUGINS += plugin/torch/torch.mk + +# WARPCTC_PATH = $(HOME)/warp-ctc +# MXNET_PLUGINS += plugin/warpctc/warpctc.mk + +# whether to use sframe integration. This requires build sframe +# git@github.com:dato-code/SFrame.git +# SFRAME_PATH = $(HOME)/SFrame +# MXNET_PLUGINS += plugin/sframe/plugin.mk diff --git a/make/pip/linux_cu102mkl.mk b/make/pip/linux_cu102mkl.mk new file mode 100644 index 000000000000..4bc649fb5423 --- /dev/null +++ b/make/pip/linux_cu102mkl.mk @@ -0,0 +1,173 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +#------------------------------------------------------------------------------- +# Template configuration for compiling mxnet for making python wheel +#------------------------------------------------------------------------------- + +#--------------------- +# choice of compiler +#-------------------- + +export CC = gcc +export CXX = g++ +export NVCC = nvcc + +# whether compile with options for MXNet developer +DEV = 0 + +# whether compile with debug +DEBUG = 0 + +# whether to turn on signal handler (e.g. segfault logger) +USE_SIGNAL_HANDLER = 1 + +# the additional link flags you want to add +ADD_LDFLAGS += -L$(DEPS_PATH)/lib $(DEPS_PATH)/lib/libculibos.a -lpng -ltiff -ljpeg -lz -ldl -lgfortran -Wl,--version-script=$(CURDIR)/make/config/libmxnet.ver,-rpath,'$${ORIGIN}',--gc-sections + +# the additional compile flags you want to add +ADD_CFLAGS += -I$(DEPS_PATH)/include -ffunction-sections -fdata-sections + +#--------------------------------------------- +# matrix computation libraries for CPU/GPU +#--------------------------------------------- + +# choose the version of blas you want to use +# can be: mkl, blas, atlas, openblas +# in default use atlas for linux while apple for osx +USE_BLAS=openblas + +# whether use opencv during compilation +# you can disable it, however, you will not able to use +# imbin iterator +USE_OPENCV = 1 +# Add OpenCV include path, in which the directory `opencv2` exists +USE_OPENCV_INC_PATH = NONE +# Add OpenCV shared library path, in which the shared library exists +USE_OPENCV_LIB_PATH = NONE + +# whether use CUDA during compile +USE_CUDA = 1 + +# add the path to CUDA library to link and compile flag +# if you have already add them to environment variable, leave it as NONE +# USE_CUDA_PATH = /usr/local/cuda +USE_CUDA_PATH = $(DEPS_PATH)/usr/local/cuda-10.2 + +# whether to use CuDNN library +USE_CUDNN = 1 + +# whether to use NCCL library +USE_NCCL = 1 + +# CUDA architecture setting: going with all of them. +# For CUDA < 6.0, comment the *_50 lines for compatibility. +# CUDA_ARCH := + +# whether use cuda runtime compiling for writing kernels in native language (i.e. Python) +ENABLE_CUDA_RTC = 1 + +USE_NVTX=1 + +# use openmp for parallelization +USE_OPENMP = 1 +USE_OPERATOR_TUNING = 1 +USE_LIBJPEG_TURBO = 1 + +# whether use MKL-DNN library +USE_MKLDNN = 1 + +# whether use NNPACK library +USE_NNPACK = 0 + +# whether use lapack during compilation +# only effective when compiled with blas versions openblas/apple/atlas/mkl +USE_LAPACK = 1 + +# path to lapack library in case of a non-standard installation +USE_LAPACK_PATH = $(DEPS_PATH)/lib + +# add path to intel library, you may need it for MKL, if you did not add the path +# to environment variable +USE_INTEL_PATH = NONE + +# If use MKL, choose static link automatically to allow python wrapper +ifeq ($(USE_BLAS), mkl) +USE_STATIC_MKL = 1 +else +USE_STATIC_MKL = NONE +endif + +#---------------------------- +# Settings for power and arm arch +#---------------------------- +ARCH := $(shell uname -a) +ifneq (,$(filter $(ARCH), armv6l armv7l powerpc64le ppc64le aarch64)) + USE_SSE=0 +else + USE_SSE=1 +endif + +#---------------------------- +# distributed computing +#---------------------------- + +# whether or not to enable multi-machine supporting +USE_DIST_KVSTORE = 1 + +# whether or not allow to read and write HDFS directly. If yes, then hadoop is +# required +USE_HDFS = 0 + +# path to libjvm.so. required if USE_HDFS=1 +LIBJVM=$(JAVA_HOME)/jre/lib/amd64/server + +# whether or not allow to read and write AWS S3 directly. If yes, then +# libcurl4-openssl-dev is required, it can be installed on Ubuntu by +# sudo apt-get install -y libcurl4-openssl-dev +USE_S3 = 1 + +#---------------------------- +# additional operators +#---------------------------- + +# path to folders containing projects specific operators that you don't want to put in src/operators +EXTRA_OPERATORS = + + +#---------------------------- +# plugins +#---------------------------- + +# whether to use caffe integration. This requires installing caffe. +# You also need to add CAFFE_PATH/build/lib to your LD_LIBRARY_PATH +# CAFFE_PATH = $(HOME)/caffe +# MXNET_PLUGINS += plugin/caffe/caffe.mk + +# whether to use torch integration. This requires installing torch. +# You also need to add TORCH_PATH/install/lib to your LD_LIBRARY_PATH +# TORCH_PATH = $(HOME)/torch +# MXNET_PLUGINS += plugin/torch/torch.mk + +# WARPCTC_PATH = $(HOME)/warp-ctc +# MXNET_PLUGINS += plugin/warpctc/warpctc.mk + +# whether to use sframe integration. This requires build sframe +# git@github.com:dato-code/SFrame.git +# SFRAME_PATH = $(HOME)/SFrame +# MXNET_PLUGINS += plugin/sframe/plugin.mk + diff --git a/tools/pip/doc/CU101MKL_ADDITIONAL.md b/tools/pip/doc/CU101MKL_ADDITIONAL.md index 9cdebe3dddbb..028cc2556425 100644 --- a/tools/pip/doc/CU101MKL_ADDITIONAL.md +++ b/tools/pip/doc/CU101MKL_ADDITIONAL.md @@ -40,5 +40,5 @@ Installation ------------ To install: ```bash -pip install mxnet-cu100mkl +pip install mxnet-cu101mkl ``` diff --git a/tools/pip/doc/CU101_ADDITIONAL.md b/tools/pip/doc/CU101_ADDITIONAL.md index f58413c09e72..7d9ae5bcfc12 100644 --- a/tools/pip/doc/CU101_ADDITIONAL.md +++ b/tools/pip/doc/CU101_ADDITIONAL.md @@ -40,5 +40,5 @@ Installation ------------ To install: ```bash -pip install mxnet-cu100 +pip install mxnet-cu101 ``` diff --git a/tools/pip/doc/CU102MKL_ADDITIONAL.md b/tools/pip/doc/CU102MKL_ADDITIONAL.md new file mode 100644 index 000000000000..07be16b2f462 --- /dev/null +++ b/tools/pip/doc/CU102MKL_ADDITIONAL.md @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + +Prerequisites +------------- +This package supports Linux and Windows platforms. You may also want to check: +- [mxnet-cu102](https://pypi.python.org/pypi/mxnet-cu102/) with CUDA-10.2 support. +- [mxnet-cu101](https://pypi.python.org/pypi/mxnet-cu101/) with CUDA-10.1 support. +- [mxnet-cu101mkl](https://pypi.python.org/pypi/mxnet-cu101mkl/) with CUDA-10.1 and MKLDNN support. +- [mxnet-cu100](https://pypi.python.org/pypi/mxnet-cu100/) with CUDA-10.0 support. +- [mxnet-cu100mkl](https://pypi.python.org/pypi/mxnet-cu100mkl/) with CUDA-10.0 support and MKLDNN support. +- [mxnet-cu92](https://pypi.python.org/pypi/mxnet-cu92/) with CUDA-9.2 support. +- [mxnet-cu92mkl](https://pypi.python.org/pypi/mxnet-cu92mkl/) with CUDA-9.2 support and MKLDNN support. +- [mxnet-cu90](https://pypi.python.org/pypi/mxnet-cu90/) with CUDA-9.0 support. +- [mxnet-cu90mkl](https://pypi.python.org/pypi/mxnet-cu90mkl/) with CUDA-9.0 support and MKLDNN support. +- [mxnet-cu80](https://pypi.python.org/pypi/mxnet-cu80/) with CUDA-8.0 support. +- [mxnet-cu80mkl](https://pypi.python.org/pypi/mxnet-cu80mkl/) with CUDA-8.0 support and MKLDNN support. +- [mxnet-cu75](https://pypi.python.org/pypi/mxnet-cu75/) with CUDA-7.5 support. +- [mxnet-cu75mkl](https://pypi.python.org/pypi/mxnet-cu75mkl/) with CUDA-7.5 support and MKLDNN support. +- [mxnet-mkl](https://pypi.python.org/pypi/mxnet-mkl/) with MKLDNN support. +- [mxnet](https://pypi.python.org/pypi/mxnet/). + +To download CUDA, check [CUDA download](https://developer.nvidia.com/cuda-downloads). For more instructions, check [CUDA Toolkit online documentation](http://docs.nvidia.com/cuda/index.html). + +To install for other platforms (e.g. Windows, Raspberry Pi/ARM) or other versions of CUDA, check [Installing MXNet](https://mxnet.incubator.apache.org/versions/master/install/index.html) for instructions on building from source. + +Installation +------------ +To install: +```bash +pip install mxnet-cu102mkl +``` diff --git a/tools/pip/doc/CU102_ADDITIONAL.md b/tools/pip/doc/CU102_ADDITIONAL.md new file mode 100644 index 000000000000..c9efd4b64118 --- /dev/null +++ b/tools/pip/doc/CU102_ADDITIONAL.md @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + +Prerequisites +------------- +This package supports Linux and Windows platforms. You may also want to check: +- [mxnet-cu102mkl](https://pypi.python.org/pypi/mxnet-cu102/) with CUDA-10.2 support and MKLDNN support. +- [mxnet-cu101](https://pypi.python.org/pypi/mxnet-cu101/) with CUDA-10.1 support. +- [mxnet-cu101mkl](https://pypi.python.org/pypi/mxnet-cu101mkl/) with CUDA-10.1 support and MKLDNN support. +- [mxnet-cu100](https://pypi.python.org/pypi/mxnet-cu100mkl/) with CUDA-10.0 support. +- [mxnet-cu100mkl](https://pypi.python.org/pypi/mxnet-cu100mkl/) with CUDA-10.0 support and MKLDNN support. +- [mxnet-cu92](https://pypi.python.org/pypi/mxnet-cu92/) with CUDA-9.2 support. +- [mxnet-cu92mkl](https://pypi.python.org/pypi/mxnet-cu92mkl/) with CUDA-9.2 support and MKLDNN support. +- [mxnet-cu90](https://pypi.python.org/pypi/mxnet-cu90/) with CUDA-9.0 support. +- [mxnet-cu90mkl](https://pypi.python.org/pypi/mxnet-cu90mkl/) with CUDA-9.0 support and MKLDNN support. +- [mxnet-cu80](https://pypi.python.org/pypi/mxnet-cu80/) with CUDA-8.0 support. +- [mxnet-cu80mkl](https://pypi.python.org/pypi/mxnet-cu80mkl/) with CUDA-8.0 support and MKLDNN support. +- [mxnet-cu75](https://pypi.python.org/pypi/mxnet-cu75/) with CUDA-7.5 support. +- [mxnet-cu75mkl](https://pypi.python.org/pypi/mxnet-cu75mkl/) with CUDA-7.5 support and MKLDNN support. +- [mxnet-mkl](https://pypi.python.org/pypi/mxnet-mkl/) with MKLDNN support. +- [mxnet](https://pypi.python.org/pypi/mxnet/). + +To download CUDA, check [CUDA download](https://developer.nvidia.com/cuda-downloads). For more instructions, check [CUDA Toolkit online documentation](http://docs.nvidia.com/cuda/index.html). + +To install for other platforms (e.g. Windows, Raspberry Pi/ARM) or other versions, check [Installing MXNet](https://mxnet.incubator.apache.org/versions/master/install/index.html) for instructions on building from source. + +Installation +------------ +To install: +```bash +pip install mxnet-cu102 +``` diff --git a/tools/pip/doc/CU75MKL_ADDITIONAL.md b/tools/pip/doc/CU75MKL_ADDITIONAL.md index dc485d687f1e..cb74a01f11d3 100644 --- a/tools/pip/doc/CU75MKL_ADDITIONAL.md +++ b/tools/pip/doc/CU75MKL_ADDITIONAL.md @@ -15,6 +15,8 @@ +**CUDA 7.5 package for MXNet is no longer maintained for new releases.** + Prerequisites ------------- This package supports Linux only, up to 1.2.1. You may also want to check: diff --git a/tools/pip/doc/CU75_ADDITIONAL.md b/tools/pip/doc/CU75_ADDITIONAL.md index a5257913adc5..53665ce33d42 100644 --- a/tools/pip/doc/CU75_ADDITIONAL.md +++ b/tools/pip/doc/CU75_ADDITIONAL.md @@ -15,6 +15,8 @@ +**CUDA 7.5 package for MXNet is no longer maintained for new releases.** + Prerequisites ------------- This package supports Linux only, up to 1.2.1. You may also want to check: diff --git a/tools/pip/doc/CU80MKL_ADDITIONAL.md b/tools/pip/doc/CU80MKL_ADDITIONAL.md index 24cec2b93668..e4f73f94850f 100644 --- a/tools/pip/doc/CU80MKL_ADDITIONAL.md +++ b/tools/pip/doc/CU80MKL_ADDITIONAL.md @@ -15,9 +15,13 @@ +**CUDA 8.0 package for MXNet is no longer maintained for new releases.** + Prerequisites ------------- This package supports Linux and Windows platforms. You may also want to check: +- [mxnet-cu102](https://pypi.python.org/pypi/mxnet-cu102/) with CUDA-10.2 support. +- [mxnet-cu102mkl](https://pypi.python.org/pypi/mxnet-cu102mkl/) with CUDA-10.2 support and MKLDNN support. - [mxnet-cu101](https://pypi.python.org/pypi/mxnet-cu101mkl/) with CUDA-10.1 support. - [mxnet-cu101mkl](https://pypi.python.org/pypi/mxnet-cu101mkl/) with CUDA-10.1 support and MKLDNN support. - [mxnet-cu100](https://pypi.python.org/pypi/mxnet-cu100mkl/) with CUDA-10.0 support. diff --git a/tools/pip/doc/CU80_ADDITIONAL.md b/tools/pip/doc/CU80_ADDITIONAL.md index 767f034e120e..23e5c2ea56d0 100644 --- a/tools/pip/doc/CU80_ADDITIONAL.md +++ b/tools/pip/doc/CU80_ADDITIONAL.md @@ -15,9 +15,13 @@ +**CUDA 8.0 package for MXNet is no longer maintained for new releases.** + Prerequisites ------------- This package supports Linux and Windows platforms. You may also want to check: +- [mxnet-cu102](https://pypi.python.org/pypi/mxnet-cu102/) with CUDA-10.2 support. +- [mxnet-cu102mkl](https://pypi.python.org/pypi/mxnet-cu102mkl/) with CUDA-10.2 support and MKLDNN support. - [mxnet-cu101](https://pypi.python.org/pypi/mxnet-cu101mkl/) with CUDA-10.1 support. - [mxnet-cu101mkl](https://pypi.python.org/pypi/mxnet-cu101mkl/) with CUDA-10.1 support and MKLDNN support. - [mxnet-cu100](https://pypi.python.org/pypi/mxnet-cu100mkl/) with CUDA-10.0 support. diff --git a/tools/pip/doc/CU90MKL_ADDITIONAL.md b/tools/pip/doc/CU90MKL_ADDITIONAL.md index 66f18d35ef73..27cd5c3d8619 100644 --- a/tools/pip/doc/CU90MKL_ADDITIONAL.md +++ b/tools/pip/doc/CU90MKL_ADDITIONAL.md @@ -18,6 +18,8 @@ Prerequisites ------------- This package supports Linux and Windows platforms. You may want to check: +- [mxnet-cu102](https://pypi.python.org/pypi/mxnet-cu102/) with CUDA-10.2 support. +- [mxnet-cu102mkl](https://pypi.python.org/pypi/mxnet-cu102mkl/) with CUDA-10.2 support and MKLDNN support. - [mxnet-cu101](https://pypi.python.org/pypi/mxnet-cu101mkl/) with CUDA-10.1 support. - [mxnet-cu101mkl](https://pypi.python.org/pypi/mxnet-cu101mkl/) with CUDA-10.1 support and MKLDNN support. - [mxnet-cu100](https://pypi.python.org/pypi/mxnet-cu100mkl/) with CUDA-10.0 support. diff --git a/tools/pip/doc/CU90_ADDITIONAL.md b/tools/pip/doc/CU90_ADDITIONAL.md index f21b77019d12..8fb007eac867 100644 --- a/tools/pip/doc/CU90_ADDITIONAL.md +++ b/tools/pip/doc/CU90_ADDITIONAL.md @@ -18,6 +18,8 @@ Prerequisites ------------- This package supports Linux and Windows platforms. You may also want to check: +- [mxnet-cu102](https://pypi.python.org/pypi/mxnet-cu102/) with CUDA-10.2 support. +- [mxnet-cu102mkl](https://pypi.python.org/pypi/mxnet-cu102mkl/) with CUDA-10.2 support and MKLDNN support. - [mxnet-cu101](https://pypi.python.org/pypi/mxnet-cu101mkl/) with CUDA-10.1 support. - [mxnet-cu101mkl](https://pypi.python.org/pypi/mxnet-cu101mkl/) with CUDA-10.1 support and MKLDNN support. - [mxnet-cu100](https://pypi.python.org/pypi/mxnet-cu100mkl/) with CUDA-10.0 support. diff --git a/tools/pip/doc/CU92MKL_ADDITIONAL.md b/tools/pip/doc/CU92MKL_ADDITIONAL.md index a4e64f55bde9..840159053db7 100644 --- a/tools/pip/doc/CU92MKL_ADDITIONAL.md +++ b/tools/pip/doc/CU92MKL_ADDITIONAL.md @@ -18,6 +18,8 @@ Prerequisites ------------- This package supports Linux and Windows platforms. You may also want to check: +- [mxnet-cu102](https://pypi.python.org/pypi/mxnet-cu102/) with CUDA-10.2 support. +- [mxnet-cu102mkl](https://pypi.python.org/pypi/mxnet-cu102mkl/) with CUDA-10.2 support and MKLDNN support. - [mxnet-cu101](https://pypi.python.org/pypi/mxnet-cu101mkl/) with CUDA-10.1 support. - [mxnet-cu101mkl](https://pypi.python.org/pypi/mxnet-cu101mkl/) with CUDA-10.1 support and MKLDNN support. - [mxnet-cu100](https://pypi.python.org/pypi/mxnet-cu100mkl/) with CUDA-10.0 support. diff --git a/tools/pip/doc/CU92_ADDITIONAL.md b/tools/pip/doc/CU92_ADDITIONAL.md index 849245de72c9..0485e3075c6f 100644 --- a/tools/pip/doc/CU92_ADDITIONAL.md +++ b/tools/pip/doc/CU92_ADDITIONAL.md @@ -18,6 +18,8 @@ Prerequisites ------------- This package supports Linux and Windows platforms. You may also want to check: +- [mxnet-cu102](https://pypi.python.org/pypi/mxnet-cu102/) with CUDA-10.2 support. +- [mxnet-cu102mkl](https://pypi.python.org/pypi/mxnet-cu102mkl/) with CUDA-10.2 support and MKLDNN support. - [mxnet-cu101](https://pypi.python.org/pypi/mxnet-cu101mkl/) with CUDA-10.1 support. - [mxnet-cu101mkl](https://pypi.python.org/pypi/mxnet-cu101mkl/) with CUDA-10.1 support and MKLDNN support. - [mxnet-cu100](https://pypi.python.org/pypi/mxnet-cu100mkl/) with CUDA-10.0 support. diff --git a/tools/pip/setup.py b/tools/pip/setup.py index dd430f5a6f87..b2fd88a6fb1c 100644 --- a/tools/pip/setup.py +++ b/tools/pip/setup.py @@ -126,7 +126,11 @@ def has_ext_modules(self): if variant == 'CPU': libraries.append('openblas') else: - if variant.startswith('CU100'): + if variant.startswith('CU102'): + libraries.append('CUDA-10.2') + elif variant.startswith('CU101'): + libraries.append('CUDA-10.1') + elif variant.startswith('CU100'): libraries.append('CUDA-10.0') elif variant.startswith('CU92'): libraries.append('CUDA-9.2') diff --git a/tools/setup_gpu_build_tools.sh b/tools/setup_gpu_build_tools.sh index fa5596fc66b8..bba37108b98b 100755 --- a/tools/setup_gpu_build_tools.sh +++ b/tools/setup_gpu_build_tools.sh @@ -27,24 +27,30 @@ VARIANT=$1 DEPS_PATH=$2 >&2 echo "Setting CUDA versions for $VARIANT" -if [[ $VARIANT == cu101* ]]; then +if [[ $VARIANT == cu102* ]]; then + CUDA_VERSION='10.2.89-1' + CUDA_PATCH_VERSION='10.2.2.89-1' + LIBCUDA_VERSION='440.33.01-0ubuntu1' + LIBCUDNN_VERSION='7.6.5.32-1+cuda10.2' + LIBNCCL_VERSION='2.5.6-1+cuda10.2' +elif [[ $VARIANT == cu101* ]]; then CUDA_VERSION='10.1.105-1' CUDA_PATCH_VERSION='10.1.0.105-1' LIBCUDA_VERSION='418.39-0ubuntu1' - LIBCUDNN_VERSION='7.6.0.64-1+cuda10.1' - LIBNCCL_VERSION='2.4.7-1+cuda10.1' + LIBCUDNN_VERSION='7.6.5.32-1+cuda10.1' + LIBNCCL_VERSION='2.5.6-1+cuda10.1' elif [[ $VARIANT == cu100* ]]; then CUDA_VERSION='10.0.130-1' CUDA_PATCH_VERSION='10.0.130-1' LIBCUDA_VERSION='410.48-0ubuntu1' - LIBCUDNN_VERSION='7.6.0.64-1+cuda10.0' - LIBNCCL_VERSION='2.4.7-1+cuda10.0' + LIBCUDNN_VERSION='7.6.5.32-1+cuda10.0' + LIBNCCL_VERSION='2.5.6-1+cuda10.0' elif [[ $VARIANT == cu92* ]]; then CUDA_VERSION='9.2.148-1' CUDA_PATCH_VERSION='9.2.148.1-1' LIBCUDA_VERSION='396.44-0ubuntu1' - LIBCUDNN_VERSION='7.6.0.64-1+cuda9.2' - LIBNCCL_VERSION='2.4.7-1+cuda9.2' + LIBCUDNN_VERSION='7.6.5.32-1+cuda9.2' + LIBNCCL_VERSION='2.4.8-1+cuda9.2' elif [[ $VARIANT == cu91* ]]; then CUDA_VERSION='9.1.85-1' CUDA_PATCH_VERSION='9.1.85.3-1' @@ -55,8 +61,8 @@ elif [[ $VARIANT == cu90* ]]; then CUDA_VERSION='9.0.176-1' CUDA_PATCH_VERSION='9.0.176.3-1' LIBCUDA_VERSION='384.145-0ubuntu1' - LIBCUDNN_VERSION='7.6.0.64-1+cuda9.0' - LIBNCCL_VERSION='2.4.7-1+cuda9.0' + LIBCUDNN_VERSION='7.6.5.32-1+cuda9.0' + LIBNCCL_VERSION='2.5.6-1+cuda9.0' elif [[ $VARIANT == cu80* ]]; then CUDA_VERSION='8.0.61-1' CUDA_PATCH_VERSION='8.0.61.2-1' @@ -92,7 +98,32 @@ if [[ $VARIANT == cu* ]]; then fi # list of debs to download from nvidia -if [[ $VARIANT == cu101* ]]; then +if [[ $VARIANT == cu102* ]]; then + cuda_files=( \ + "cuda-core-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \ + "libcublas10_${CUDA_PATCH_VERSION}_amd64.deb" \ + "libcublas-dev_${CUDA_PATCH_VERSION}_amd64.deb" \ + "cuda-cudart-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \ + "cuda-cudart-dev-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \ + "cuda-curand-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \ + "cuda-curand-dev-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \ + "cuda-cufft-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \ + "cuda-cufft-dev-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \ + "cuda-nvrtc-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \ + "cuda-nvrtc-dev-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \ + "cuda-cusolver-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \ + "cuda-cusolver-dev-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \ + "cuda-misc-headers-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \ + "cuda-nvcc-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \ + "cuda-nvtx-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \ + "libcuda1-${LIBCUDA_MAJOR}_${LIBCUDA_VERSION}_amd64.deb" \ + "nvidia-${LIBCUDA_MAJOR}_${LIBCUDA_VERSION}_amd64.deb" \ + ) + ml_files=( \ + "libcudnn${LIBCUDNN_MAJOR}-dev_${LIBCUDNN_VERSION}_amd64.deb" \ + "libnccl-dev_${LIBNCCL_VERSION}_amd64.deb" \ + ) +elif [[ $VARIANT == cu101* ]]; then cuda_files=( \ "cuda-core-${CUDA_MAJOR_DASH}_${CUDA_VERSION}_amd64.deb" \ "libcublas10_${CUDA_PATCH_VERSION}_amd64.deb" \