Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions 3rdparty/mshadow/mshadow/tensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,10 @@ struct Shape {
* \return the corresponding dimension size
*/
MSHADOW_XINLINE const index_t &operator[](int idx) const {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Warray-bounds"
return shape_[idx];
#pragma GCC diagnostic pop
}
/*!
* \return whether two shape equals
Expand Down
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ option(USE_JEMALLOC "Build with Jemalloc support" OFF)
option(USE_LIBJPEG_TURBO "Use libjpeg-turbo" OFF)
option(USE_DIST_KVSTORE "Build with DIST_KVSTORE support" OFF)
option(USE_PLUGINS_WARPCTC "Use WARPCTC Plugins" OFF)
option(USE_CPP_PACKAGE "Build C++ Package" OFF)
option(USE_MXNET_LIB_NAMING "Use MXNet library naming conventions." ON)
option(USE_GPROF "Compile with gprof (profiling) flag" OFF)
option(USE_VTUNE "Enable use of Intel Amplifier XE (VTune)" OFF) # one could set VTUNE_ROOT for search path
Expand Down
61 changes: 25 additions & 36 deletions ci/docker/Dockerfile.build.ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
# See docker-compose.yml for supported BASE_IMAGE ARGs and targets.

####################################################################################################
# The Dockerfile uses a dynamic BASE_IMAGE (for example ubuntu:18.04
# nvidia/cuda:10.2-cudnn7-devel-ubuntu18.04 etc).
# The Dockerfile uses a dynamic BASE_IMAGE (for example ubuntu:20.04
# nvidia/cuda:11.1-cudnn8-devel-ubuntu20.04 etc).
# On top of BASE_IMAGE we install all dependencies shared by all MXNet build
# environments into a "base" target. At the end of this file, we can specialize
# "base" for specific usecases. The target built by docker can be selected via
Expand All @@ -36,9 +36,7 @@ WORKDIR /work/deps
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get install -y wget software-properties-common && \
wget -qO - http://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \
wget -qO - wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB | apt-key add - && \
apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-10 main" && \
apt-add-repository "deb https://apt.repos.intel.com/mkl all main" && \
apt-get update && \
apt-get install -y \
Expand All @@ -47,6 +45,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
unzip \
pandoc \
## Development tools
cmake \
build-essential \
ninja-build \
git \
Expand Down Expand Up @@ -123,43 +122,33 @@ COPY runtime_functions.sh /work/
# The target built by docker can be selected via "--target" option or docker-compose.yml
####################################################################################################
FROM base as gpu
# Install Thrust 1.9.8 to be shipped with Cuda 11.
# Fixes https://github.com/thrust/thrust/issues/1072 for Clang 10
# This file can be deleted when using Cuda 11 on CI
RUN cd /usr/local && \
git clone https://github.com/thrust/thrust.git && \
cd thrust && \
git checkout 1.9.8

# Install TensorRT
# Install TensorRT and CuDNN
# Use bash as it has better support for string comparisons in if clauses
SHELL ["/bin/bash", "-c"]
# We need to redeclare ARG due to
# https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact
ARG BASE_IMAGE
# due to issue https://gitlab.com/nvidia/container-images/cuda/-/issues/92, we
# get the cuda version from installed deb package if CUDA_VERSION is not set
RUN if [ -z "$CUDA_VERSION" ]; then export CUDA_VERSION=$( \
dpkg --list cuda-libraries*| grep "cuda-libraries-dev-" | awk '{print $3}' | sed 's/-1$//'); \
fi && export SHORT_CUDA_VERSION=${CUDA_VERSION%.*} && \
RUN export SHORT_CUDA_VERSION=${CUDA_VERSION%.*} && \
export OS_RELEASE="$(cat /etc/os-release)" && \
apt-get update && \
if [ ${SHORT_CUDA_VERSION} = 10.0 ]; then \
TRT_VERSION="7.0.0-1+cuda10.0"; \
TRT_MAJOR_VERSION=7; \
elif [ ${SHORT_CUDA_VERSION} = 10.1 ]; then \
TRT_VERSION="6.0.1-1+cuda10.1"; \
TRT_MAJOR_VERSION=6; \
elif [ ${SHORT_CUDA_VERSION} = 10.2 ]; then \
TRT_VERSION="7.0.0-1+cuda10.2"; \
TRT_MAJOR_VERSION=7; \
elif [ ${SHORT_CUDA_VERSION} = 11.0 ]; then \
TRT_VERSION="7.2.0-1+cuda11.0"; \
TRT_MAJOR_VERSION=7; \
else \
echo "ERROR: Cuda ${SHORT_CUDA_VERSION} not yet supported in Dockerfile.build.ubuntu"; \
exit 1; \
if [[ ${OS_RELEASE} == *"Bionic"* ]]; then \
if [ ${SHORT_CUDA_VERSION} = 11.0 ]; then \
TRT_VERSION="7.2.0-1+cuda11.0"; \
TRT_MAJOR_VERSION=7; \
elif [ ${SHORT_CUDA_VERSION} = 11.1 ]; then \
TRT_VERSION="7.2.1-1+cuda11.1"; \
TRT_MAJOR_VERSION=7; \
else \
echo "ERROR: Cuda ${SHORT_CUDA_VERSION} not yet supported in Dockerfile.build.ubuntu"; \
exit 1; \
fi; \
apt-get install -y libnvinfer${TRT_MAJOR_VERSION}=${TRT_VERSION} \
libnvinfer-dev=${TRT_VERSION} \
libnvinfer-plugin${TRT_MAJOR_VERSION}=${TRT_VERSION} \
libnvinfer-plugin-dev=${TRT_VERSION}; \
fi && \
apt-get install -y libnvinfer${TRT_MAJOR_VERSION}=${TRT_VERSION} \
libnvinfer-dev=${TRT_VERSION} \
libnvinfer-plugin${TRT_MAJOR_VERSION}=${TRT_VERSION} \
libnvinfer-plugin-dev=${TRT_VERSION} && \
apt-get install -y libcudnn8-dev && \
rm -rf /var/lib/apt/lists/*

ENV CUDNN_VERSION=8.0.5
38 changes: 9 additions & 29 deletions ci/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,49 +85,29 @@ services:
dockerfile: Dockerfile.build.ubuntu
target: base
args:
BASE_IMAGE: ubuntu:18.04
BASE_IMAGE: ubuntu:20.04
cache_from:
- ${DOCKER_CACHE_REGISTRY}/build.ubuntu_cpu:latest
ubuntu_gpu_cu101:
image: ${DOCKER_CACHE_REGISTRY}/build.ubuntu_gpu_cu101:latest
ubuntu_tensorrt_cu111:
image: ${DOCKER_CACHE_REGISTRY}/build.ubuntu_tensorrt_cu111:latest
build:
context: .
dockerfile: Dockerfile.build.ubuntu
target: gpu
args:
BASE_IMAGE: nvidia/cuda:10.1-cudnn7-devel-ubuntu18.04
BASE_IMAGE: nvidia/cuda:11.1-devel-ubuntu18.04
cache_from:
- ${DOCKER_CACHE_REGISTRY}/build.ubuntu_gpu_cu101:latest
ubuntu_gpu_cu102:
image: ${DOCKER_CACHE_REGISTRY}/build.ubuntu_gpu_cu102:latest
- ${DOCKER_CACHE_REGISTRY}/build.ubuntu_tensorrt_cu111:latest
ubuntu_gpu_cu111:
image: ${DOCKER_CACHE_REGISTRY}/build.ubuntu_gpu_cu111:latest
build:
context: .
dockerfile: Dockerfile.build.ubuntu
target: gpu
args:
BASE_IMAGE: nvidia/cuda:10.2-cudnn7-devel-ubuntu18.04
BASE_IMAGE: nvidia/cuda:11.1-devel-ubuntu20.04
cache_from:
- ${DOCKER_CACHE_REGISTRY}/build.ubuntu_gpu_cu102:latest
ubuntu_gpu_cu110:
image: ${DOCKER_CACHE_REGISTRY}/build.ubuntu_gpu_cu110:latest
build:
context: .
dockerfile: Dockerfile.build.ubuntu
target: gpu
args:
BASE_IMAGE: nvidia/cuda:11.0-cudnn8-devel-ubuntu18.04
cache_from:
- ${DOCKER_CACHE_REGISTRY}/build.ubuntu_gpu_cu110:latest
ubuntu_build_cuda:
image: ${DOCKER_CACHE_REGISTRY}/build.ubuntu_build_cuda:latest
build:
context: .
dockerfile: Dockerfile.build.ubuntu
target: gpu
args:
BASE_IMAGE: nvidia/cuda:10.1-cudnn7-devel-ubuntu18.04
cache_from:
- ${DOCKER_CACHE_REGISTRY}/build.ubuntu_build_cuda:latest
- ${DOCKER_CACHE_REGISTRY}/build.ubuntu_gpu_cu111:latest
###################################################################################################
# Dockerfile.build.android based images used for testing cross-compilation for plain ARM
###################################################################################################
Expand Down
Loading