SIGN IN SIGN UP
apache / mxnet UNCLAIMED

Lightweight, Portable, Flexible Distributed/Mobile Deep Learning with Dynamic, Mutation-aware Dataflow Dep Scheduler; for Python, R, Julia, Scala, Go, Javascript and more

#!/bin/bash
# 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.
#
# build and install are separated so changes to build don't invalidate
# the whole docker cache for the image
set -ex
# compute capabilities for CI instances supported by CUDA 10.x (i.e. p3, g4)
CI_CMAKE_CUDA10_ARCH="5.2 7.5"
# compute capabilities for CI instances supported by CUDA >= 11.1 (i.e. p3, g4, g5)
CI_CMAKE_CUDA_ARCH="5.2 7.5 8.6"
# On newer nvidia cuda containers, these environment variables
# are prefixed with NV_, so provide compatibility
if [ ! -z "$NV_CUDNN_VERSION" ]; then
if [ -z "$CUDNN_VERSION" ]; then
export CUDNN_VERSION=$NV_CUDNN_VERSION
fi
fi
clean_repo() {
set -ex
git clean -xfd
git submodule foreach --recursive git clean -xfd
git reset --hard
git submodule foreach --recursive git reset --hard
git submodule update --init --recursive
}
scala_prepare() {
# Clean up maven logs
export MAVEN_OPTS="-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn"
}
[MXNET-545] Fix broken cython build (#10951) * Fix broken build with cython 0.28 * Fix setup.py to be compatible with cython 0.28 * Fix broken cython ndarray module * Revised comments * Replace hard coded library path with one obtained by find_lib_path * Add documentation for MXNET_ENABLE_CYTHON and MXNET_ENFORCE_CYTHON * Add cython build to CI * Fix for cython CI * Adjust python environment for cython CI * Add make variables to set python executable * Fix typo * Fix nnvm include path * Does not use ccache for cython * Fix issues with the wildcards in the library list in Jenkinsfile * Fix issues with the wildcards in the library list in Jenkinsfile (continued) * Fix issues with the wildcards in the library list in Jenkinsfile (continued) * Intentionally introduce a bug to check that the tests actually runwith cython * Remove the intentionally introduced bug * Update installation doc * Retrigger CI * Run cython CI in ubuntu environment instead of CentOS environment * Commit a missed file * Fix a bug in check_cython * Refine environments for cython CI * Restore unrelated changes * Fix a problem occurring when the cython modules for python 2 and 3 are built successively * Trigger CI * Pin the cython version in the CI * Catch up #11320 * Remove optional arguments unused after #11320 * Trigger CI * Trigger CI * Trigger CI * Remove unnecessary stype argument from the NDArrayBase constructor * Revise confusing initialization of `_ndarray_cls` * Add cython build for python3 in CI * Fix misplaced cython build in CI * Adjust CI environments for cython * Fix invalid path for cython generated .so files in cmake build * Revert invalid fix * Revise docs * Revise check_cython * Temporaily use make instead of cmake for debugging * Temporal changes for debugging * Temporal changes for debugging * Temporaily use ctypes instead of cython modules for debugging * Temporaily disable ccache for debugging * Temporaily use make (DEV = 0) instead of cmake for debugging * Temporaily disable cudnn for debugging * Restore temporal changes * Temporarily disable coverage report * Adapt to Jenkinsfile_utils * Adapt to Jenkinsfile_utils (cont.) * Restore unrelated changes * Restore temporal changes * Resolving conflict * Test with the cmake build is removed * Add MXNET_ENABLE_CYTHON=0 to tensorrt test * Fix typo * Trigger CI * Trigger CI * Adapt to Jenkinsfile refactoring * Adapt to Jenkinsfile refactoring (cont.) * Trigger CI * Trigger CI * Stash missing cython modules * Trigger CI * CMake build of cython modules without unit tests * Fix typo * Trigger CI * Fix a mistake introduced in merging process * trigger test * Update Jenkinsfile_utils.groovy * Trigger CI * Trigger CI * Trigger CI * Trigger tests * Trigger tests * Trigger tests * Trigger tests * Trigger tests * Trigger tests * Trigger tests * Trigger tests
2019-05-25 07:36:30 +09:00
check_cython() {
set -ex
local is_cython_used=$(python3 <<EOF
[MXNET-545] Fix broken cython build (#10951) * Fix broken build with cython 0.28 * Fix setup.py to be compatible with cython 0.28 * Fix broken cython ndarray module * Revised comments * Replace hard coded library path with one obtained by find_lib_path * Add documentation for MXNET_ENABLE_CYTHON and MXNET_ENFORCE_CYTHON * Add cython build to CI * Fix for cython CI * Adjust python environment for cython CI * Add make variables to set python executable * Fix typo * Fix nnvm include path * Does not use ccache for cython * Fix issues with the wildcards in the library list in Jenkinsfile * Fix issues with the wildcards in the library list in Jenkinsfile (continued) * Fix issues with the wildcards in the library list in Jenkinsfile (continued) * Intentionally introduce a bug to check that the tests actually runwith cython * Remove the intentionally introduced bug * Update installation doc * Retrigger CI * Run cython CI in ubuntu environment instead of CentOS environment * Commit a missed file * Fix a bug in check_cython * Refine environments for cython CI * Restore unrelated changes * Fix a problem occurring when the cython modules for python 2 and 3 are built successively * Trigger CI * Pin the cython version in the CI * Catch up #11320 * Remove optional arguments unused after #11320 * Trigger CI * Trigger CI * Trigger CI * Remove unnecessary stype argument from the NDArrayBase constructor * Revise confusing initialization of `_ndarray_cls` * Add cython build for python3 in CI * Fix misplaced cython build in CI * Adjust CI environments for cython * Fix invalid path for cython generated .so files in cmake build * Revert invalid fix * Revise docs * Revise check_cython * Temporaily use make instead of cmake for debugging * Temporal changes for debugging * Temporal changes for debugging * Temporaily use ctypes instead of cython modules for debugging * Temporaily disable ccache for debugging * Temporaily use make (DEV = 0) instead of cmake for debugging * Temporaily disable cudnn for debugging * Restore temporal changes * Temporarily disable coverage report * Adapt to Jenkinsfile_utils * Adapt to Jenkinsfile_utils (cont.) * Restore unrelated changes * Restore temporal changes * Resolving conflict * Test with the cmake build is removed * Add MXNET_ENABLE_CYTHON=0 to tensorrt test * Fix typo * Trigger CI * Trigger CI * Adapt to Jenkinsfile refactoring * Adapt to Jenkinsfile refactoring (cont.) * Trigger CI * Trigger CI * Stash missing cython modules * Trigger CI * CMake build of cython modules without unit tests * Fix typo * Trigger CI * Fix a mistake introduced in merging process * trigger test * Update Jenkinsfile_utils.groovy * Trigger CI * Trigger CI * Trigger CI * Trigger tests * Trigger tests * Trigger tests * Trigger tests * Trigger tests * Trigger tests * Trigger tests * Trigger tests
2019-05-25 07:36:30 +09:00
import sys
import mxnet as mx
cython_ndarraybase = 'mxnet._cy3.ndarray'
[MXNET-545] Fix broken cython build (#10951) * Fix broken build with cython 0.28 * Fix setup.py to be compatible with cython 0.28 * Fix broken cython ndarray module * Revised comments * Replace hard coded library path with one obtained by find_lib_path * Add documentation for MXNET_ENABLE_CYTHON and MXNET_ENFORCE_CYTHON * Add cython build to CI * Fix for cython CI * Adjust python environment for cython CI * Add make variables to set python executable * Fix typo * Fix nnvm include path * Does not use ccache for cython * Fix issues with the wildcards in the library list in Jenkinsfile * Fix issues with the wildcards in the library list in Jenkinsfile (continued) * Fix issues with the wildcards in the library list in Jenkinsfile (continued) * Intentionally introduce a bug to check that the tests actually runwith cython * Remove the intentionally introduced bug * Update installation doc * Retrigger CI * Run cython CI in ubuntu environment instead of CentOS environment * Commit a missed file * Fix a bug in check_cython * Refine environments for cython CI * Restore unrelated changes * Fix a problem occurring when the cython modules for python 2 and 3 are built successively * Trigger CI * Pin the cython version in the CI * Catch up #11320 * Remove optional arguments unused after #11320 * Trigger CI * Trigger CI * Trigger CI * Remove unnecessary stype argument from the NDArrayBase constructor * Revise confusing initialization of `_ndarray_cls` * Add cython build for python3 in CI * Fix misplaced cython build in CI * Adjust CI environments for cython * Fix invalid path for cython generated .so files in cmake build * Revert invalid fix * Revise docs * Revise check_cython * Temporaily use make instead of cmake for debugging * Temporal changes for debugging * Temporal changes for debugging * Temporaily use ctypes instead of cython modules for debugging * Temporaily disable ccache for debugging * Temporaily use make (DEV = 0) instead of cmake for debugging * Temporaily disable cudnn for debugging * Restore temporal changes * Temporarily disable coverage report * Adapt to Jenkinsfile_utils * Adapt to Jenkinsfile_utils (cont.) * Restore unrelated changes * Restore temporal changes * Resolving conflict * Test with the cmake build is removed * Add MXNET_ENABLE_CYTHON=0 to tensorrt test * Fix typo * Trigger CI * Trigger CI * Adapt to Jenkinsfile refactoring * Adapt to Jenkinsfile refactoring (cont.) * Trigger CI * Trigger CI * Stash missing cython modules * Trigger CI * CMake build of cython modules without unit tests * Fix typo * Trigger CI * Fix a mistake introduced in merging process * trigger test * Update Jenkinsfile_utils.groovy * Trigger CI * Trigger CI * Trigger CI * Trigger tests * Trigger tests * Trigger tests * Trigger tests * Trigger tests * Trigger tests * Trigger tests * Trigger tests
2019-05-25 07:36:30 +09:00
print(mx.nd._internal.NDArrayBase.__module__ == cython_ndarraybase)
EOF
)
if [ "${is_cython_used}" != "True" ]; then
echo "ERROR: cython is not used."
return 1
else
echo "NOTE: cython is used."
return 0
fi
[MXNET-545] Fix broken cython build (#10951) * Fix broken build with cython 0.28 * Fix setup.py to be compatible with cython 0.28 * Fix broken cython ndarray module * Revised comments * Replace hard coded library path with one obtained by find_lib_path * Add documentation for MXNET_ENABLE_CYTHON and MXNET_ENFORCE_CYTHON * Add cython build to CI * Fix for cython CI * Adjust python environment for cython CI * Add make variables to set python executable * Fix typo * Fix nnvm include path * Does not use ccache for cython * Fix issues with the wildcards in the library list in Jenkinsfile * Fix issues with the wildcards in the library list in Jenkinsfile (continued) * Fix issues with the wildcards in the library list in Jenkinsfile (continued) * Intentionally introduce a bug to check that the tests actually runwith cython * Remove the intentionally introduced bug * Update installation doc * Retrigger CI * Run cython CI in ubuntu environment instead of CentOS environment * Commit a missed file * Fix a bug in check_cython * Refine environments for cython CI * Restore unrelated changes * Fix a problem occurring when the cython modules for python 2 and 3 are built successively * Trigger CI * Pin the cython version in the CI * Catch up #11320 * Remove optional arguments unused after #11320 * Trigger CI * Trigger CI * Trigger CI * Remove unnecessary stype argument from the NDArrayBase constructor * Revise confusing initialization of `_ndarray_cls` * Add cython build for python3 in CI * Fix misplaced cython build in CI * Adjust CI environments for cython * Fix invalid path for cython generated .so files in cmake build * Revert invalid fix * Revise docs * Revise check_cython * Temporaily use make instead of cmake for debugging * Temporal changes for debugging * Temporal changes for debugging * Temporaily use ctypes instead of cython modules for debugging * Temporaily disable ccache for debugging * Temporaily use make (DEV = 0) instead of cmake for debugging * Temporaily disable cudnn for debugging * Restore temporal changes * Temporarily disable coverage report * Adapt to Jenkinsfile_utils * Adapt to Jenkinsfile_utils (cont.) * Restore unrelated changes * Restore temporal changes * Resolving conflict * Test with the cmake build is removed * Add MXNET_ENABLE_CYTHON=0 to tensorrt test * Fix typo * Trigger CI * Trigger CI * Adapt to Jenkinsfile refactoring * Adapt to Jenkinsfile refactoring (cont.) * Trigger CI * Trigger CI * Stash missing cython modules * Trigger CI * CMake build of cython modules without unit tests * Fix typo * Trigger CI * Fix a mistake introduced in merging process * trigger test * Update Jenkinsfile_utils.groovy * Trigger CI * Trigger CI * Trigger CI * Trigger tests * Trigger tests * Trigger tests * Trigger tests * Trigger tests * Trigger tests * Trigger tests * Trigger tests
2019-05-25 07:36:30 +09:00
}
build_wheel() {
set -ex
pushd .
PYTHON_DIR=${1:-/work/mxnet/python}
BUILD_DIR=${2:-/work/build}
# build
export MXNET_LIBRARY_PATH=${BUILD_DIR}/libmxnet.so
cd ${PYTHON_DIR}
2020-02-03 09:58:01 -08:00
python3 setup.py bdist_wheel
# repackage
# Fix pathing issues in the wheel. We need to move libmxnet.so from the data folder to the
# mxnet folder, then repackage the wheel.
WHEEL=`readlink -f dist/*.whl`
TMPDIR=`mktemp -d`
unzip -d ${TMPDIR} ${WHEEL}
rm ${WHEEL}
cd ${TMPDIR}
mv *.data/data/mxnet/libmxnet.so mxnet
zip -r ${WHEEL} .
cp ${WHEEL} ${BUILD_DIR}
rm -rf ${TMPDIR}
popd
}
gather_licenses() {
mkdir -p licenses
cp tools/dependencies/LICENSE.binary.dependencies licenses/
cp NOTICE licenses/
cp LICENSE licenses/
}
# Compiles the dynamic mxnet library
# Parameters:
# $1 -> mxnet_variant: the mxnet variant to build, e.g. cpu, native, cu101, cu102, etc.
build_dynamic_libmxnet() {
set -ex
local mxnet_variant=${1:?"This function requires a mxnet variant as the first argument"}
# relevant licenses will be placed in the licenses directory
gather_licenses
cd /work/build
source /opt/rh/devtoolset-8/enable
# Opt in to newer GCC C++ ABI. devtoolset defaults to ABI Version 2.
export CXXFLAGS="-fabi-version=11 -fabi-compat-version=7"
if [[ ${mxnet_variant} = "cpu" ]]; then
cmake -DUSE_BLAS=Open \
-DUSE_ONEDNN=ON \
-DUSE_CUDA=OFF \
-G Ninja /work/mxnet
elif [[ ${mxnet_variant} = "native" ]]; then
cmake -DUSE_BLAS=Open \
-DUSE_ONEDNN=OFF \
-DUSE_CUDA=OFF \
-G Ninja /work/mxnet
elif [[ ${mxnet_variant} =~ cu[0-9]+$ ]]; then
cmake -DUSE_BLAS=Open \
-DUSE_ONEDNN=ON \
-DUSE_DIST_KVSTORE=ON \
-DUSE_CUDA=ON \
-G Ninja /work/mxnet
else
echo "Error: Unrecognized mxnet variant '${mxnet_variant}'"
exit 1
fi
ninja
}
build_jetson() {
set -ex
Switch to C++17 and modernize toolchain + CI (#17984) As per #17968, require C++17 compatible compiler. For cuda code, use C++14 mode introduced in Cuda 9. C++17 support for Cuda will be available in Cuda 11. Switching to C++17 requires modernizing the toolchain, which exposed a number of technical debt issues in the codebase. All blocking issues are fixed as part of this PR. See the full list below. This PR contains the following specific changes: Switch CI pipeline to use gcc7 on Ubuntu and CentOS Switch CD pipeline to CentOS 7 with https://www.softwarecollections.org/en/scls/rhscl/devtoolset-7/ This enables us to build with gcc7 C++17 compiler while keeping a relatively old glibc requirement for distribution. Simplify ARM Edge builds Switch to standard Ubuntu / Debian cross-compilation toolchain for ARMv7, ARMv8 Switch to https://toolchains.bootlin.com/ toolchain for ARMv6 (the Debian ARMv6 toolchain is for ARMv4 + ARMv5 + ARMv6, but we wish to only target ARMv6 and make use of ARMv6 features) Remove reliance on dockcross for cross compilation. Simplify Jetson build Use standard Ubuntu / Debian cross-compilation toolchain for ARMv8 Upgrade to Cuda 10 and Jetpack 4.3 Simplify build setup Simplify QEMU ARM virtualization test setup on CI Remove complex "Virtual Machine in Docker" logic and run a QEMU based Docker container instead based on arm32v7/ubuntu Fix out of bounds vector accesses in SoftmaxGradOpType MKLDNNFCBackward Fix use of non-standard rand_r function (which is not available on anymore on newer Android toolchains and shouldn't be use in any case). Fix reproducibility of RNN with Dropout Fix reproducibility of DGL Graph Sampling Operators Update tests for Android Edge build to NDK19. The previously used standalone toolchain is obsolete. Those Dockerfiles that required refactoring as part of the effort were refactored based on the following consideration Maximize the use of system dependencies provided by the distribution instead of manually installing dependencies from source or from third party vendors. This reduces the complexity of the installation process and essentially pins the dependency versions, increasing CI stability. Further, Dockerfile build speed is improved. To facilitate this, use recent distribution versions. We still ensure backwards compatibility via CentOS7 based build and test stages Minimize the number of layers in the Dockerfile. Don't have 5 different script files executed, each calling apt-get update and install, but just execute once. Speeds up the build and reduces image size. Keep each Dockerfile simple and tailored to a purpose, instead of running 20 scripts to install dependencies for every thinkable scenario, which is unmaintainable. Some more small changes: Remove outdated references to Cuda 7 and Cuda 8 in various files. Remove C++03 support in mshadow Disable broken tests NumpyBooleanAssignForwardCPU #17990 test_init.test_rsp_const_init #17988 quantized_elemwise_mul #18034 List of squashed commits * cpp standard * Remove leftover files of Cuda 7 and Cuda 8 support * thrust 1.9.8 for clang10 * compiler warnings * Disable broken test_init.test_rsp_const_init * Disable tests invoking NumpyBooleanAssignForwardCPU * Fix out of bounds access in SoftmaxGradOpType * Use CentOS 7 for staticbuilds CentOS 7 fullfills the requirements for PEP 599 manylinux-2014 and provides a C++17 toolchain. * Fix MKLDNNFCBackward * Update edge toolchain * Support platforms without rand_r * Cleanup random.h * Greatly simplify qemu setup * Remove unused functions in Jenkins_steps.groovy * Skip quantized_elemwise_mul due QuantizedElemwiseMulOpShape bug * Fix R package installation https://github.com/apache/incubator-mxnet/issues/18042 * Fix centos ccache * Fix GPU Makefile staticbuild on CentOS7 * CentOS7 NCCL * CentOS7 staticbuild fix link with libculibos
2020-04-14 10:29:29 -07:00
cd /work/build
cmake \
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} \
-DUSE_CUDA=ON \
-DMXNET_CUDA_ARCH="5.2" \
-DUSE_OPENCV=OFF \
-DUSE_OPENMP=ON \
-DUSE_LAPACK=OFF \
-DUSE_BLAS=Open \
Switch to C++17 and modernize toolchain + CI (#17984) As per #17968, require C++17 compatible compiler. For cuda code, use C++14 mode introduced in Cuda 9. C++17 support for Cuda will be available in Cuda 11. Switching to C++17 requires modernizing the toolchain, which exposed a number of technical debt issues in the codebase. All blocking issues are fixed as part of this PR. See the full list below. This PR contains the following specific changes: Switch CI pipeline to use gcc7 on Ubuntu and CentOS Switch CD pipeline to CentOS 7 with https://www.softwarecollections.org/en/scls/rhscl/devtoolset-7/ This enables us to build with gcc7 C++17 compiler while keeping a relatively old glibc requirement for distribution. Simplify ARM Edge builds Switch to standard Ubuntu / Debian cross-compilation toolchain for ARMv7, ARMv8 Switch to https://toolchains.bootlin.com/ toolchain for ARMv6 (the Debian ARMv6 toolchain is for ARMv4 + ARMv5 + ARMv6, but we wish to only target ARMv6 and make use of ARMv6 features) Remove reliance on dockcross for cross compilation. Simplify Jetson build Use standard Ubuntu / Debian cross-compilation toolchain for ARMv8 Upgrade to Cuda 10 and Jetpack 4.3 Simplify build setup Simplify QEMU ARM virtualization test setup on CI Remove complex "Virtual Machine in Docker" logic and run a QEMU based Docker container instead based on arm32v7/ubuntu Fix out of bounds vector accesses in SoftmaxGradOpType MKLDNNFCBackward Fix use of non-standard rand_r function (which is not available on anymore on newer Android toolchains and shouldn't be use in any case). Fix reproducibility of RNN with Dropout Fix reproducibility of DGL Graph Sampling Operators Update tests for Android Edge build to NDK19. The previously used standalone toolchain is obsolete. Those Dockerfiles that required refactoring as part of the effort were refactored based on the following consideration Maximize the use of system dependencies provided by the distribution instead of manually installing dependencies from source or from third party vendors. This reduces the complexity of the installation process and essentially pins the dependency versions, increasing CI stability. Further, Dockerfile build speed is improved. To facilitate this, use recent distribution versions. We still ensure backwards compatibility via CentOS7 based build and test stages Minimize the number of layers in the Dockerfile. Don't have 5 different script files executed, each calling apt-get update and install, but just execute once. Speeds up the build and reduces image size. Keep each Dockerfile simple and tailored to a purpose, instead of running 20 scripts to install dependencies for every thinkable scenario, which is unmaintainable. Some more small changes: Remove outdated references to Cuda 7 and Cuda 8 in various files. Remove C++03 support in mshadow Disable broken tests NumpyBooleanAssignForwardCPU #17990 test_init.test_rsp_const_init #17988 quantized_elemwise_mul #18034 List of squashed commits * cpp standard * Remove leftover files of Cuda 7 and Cuda 8 support * thrust 1.9.8 for clang10 * compiler warnings * Disable broken test_init.test_rsp_const_init * Disable tests invoking NumpyBooleanAssignForwardCPU * Fix out of bounds access in SoftmaxGradOpType * Use CentOS 7 for staticbuilds CentOS 7 fullfills the requirements for PEP 599 manylinux-2014 and provides a C++17 toolchain. * Fix MKLDNNFCBackward * Update edge toolchain * Support platforms without rand_r * Cleanup random.h * Greatly simplify qemu setup * Remove unused functions in Jenkins_steps.groovy * Skip quantized_elemwise_mul due QuantizedElemwiseMulOpShape bug * Fix R package installation https://github.com/apache/incubator-mxnet/issues/18042 * Fix centos ccache * Fix GPU Makefile staticbuild on CentOS7 * CentOS7 NCCL * CentOS7 staticbuild fix link with libculibos
2020-04-14 10:29:29 -07:00
-DCMAKE_BUILD_TYPE=Release \
-G Ninja /work/mxnet
ninja
build_wheel
}
#
# ARM builds
#
build_armv6() {
set -ex
cd /work/build
# We do not need OpenMP, since most armv6 systems have only 1 core
cmake \
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} \
-DUSE_CUDA=OFF \
-DUSE_OPENCV=OFF \
-DUSE_OPENMP=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DUSE_LAPACK=OFF \
-DUSE_BLAS=Open \
-DBUILD_CPP_EXAMPLES=OFF \
-G Ninja /work/mxnet
ninja
build_wheel
}
build_armv7() {
set -ex
cd /work/build
cmake \
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} \
-DUSE_CUDA=OFF \
-DUSE_OPENCV=OFF \
-DUSE_OPENMP=ON \
-DCMAKE_BUILD_TYPE=Release \
-DUSE_LAPACK=OFF \
-DUSE_BLAS=Open \
-DBUILD_CPP_EXAMPLES=OFF \
-G Ninja /work/mxnet
ninja
build_wheel
}
build_armv8() {
cd /work/build
cmake \
Switch to C++17 and modernize toolchain + CI (#17984) As per #17968, require C++17 compatible compiler. For cuda code, use C++14 mode introduced in Cuda 9. C++17 support for Cuda will be available in Cuda 11. Switching to C++17 requires modernizing the toolchain, which exposed a number of technical debt issues in the codebase. All blocking issues are fixed as part of this PR. See the full list below. This PR contains the following specific changes: Switch CI pipeline to use gcc7 on Ubuntu and CentOS Switch CD pipeline to CentOS 7 with https://www.softwarecollections.org/en/scls/rhscl/devtoolset-7/ This enables us to build with gcc7 C++17 compiler while keeping a relatively old glibc requirement for distribution. Simplify ARM Edge builds Switch to standard Ubuntu / Debian cross-compilation toolchain for ARMv7, ARMv8 Switch to https://toolchains.bootlin.com/ toolchain for ARMv6 (the Debian ARMv6 toolchain is for ARMv4 + ARMv5 + ARMv6, but we wish to only target ARMv6 and make use of ARMv6 features) Remove reliance on dockcross for cross compilation. Simplify Jetson build Use standard Ubuntu / Debian cross-compilation toolchain for ARMv8 Upgrade to Cuda 10 and Jetpack 4.3 Simplify build setup Simplify QEMU ARM virtualization test setup on CI Remove complex "Virtual Machine in Docker" logic and run a QEMU based Docker container instead based on arm32v7/ubuntu Fix out of bounds vector accesses in SoftmaxGradOpType MKLDNNFCBackward Fix use of non-standard rand_r function (which is not available on anymore on newer Android toolchains and shouldn't be use in any case). Fix reproducibility of RNN with Dropout Fix reproducibility of DGL Graph Sampling Operators Update tests for Android Edge build to NDK19. The previously used standalone toolchain is obsolete. Those Dockerfiles that required refactoring as part of the effort were refactored based on the following consideration Maximize the use of system dependencies provided by the distribution instead of manually installing dependencies from source or from third party vendors. This reduces the complexity of the installation process and essentially pins the dependency versions, increasing CI stability. Further, Dockerfile build speed is improved. To facilitate this, use recent distribution versions. We still ensure backwards compatibility via CentOS7 based build and test stages Minimize the number of layers in the Dockerfile. Don't have 5 different script files executed, each calling apt-get update and install, but just execute once. Speeds up the build and reduces image size. Keep each Dockerfile simple and tailored to a purpose, instead of running 20 scripts to install dependencies for every thinkable scenario, which is unmaintainable. Some more small changes: Remove outdated references to Cuda 7 and Cuda 8 in various files. Remove C++03 support in mshadow Disable broken tests NumpyBooleanAssignForwardCPU #17990 test_init.test_rsp_const_init #17988 quantized_elemwise_mul #18034 List of squashed commits * cpp standard * Remove leftover files of Cuda 7 and Cuda 8 support * thrust 1.9.8 for clang10 * compiler warnings * Disable broken test_init.test_rsp_const_init * Disable tests invoking NumpyBooleanAssignForwardCPU * Fix out of bounds access in SoftmaxGradOpType * Use CentOS 7 for staticbuilds CentOS 7 fullfills the requirements for PEP 599 manylinux-2014 and provides a C++17 toolchain. * Fix MKLDNNFCBackward * Update edge toolchain * Support platforms without rand_r * Cleanup random.h * Greatly simplify qemu setup * Remove unused functions in Jenkins_steps.groovy * Skip quantized_elemwise_mul due QuantizedElemwiseMulOpShape bug * Fix R package installation https://github.com/apache/incubator-mxnet/issues/18042 * Fix centos ccache * Fix GPU Makefile staticbuild on CentOS7 * CentOS7 NCCL * CentOS7 staticbuild fix link with libculibos
2020-04-14 10:29:29 -07:00
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} \
-DUSE_CUDA=OFF \
-DUSE_OPENCV=OFF \
-DUSE_OPENMP=ON \
Switch to C++17 and modernize toolchain + CI (#17984) As per #17968, require C++17 compatible compiler. For cuda code, use C++14 mode introduced in Cuda 9. C++17 support for Cuda will be available in Cuda 11. Switching to C++17 requires modernizing the toolchain, which exposed a number of technical debt issues in the codebase. All blocking issues are fixed as part of this PR. See the full list below. This PR contains the following specific changes: Switch CI pipeline to use gcc7 on Ubuntu and CentOS Switch CD pipeline to CentOS 7 with https://www.softwarecollections.org/en/scls/rhscl/devtoolset-7/ This enables us to build with gcc7 C++17 compiler while keeping a relatively old glibc requirement for distribution. Simplify ARM Edge builds Switch to standard Ubuntu / Debian cross-compilation toolchain for ARMv7, ARMv8 Switch to https://toolchains.bootlin.com/ toolchain for ARMv6 (the Debian ARMv6 toolchain is for ARMv4 + ARMv5 + ARMv6, but we wish to only target ARMv6 and make use of ARMv6 features) Remove reliance on dockcross for cross compilation. Simplify Jetson build Use standard Ubuntu / Debian cross-compilation toolchain for ARMv8 Upgrade to Cuda 10 and Jetpack 4.3 Simplify build setup Simplify QEMU ARM virtualization test setup on CI Remove complex "Virtual Machine in Docker" logic and run a QEMU based Docker container instead based on arm32v7/ubuntu Fix out of bounds vector accesses in SoftmaxGradOpType MKLDNNFCBackward Fix use of non-standard rand_r function (which is not available on anymore on newer Android toolchains and shouldn't be use in any case). Fix reproducibility of RNN with Dropout Fix reproducibility of DGL Graph Sampling Operators Update tests for Android Edge build to NDK19. The previously used standalone toolchain is obsolete. Those Dockerfiles that required refactoring as part of the effort were refactored based on the following consideration Maximize the use of system dependencies provided by the distribution instead of manually installing dependencies from source or from third party vendors. This reduces the complexity of the installation process and essentially pins the dependency versions, increasing CI stability. Further, Dockerfile build speed is improved. To facilitate this, use recent distribution versions. We still ensure backwards compatibility via CentOS7 based build and test stages Minimize the number of layers in the Dockerfile. Don't have 5 different script files executed, each calling apt-get update and install, but just execute once. Speeds up the build and reduces image size. Keep each Dockerfile simple and tailored to a purpose, instead of running 20 scripts to install dependencies for every thinkable scenario, which is unmaintainable. Some more small changes: Remove outdated references to Cuda 7 and Cuda 8 in various files. Remove C++03 support in mshadow Disable broken tests NumpyBooleanAssignForwardCPU #17990 test_init.test_rsp_const_init #17988 quantized_elemwise_mul #18034 List of squashed commits * cpp standard * Remove leftover files of Cuda 7 and Cuda 8 support * thrust 1.9.8 for clang10 * compiler warnings * Disable broken test_init.test_rsp_const_init * Disable tests invoking NumpyBooleanAssignForwardCPU * Fix out of bounds access in SoftmaxGradOpType * Use CentOS 7 for staticbuilds CentOS 7 fullfills the requirements for PEP 599 manylinux-2014 and provides a C++17 toolchain. * Fix MKLDNNFCBackward * Update edge toolchain * Support platforms without rand_r * Cleanup random.h * Greatly simplify qemu setup * Remove unused functions in Jenkins_steps.groovy * Skip quantized_elemwise_mul due QuantizedElemwiseMulOpShape bug * Fix R package installation https://github.com/apache/incubator-mxnet/issues/18042 * Fix centos ccache * Fix GPU Makefile staticbuild on CentOS7 * CentOS7 NCCL * CentOS7 staticbuild fix link with libculibos
2020-04-14 10:29:29 -07:00
-DUSE_LAPACK=OFF \
-DUSE_BLAS=Open \
Switch to C++17 and modernize toolchain + CI (#17984) As per #17968, require C++17 compatible compiler. For cuda code, use C++14 mode introduced in Cuda 9. C++17 support for Cuda will be available in Cuda 11. Switching to C++17 requires modernizing the toolchain, which exposed a number of technical debt issues in the codebase. All blocking issues are fixed as part of this PR. See the full list below. This PR contains the following specific changes: Switch CI pipeline to use gcc7 on Ubuntu and CentOS Switch CD pipeline to CentOS 7 with https://www.softwarecollections.org/en/scls/rhscl/devtoolset-7/ This enables us to build with gcc7 C++17 compiler while keeping a relatively old glibc requirement for distribution. Simplify ARM Edge builds Switch to standard Ubuntu / Debian cross-compilation toolchain for ARMv7, ARMv8 Switch to https://toolchains.bootlin.com/ toolchain for ARMv6 (the Debian ARMv6 toolchain is for ARMv4 + ARMv5 + ARMv6, but we wish to only target ARMv6 and make use of ARMv6 features) Remove reliance on dockcross for cross compilation. Simplify Jetson build Use standard Ubuntu / Debian cross-compilation toolchain for ARMv8 Upgrade to Cuda 10 and Jetpack 4.3 Simplify build setup Simplify QEMU ARM virtualization test setup on CI Remove complex "Virtual Machine in Docker" logic and run a QEMU based Docker container instead based on arm32v7/ubuntu Fix out of bounds vector accesses in SoftmaxGradOpType MKLDNNFCBackward Fix use of non-standard rand_r function (which is not available on anymore on newer Android toolchains and shouldn't be use in any case). Fix reproducibility of RNN with Dropout Fix reproducibility of DGL Graph Sampling Operators Update tests for Android Edge build to NDK19. The previously used standalone toolchain is obsolete. Those Dockerfiles that required refactoring as part of the effort were refactored based on the following consideration Maximize the use of system dependencies provided by the distribution instead of manually installing dependencies from source or from third party vendors. This reduces the complexity of the installation process and essentially pins the dependency versions, increasing CI stability. Further, Dockerfile build speed is improved. To facilitate this, use recent distribution versions. We still ensure backwards compatibility via CentOS7 based build and test stages Minimize the number of layers in the Dockerfile. Don't have 5 different script files executed, each calling apt-get update and install, but just execute once. Speeds up the build and reduces image size. Keep each Dockerfile simple and tailored to a purpose, instead of running 20 scripts to install dependencies for every thinkable scenario, which is unmaintainable. Some more small changes: Remove outdated references to Cuda 7 and Cuda 8 in various files. Remove C++03 support in mshadow Disable broken tests NumpyBooleanAssignForwardCPU #17990 test_init.test_rsp_const_init #17988 quantized_elemwise_mul #18034 List of squashed commits * cpp standard * Remove leftover files of Cuda 7 and Cuda 8 support * thrust 1.9.8 for clang10 * compiler warnings * Disable broken test_init.test_rsp_const_init * Disable tests invoking NumpyBooleanAssignForwardCPU * Fix out of bounds access in SoftmaxGradOpType * Use CentOS 7 for staticbuilds CentOS 7 fullfills the requirements for PEP 599 manylinux-2014 and provides a C++17 toolchain. * Fix MKLDNNFCBackward * Update edge toolchain * Support platforms without rand_r * Cleanup random.h * Greatly simplify qemu setup * Remove unused functions in Jenkins_steps.groovy * Skip quantized_elemwise_mul due QuantizedElemwiseMulOpShape bug * Fix R package installation https://github.com/apache/incubator-mxnet/issues/18042 * Fix centos ccache * Fix GPU Makefile staticbuild on CentOS7 * CentOS7 NCCL * CentOS7 staticbuild fix link with libculibos
2020-04-14 10:29:29 -07:00
-DCMAKE_BUILD_TYPE=Release \
-G Ninja /work/mxnet
ninja
build_wheel
}
#
# ANDROID builds
#
build_android_armv7() {
set -ex
cd /work/build
# ANDROID_ABI and ANDROID_STL are options of the CMAKE_TOOLCHAIN_FILE
# provided by Android NDK
cmake \
Switch to C++17 and modernize toolchain + CI (#17984) As per #17968, require C++17 compatible compiler. For cuda code, use C++14 mode introduced in Cuda 9. C++17 support for Cuda will be available in Cuda 11. Switching to C++17 requires modernizing the toolchain, which exposed a number of technical debt issues in the codebase. All blocking issues are fixed as part of this PR. See the full list below. This PR contains the following specific changes: Switch CI pipeline to use gcc7 on Ubuntu and CentOS Switch CD pipeline to CentOS 7 with https://www.softwarecollections.org/en/scls/rhscl/devtoolset-7/ This enables us to build with gcc7 C++17 compiler while keeping a relatively old glibc requirement for distribution. Simplify ARM Edge builds Switch to standard Ubuntu / Debian cross-compilation toolchain for ARMv7, ARMv8 Switch to https://toolchains.bootlin.com/ toolchain for ARMv6 (the Debian ARMv6 toolchain is for ARMv4 + ARMv5 + ARMv6, but we wish to only target ARMv6 and make use of ARMv6 features) Remove reliance on dockcross for cross compilation. Simplify Jetson build Use standard Ubuntu / Debian cross-compilation toolchain for ARMv8 Upgrade to Cuda 10 and Jetpack 4.3 Simplify build setup Simplify QEMU ARM virtualization test setup on CI Remove complex "Virtual Machine in Docker" logic and run a QEMU based Docker container instead based on arm32v7/ubuntu Fix out of bounds vector accesses in SoftmaxGradOpType MKLDNNFCBackward Fix use of non-standard rand_r function (which is not available on anymore on newer Android toolchains and shouldn't be use in any case). Fix reproducibility of RNN with Dropout Fix reproducibility of DGL Graph Sampling Operators Update tests for Android Edge build to NDK19. The previously used standalone toolchain is obsolete. Those Dockerfiles that required refactoring as part of the effort were refactored based on the following consideration Maximize the use of system dependencies provided by the distribution instead of manually installing dependencies from source or from third party vendors. This reduces the complexity of the installation process and essentially pins the dependency versions, increasing CI stability. Further, Dockerfile build speed is improved. To facilitate this, use recent distribution versions. We still ensure backwards compatibility via CentOS7 based build and test stages Minimize the number of layers in the Dockerfile. Don't have 5 different script files executed, each calling apt-get update and install, but just execute once. Speeds up the build and reduces image size. Keep each Dockerfile simple and tailored to a purpose, instead of running 20 scripts to install dependencies for every thinkable scenario, which is unmaintainable. Some more small changes: Remove outdated references to Cuda 7 and Cuda 8 in various files. Remove C++03 support in mshadow Disable broken tests NumpyBooleanAssignForwardCPU #17990 test_init.test_rsp_const_init #17988 quantized_elemwise_mul #18034 List of squashed commits * cpp standard * Remove leftover files of Cuda 7 and Cuda 8 support * thrust 1.9.8 for clang10 * compiler warnings * Disable broken test_init.test_rsp_const_init * Disable tests invoking NumpyBooleanAssignForwardCPU * Fix out of bounds access in SoftmaxGradOpType * Use CentOS 7 for staticbuilds CentOS 7 fullfills the requirements for PEP 599 manylinux-2014 and provides a C++17 toolchain. * Fix MKLDNNFCBackward * Update edge toolchain * Support platforms without rand_r * Cleanup random.h * Greatly simplify qemu setup * Remove unused functions in Jenkins_steps.groovy * Skip quantized_elemwise_mul due QuantizedElemwiseMulOpShape bug * Fix R package installation https://github.com/apache/incubator-mxnet/issues/18042 * Fix centos ccache * Fix GPU Makefile staticbuild on CentOS7 * CentOS7 NCCL * CentOS7 staticbuild fix link with libculibos
2020-04-14 10:29:29 -07:00
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} \
-DANDROID_ABI="armeabi-v7a" \
-DANDROID_STL="c++_shared" \
-DUSE_CUDA=OFF \
-DUSE_LAPACK=OFF \
-DUSE_BLAS=Open \
Switch to C++17 and modernize toolchain + CI (#17984) As per #17968, require C++17 compatible compiler. For cuda code, use C++14 mode introduced in Cuda 9. C++17 support for Cuda will be available in Cuda 11. Switching to C++17 requires modernizing the toolchain, which exposed a number of technical debt issues in the codebase. All blocking issues are fixed as part of this PR. See the full list below. This PR contains the following specific changes: Switch CI pipeline to use gcc7 on Ubuntu and CentOS Switch CD pipeline to CentOS 7 with https://www.softwarecollections.org/en/scls/rhscl/devtoolset-7/ This enables us to build with gcc7 C++17 compiler while keeping a relatively old glibc requirement for distribution. Simplify ARM Edge builds Switch to standard Ubuntu / Debian cross-compilation toolchain for ARMv7, ARMv8 Switch to https://toolchains.bootlin.com/ toolchain for ARMv6 (the Debian ARMv6 toolchain is for ARMv4 + ARMv5 + ARMv6, but we wish to only target ARMv6 and make use of ARMv6 features) Remove reliance on dockcross for cross compilation. Simplify Jetson build Use standard Ubuntu / Debian cross-compilation toolchain for ARMv8 Upgrade to Cuda 10 and Jetpack 4.3 Simplify build setup Simplify QEMU ARM virtualization test setup on CI Remove complex "Virtual Machine in Docker" logic and run a QEMU based Docker container instead based on arm32v7/ubuntu Fix out of bounds vector accesses in SoftmaxGradOpType MKLDNNFCBackward Fix use of non-standard rand_r function (which is not available on anymore on newer Android toolchains and shouldn't be use in any case). Fix reproducibility of RNN with Dropout Fix reproducibility of DGL Graph Sampling Operators Update tests for Android Edge build to NDK19. The previously used standalone toolchain is obsolete. Those Dockerfiles that required refactoring as part of the effort were refactored based on the following consideration Maximize the use of system dependencies provided by the distribution instead of manually installing dependencies from source or from third party vendors. This reduces the complexity of the installation process and essentially pins the dependency versions, increasing CI stability. Further, Dockerfile build speed is improved. To facilitate this, use recent distribution versions. We still ensure backwards compatibility via CentOS7 based build and test stages Minimize the number of layers in the Dockerfile. Don't have 5 different script files executed, each calling apt-get update and install, but just execute once. Speeds up the build and reduces image size. Keep each Dockerfile simple and tailored to a purpose, instead of running 20 scripts to install dependencies for every thinkable scenario, which is unmaintainable. Some more small changes: Remove outdated references to Cuda 7 and Cuda 8 in various files. Remove C++03 support in mshadow Disable broken tests NumpyBooleanAssignForwardCPU #17990 test_init.test_rsp_const_init #17988 quantized_elemwise_mul #18034 List of squashed commits * cpp standard * Remove leftover files of Cuda 7 and Cuda 8 support * thrust 1.9.8 for clang10 * compiler warnings * Disable broken test_init.test_rsp_const_init * Disable tests invoking NumpyBooleanAssignForwardCPU * Fix out of bounds access in SoftmaxGradOpType * Use CentOS 7 for staticbuilds CentOS 7 fullfills the requirements for PEP 599 manylinux-2014 and provides a C++17 toolchain. * Fix MKLDNNFCBackward * Update edge toolchain * Support platforms without rand_r * Cleanup random.h * Greatly simplify qemu setup * Remove unused functions in Jenkins_steps.groovy * Skip quantized_elemwise_mul due QuantizedElemwiseMulOpShape bug * Fix R package installation https://github.com/apache/incubator-mxnet/issues/18042 * Fix centos ccache * Fix GPU Makefile staticbuild on CentOS7 * CentOS7 NCCL * CentOS7 staticbuild fix link with libculibos
2020-04-14 10:29:29 -07:00
-DUSE_OPENCV=OFF \
-DUSE_OPENMP=OFF \
-G Ninja /work/mxnet
ninja
}
build_android_armv8() {
set -ex
cd /work/build
# ANDROID_ABI and ANDROID_STL are options of the CMAKE_TOOLCHAIN_FILE
# provided by Android NDK
Switch to C++17 and modernize toolchain + CI (#17984) As per #17968, require C++17 compatible compiler. For cuda code, use C++14 mode introduced in Cuda 9. C++17 support for Cuda will be available in Cuda 11. Switching to C++17 requires modernizing the toolchain, which exposed a number of technical debt issues in the codebase. All blocking issues are fixed as part of this PR. See the full list below. This PR contains the following specific changes: Switch CI pipeline to use gcc7 on Ubuntu and CentOS Switch CD pipeline to CentOS 7 with https://www.softwarecollections.org/en/scls/rhscl/devtoolset-7/ This enables us to build with gcc7 C++17 compiler while keeping a relatively old glibc requirement for distribution. Simplify ARM Edge builds Switch to standard Ubuntu / Debian cross-compilation toolchain for ARMv7, ARMv8 Switch to https://toolchains.bootlin.com/ toolchain for ARMv6 (the Debian ARMv6 toolchain is for ARMv4 + ARMv5 + ARMv6, but we wish to only target ARMv6 and make use of ARMv6 features) Remove reliance on dockcross for cross compilation. Simplify Jetson build Use standard Ubuntu / Debian cross-compilation toolchain for ARMv8 Upgrade to Cuda 10 and Jetpack 4.3 Simplify build setup Simplify QEMU ARM virtualization test setup on CI Remove complex "Virtual Machine in Docker" logic and run a QEMU based Docker container instead based on arm32v7/ubuntu Fix out of bounds vector accesses in SoftmaxGradOpType MKLDNNFCBackward Fix use of non-standard rand_r function (which is not available on anymore on newer Android toolchains and shouldn't be use in any case). Fix reproducibility of RNN with Dropout Fix reproducibility of DGL Graph Sampling Operators Update tests for Android Edge build to NDK19. The previously used standalone toolchain is obsolete. Those Dockerfiles that required refactoring as part of the effort were refactored based on the following consideration Maximize the use of system dependencies provided by the distribution instead of manually installing dependencies from source or from third party vendors. This reduces the complexity of the installation process and essentially pins the dependency versions, increasing CI stability. Further, Dockerfile build speed is improved. To facilitate this, use recent distribution versions. We still ensure backwards compatibility via CentOS7 based build and test stages Minimize the number of layers in the Dockerfile. Don't have 5 different script files executed, each calling apt-get update and install, but just execute once. Speeds up the build and reduces image size. Keep each Dockerfile simple and tailored to a purpose, instead of running 20 scripts to install dependencies for every thinkable scenario, which is unmaintainable. Some more small changes: Remove outdated references to Cuda 7 and Cuda 8 in various files. Remove C++03 support in mshadow Disable broken tests NumpyBooleanAssignForwardCPU #17990 test_init.test_rsp_const_init #17988 quantized_elemwise_mul #18034 List of squashed commits * cpp standard * Remove leftover files of Cuda 7 and Cuda 8 support * thrust 1.9.8 for clang10 * compiler warnings * Disable broken test_init.test_rsp_const_init * Disable tests invoking NumpyBooleanAssignForwardCPU * Fix out of bounds access in SoftmaxGradOpType * Use CentOS 7 for staticbuilds CentOS 7 fullfills the requirements for PEP 599 manylinux-2014 and provides a C++17 toolchain. * Fix MKLDNNFCBackward * Update edge toolchain * Support platforms without rand_r * Cleanup random.h * Greatly simplify qemu setup * Remove unused functions in Jenkins_steps.groovy * Skip quantized_elemwise_mul due QuantizedElemwiseMulOpShape bug * Fix R package installation https://github.com/apache/incubator-mxnet/issues/18042 * Fix centos ccache * Fix GPU Makefile staticbuild on CentOS7 * CentOS7 NCCL * CentOS7 staticbuild fix link with libculibos
2020-04-14 10:29:29 -07:00
cmake \
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} \
-DANDROID_ABI="arm64-v8a" \
-DANDROID_STL="c++_shared" \
-DUSE_CUDA=OFF \
-DUSE_LAPACK=OFF \
-DUSE_BLAS=Open \
Switch to C++17 and modernize toolchain + CI (#17984) As per #17968, require C++17 compatible compiler. For cuda code, use C++14 mode introduced in Cuda 9. C++17 support for Cuda will be available in Cuda 11. Switching to C++17 requires modernizing the toolchain, which exposed a number of technical debt issues in the codebase. All blocking issues are fixed as part of this PR. See the full list below. This PR contains the following specific changes: Switch CI pipeline to use gcc7 on Ubuntu and CentOS Switch CD pipeline to CentOS 7 with https://www.softwarecollections.org/en/scls/rhscl/devtoolset-7/ This enables us to build with gcc7 C++17 compiler while keeping a relatively old glibc requirement for distribution. Simplify ARM Edge builds Switch to standard Ubuntu / Debian cross-compilation toolchain for ARMv7, ARMv8 Switch to https://toolchains.bootlin.com/ toolchain for ARMv6 (the Debian ARMv6 toolchain is for ARMv4 + ARMv5 + ARMv6, but we wish to only target ARMv6 and make use of ARMv6 features) Remove reliance on dockcross for cross compilation. Simplify Jetson build Use standard Ubuntu / Debian cross-compilation toolchain for ARMv8 Upgrade to Cuda 10 and Jetpack 4.3 Simplify build setup Simplify QEMU ARM virtualization test setup on CI Remove complex "Virtual Machine in Docker" logic and run a QEMU based Docker container instead based on arm32v7/ubuntu Fix out of bounds vector accesses in SoftmaxGradOpType MKLDNNFCBackward Fix use of non-standard rand_r function (which is not available on anymore on newer Android toolchains and shouldn't be use in any case). Fix reproducibility of RNN with Dropout Fix reproducibility of DGL Graph Sampling Operators Update tests for Android Edge build to NDK19. The previously used standalone toolchain is obsolete. Those Dockerfiles that required refactoring as part of the effort were refactored based on the following consideration Maximize the use of system dependencies provided by the distribution instead of manually installing dependencies from source or from third party vendors. This reduces the complexity of the installation process and essentially pins the dependency versions, increasing CI stability. Further, Dockerfile build speed is improved. To facilitate this, use recent distribution versions. We still ensure backwards compatibility via CentOS7 based build and test stages Minimize the number of layers in the Dockerfile. Don't have 5 different script files executed, each calling apt-get update and install, but just execute once. Speeds up the build and reduces image size. Keep each Dockerfile simple and tailored to a purpose, instead of running 20 scripts to install dependencies for every thinkable scenario, which is unmaintainable. Some more small changes: Remove outdated references to Cuda 7 and Cuda 8 in various files. Remove C++03 support in mshadow Disable broken tests NumpyBooleanAssignForwardCPU #17990 test_init.test_rsp_const_init #17988 quantized_elemwise_mul #18034 List of squashed commits * cpp standard * Remove leftover files of Cuda 7 and Cuda 8 support * thrust 1.9.8 for clang10 * compiler warnings * Disable broken test_init.test_rsp_const_init * Disable tests invoking NumpyBooleanAssignForwardCPU * Fix out of bounds access in SoftmaxGradOpType * Use CentOS 7 for staticbuilds CentOS 7 fullfills the requirements for PEP 599 manylinux-2014 and provides a C++17 toolchain. * Fix MKLDNNFCBackward * Update edge toolchain * Support platforms without rand_r * Cleanup random.h * Greatly simplify qemu setup * Remove unused functions in Jenkins_steps.groovy * Skip quantized_elemwise_mul due QuantizedElemwiseMulOpShape bug * Fix R package installation https://github.com/apache/incubator-mxnet/issues/18042 * Fix centos ccache * Fix GPU Makefile staticbuild on CentOS7 * CentOS7 NCCL * CentOS7 staticbuild fix link with libculibos
2020-04-14 10:29:29 -07:00
-DUSE_OPENCV=OFF \
-DUSE_OPENMP=OFF \
-DUSE_SIGNAL_HANDLER=ON \
-G Ninja /work/mxnet
ninja
}
build_centos7_cpu() {
set -ex
cd /work/build
Switch to C++17 and modernize toolchain + CI (#17984) As per #17968, require C++17 compatible compiler. For cuda code, use C++14 mode introduced in Cuda 9. C++17 support for Cuda will be available in Cuda 11. Switching to C++17 requires modernizing the toolchain, which exposed a number of technical debt issues in the codebase. All blocking issues are fixed as part of this PR. See the full list below. This PR contains the following specific changes: Switch CI pipeline to use gcc7 on Ubuntu and CentOS Switch CD pipeline to CentOS 7 with https://www.softwarecollections.org/en/scls/rhscl/devtoolset-7/ This enables us to build with gcc7 C++17 compiler while keeping a relatively old glibc requirement for distribution. Simplify ARM Edge builds Switch to standard Ubuntu / Debian cross-compilation toolchain for ARMv7, ARMv8 Switch to https://toolchains.bootlin.com/ toolchain for ARMv6 (the Debian ARMv6 toolchain is for ARMv4 + ARMv5 + ARMv6, but we wish to only target ARMv6 and make use of ARMv6 features) Remove reliance on dockcross for cross compilation. Simplify Jetson build Use standard Ubuntu / Debian cross-compilation toolchain for ARMv8 Upgrade to Cuda 10 and Jetpack 4.3 Simplify build setup Simplify QEMU ARM virtualization test setup on CI Remove complex "Virtual Machine in Docker" logic and run a QEMU based Docker container instead based on arm32v7/ubuntu Fix out of bounds vector accesses in SoftmaxGradOpType MKLDNNFCBackward Fix use of non-standard rand_r function (which is not available on anymore on newer Android toolchains and shouldn't be use in any case). Fix reproducibility of RNN with Dropout Fix reproducibility of DGL Graph Sampling Operators Update tests for Android Edge build to NDK19. The previously used standalone toolchain is obsolete. Those Dockerfiles that required refactoring as part of the effort were refactored based on the following consideration Maximize the use of system dependencies provided by the distribution instead of manually installing dependencies from source or from third party vendors. This reduces the complexity of the installation process and essentially pins the dependency versions, increasing CI stability. Further, Dockerfile build speed is improved. To facilitate this, use recent distribution versions. We still ensure backwards compatibility via CentOS7 based build and test stages Minimize the number of layers in the Dockerfile. Don't have 5 different script files executed, each calling apt-get update and install, but just execute once. Speeds up the build and reduces image size. Keep each Dockerfile simple and tailored to a purpose, instead of running 20 scripts to install dependencies for every thinkable scenario, which is unmaintainable. Some more small changes: Remove outdated references to Cuda 7 and Cuda 8 in various files. Remove C++03 support in mshadow Disable broken tests NumpyBooleanAssignForwardCPU #17990 test_init.test_rsp_const_init #17988 quantized_elemwise_mul #18034 List of squashed commits * cpp standard * Remove leftover files of Cuda 7 and Cuda 8 support * thrust 1.9.8 for clang10 * compiler warnings * Disable broken test_init.test_rsp_const_init * Disable tests invoking NumpyBooleanAssignForwardCPU * Fix out of bounds access in SoftmaxGradOpType * Use CentOS 7 for staticbuilds CentOS 7 fullfills the requirements for PEP 599 manylinux-2014 and provides a C++17 toolchain. * Fix MKLDNNFCBackward * Update edge toolchain * Support platforms without rand_r * Cleanup random.h * Greatly simplify qemu setup * Remove unused functions in Jenkins_steps.groovy * Skip quantized_elemwise_mul due QuantizedElemwiseMulOpShape bug * Fix R package installation https://github.com/apache/incubator-mxnet/issues/18042 * Fix centos ccache * Fix GPU Makefile staticbuild on CentOS7 * CentOS7 NCCL * CentOS7 staticbuild fix link with libculibos
2020-04-14 10:29:29 -07:00
source /opt/rh/devtoolset-7/enable
# Opt in to newer GCC C++ ABI. devtoolset defaults to ABI Version 2.
export CXXFLAGS="-fabi-version=11 -fabi-compat-version=7"
cmake \
-DCMAKE_BUILD_TYPE="RelWithDebInfo" \
-DUSE_ONEDNN=OFF \
-DUSE_DIST_KVSTORE=ON \
-DUSE_CUDA=OFF \
-DBUILD_EXTENSION_PATH=/work/mxnet/example/extensions/lib_external_ops \
-DUSE_INT64_TENSOR_SIZE=OFF \
-DUSE_BLAS=Open \
-G Ninja /work/mxnet
ninja
}
build_centos7_onednn() {
set -ex
cd /work/build
Switch to C++17 and modernize toolchain + CI (#17984) As per #17968, require C++17 compatible compiler. For cuda code, use C++14 mode introduced in Cuda 9. C++17 support for Cuda will be available in Cuda 11. Switching to C++17 requires modernizing the toolchain, which exposed a number of technical debt issues in the codebase. All blocking issues are fixed as part of this PR. See the full list below. This PR contains the following specific changes: Switch CI pipeline to use gcc7 on Ubuntu and CentOS Switch CD pipeline to CentOS 7 with https://www.softwarecollections.org/en/scls/rhscl/devtoolset-7/ This enables us to build with gcc7 C++17 compiler while keeping a relatively old glibc requirement for distribution. Simplify ARM Edge builds Switch to standard Ubuntu / Debian cross-compilation toolchain for ARMv7, ARMv8 Switch to https://toolchains.bootlin.com/ toolchain for ARMv6 (the Debian ARMv6 toolchain is for ARMv4 + ARMv5 + ARMv6, but we wish to only target ARMv6 and make use of ARMv6 features) Remove reliance on dockcross for cross compilation. Simplify Jetson build Use standard Ubuntu / Debian cross-compilation toolchain for ARMv8 Upgrade to Cuda 10 and Jetpack 4.3 Simplify build setup Simplify QEMU ARM virtualization test setup on CI Remove complex "Virtual Machine in Docker" logic and run a QEMU based Docker container instead based on arm32v7/ubuntu Fix out of bounds vector accesses in SoftmaxGradOpType MKLDNNFCBackward Fix use of non-standard rand_r function (which is not available on anymore on newer Android toolchains and shouldn't be use in any case). Fix reproducibility of RNN with Dropout Fix reproducibility of DGL Graph Sampling Operators Update tests for Android Edge build to NDK19. The previously used standalone toolchain is obsolete. Those Dockerfiles that required refactoring as part of the effort were refactored based on the following consideration Maximize the use of system dependencies provided by the distribution instead of manually installing dependencies from source or from third party vendors. This reduces the complexity of the installation process and essentially pins the dependency versions, increasing CI stability. Further, Dockerfile build speed is improved. To facilitate this, use recent distribution versions. We still ensure backwards compatibility via CentOS7 based build and test stages Minimize the number of layers in the Dockerfile. Don't have 5 different script files executed, each calling apt-get update and install, but just execute once. Speeds up the build and reduces image size. Keep each Dockerfile simple and tailored to a purpose, instead of running 20 scripts to install dependencies for every thinkable scenario, which is unmaintainable. Some more small changes: Remove outdated references to Cuda 7 and Cuda 8 in various files. Remove C++03 support in mshadow Disable broken tests NumpyBooleanAssignForwardCPU #17990 test_init.test_rsp_const_init #17988 quantized_elemwise_mul #18034 List of squashed commits * cpp standard * Remove leftover files of Cuda 7 and Cuda 8 support * thrust 1.9.8 for clang10 * compiler warnings * Disable broken test_init.test_rsp_const_init * Disable tests invoking NumpyBooleanAssignForwardCPU * Fix out of bounds access in SoftmaxGradOpType * Use CentOS 7 for staticbuilds CentOS 7 fullfills the requirements for PEP 599 manylinux-2014 and provides a C++17 toolchain. * Fix MKLDNNFCBackward * Update edge toolchain * Support platforms without rand_r * Cleanup random.h * Greatly simplify qemu setup * Remove unused functions in Jenkins_steps.groovy * Skip quantized_elemwise_mul due QuantizedElemwiseMulOpShape bug * Fix R package installation https://github.com/apache/incubator-mxnet/issues/18042 * Fix centos ccache * Fix GPU Makefile staticbuild on CentOS7 * CentOS7 NCCL * CentOS7 staticbuild fix link with libculibos
2020-04-14 10:29:29 -07:00
source /opt/rh/devtoolset-7/enable
# Opt in to newer GCC C++ ABI. devtoolset defaults to ABI Version 2.
export CXXFLAGS="-fabi-version=11 -fabi-compat-version=7"
cmake -DUSE_BLAS=Open \
-DUSE_ONEDNN=ON \
-DUSE_CUDA=OFF \
-DUSE_INT64_TENSOR_SIZE=OFF \
-G Ninja /work/mxnet
ninja
}
build_centos7_gpu() {
set -ex
cd /work/build
Switch to C++17 and modernize toolchain + CI (#17984) As per #17968, require C++17 compatible compiler. For cuda code, use C++14 mode introduced in Cuda 9. C++17 support for Cuda will be available in Cuda 11. Switching to C++17 requires modernizing the toolchain, which exposed a number of technical debt issues in the codebase. All blocking issues are fixed as part of this PR. See the full list below. This PR contains the following specific changes: Switch CI pipeline to use gcc7 on Ubuntu and CentOS Switch CD pipeline to CentOS 7 with https://www.softwarecollections.org/en/scls/rhscl/devtoolset-7/ This enables us to build with gcc7 C++17 compiler while keeping a relatively old glibc requirement for distribution. Simplify ARM Edge builds Switch to standard Ubuntu / Debian cross-compilation toolchain for ARMv7, ARMv8 Switch to https://toolchains.bootlin.com/ toolchain for ARMv6 (the Debian ARMv6 toolchain is for ARMv4 + ARMv5 + ARMv6, but we wish to only target ARMv6 and make use of ARMv6 features) Remove reliance on dockcross for cross compilation. Simplify Jetson build Use standard Ubuntu / Debian cross-compilation toolchain for ARMv8 Upgrade to Cuda 10 and Jetpack 4.3 Simplify build setup Simplify QEMU ARM virtualization test setup on CI Remove complex "Virtual Machine in Docker" logic and run a QEMU based Docker container instead based on arm32v7/ubuntu Fix out of bounds vector accesses in SoftmaxGradOpType MKLDNNFCBackward Fix use of non-standard rand_r function (which is not available on anymore on newer Android toolchains and shouldn't be use in any case). Fix reproducibility of RNN with Dropout Fix reproducibility of DGL Graph Sampling Operators Update tests for Android Edge build to NDK19. The previously used standalone toolchain is obsolete. Those Dockerfiles that required refactoring as part of the effort were refactored based on the following consideration Maximize the use of system dependencies provided by the distribution instead of manually installing dependencies from source or from third party vendors. This reduces the complexity of the installation process and essentially pins the dependency versions, increasing CI stability. Further, Dockerfile build speed is improved. To facilitate this, use recent distribution versions. We still ensure backwards compatibility via CentOS7 based build and test stages Minimize the number of layers in the Dockerfile. Don't have 5 different script files executed, each calling apt-get update and install, but just execute once. Speeds up the build and reduces image size. Keep each Dockerfile simple and tailored to a purpose, instead of running 20 scripts to install dependencies for every thinkable scenario, which is unmaintainable. Some more small changes: Remove outdated references to Cuda 7 and Cuda 8 in various files. Remove C++03 support in mshadow Disable broken tests NumpyBooleanAssignForwardCPU #17990 test_init.test_rsp_const_init #17988 quantized_elemwise_mul #18034 List of squashed commits * cpp standard * Remove leftover files of Cuda 7 and Cuda 8 support * thrust 1.9.8 for clang10 * compiler warnings * Disable broken test_init.test_rsp_const_init * Disable tests invoking NumpyBooleanAssignForwardCPU * Fix out of bounds access in SoftmaxGradOpType * Use CentOS 7 for staticbuilds CentOS 7 fullfills the requirements for PEP 599 manylinux-2014 and provides a C++17 toolchain. * Fix MKLDNNFCBackward * Update edge toolchain * Support platforms without rand_r * Cleanup random.h * Greatly simplify qemu setup * Remove unused functions in Jenkins_steps.groovy * Skip quantized_elemwise_mul due QuantizedElemwiseMulOpShape bug * Fix R package installation https://github.com/apache/incubator-mxnet/issues/18042 * Fix centos ccache * Fix GPU Makefile staticbuild on CentOS7 * CentOS7 NCCL * CentOS7 staticbuild fix link with libculibos
2020-04-14 10:29:29 -07:00
source /opt/rh/devtoolset-7/enable
# Opt in to newer GCC C++ ABI. devtoolset defaults to ABI Version 2.
export CXXFLAGS="-fabi-version=11 -fabi-compat-version=7"
cmake \
-DCMAKE_BUILD_TYPE="RelWithDebInfo" \
-DUSE_BLAS=Open \
-DUSE_ONEDNN=ON \
-DUSE_CUDA=ON \
-DMXNET_CUDA_ARCH="$CI_CMAKE_CUDA10_ARCH" \
-DUSE_DIST_KVSTORE=ON \
-DBUILD_EXTENSION_PATH=/work/mxnet/example/extensions/lib_external_ops \
-DUSE_INT64_TENSOR_SIZE=OFF \
-G Ninja /work/mxnet
ninja
}
build_ubuntu_cpu() {
build_ubuntu_cpu_openblas
}
build_ubuntu_cpu_openblas() {
set -ex
cd /work/build
CXXFLAGS="-Wno-error=strict-overflow" CC=gcc-7 CXX=g++-7 cmake \
-DCMAKE_BUILD_TYPE="RelWithDebInfo" \
-DENABLE_TESTCOVERAGE=ON \
-DUSE_TVM_OP=ON \
-DUSE_BLAS=Open \
-DUSE_ONEDNN=OFF \
-DUSE_CUDA=OFF \
-DUSE_DIST_KVSTORE=ON \
-DBUILD_CYTHON_MODULES=ON \
-DBUILD_EXTENSION_PATH=/work/mxnet/example/extensions/lib_external_ops \
-G Ninja /work/mxnet
ninja -j$(($(nproc)/2))
}
build_ubuntu_cpu_mkl() {
set -ex
cd /work/build
CC=gcc-7 CXX=g++-7 cmake \
-DCMAKE_BUILD_TYPE="RelWithDebInfo" \
-DENABLE_TESTCOVERAGE=OFF \
-DUSE_ONEDNN=OFF \
-DUSE_CUDA=OFF \
-DUSE_TVM_OP=ON \
[PERFORMANCE] [master] Layer normalization code from Marian for CPU (#19602) * Layer normalization code from Marian * Remove MKL version of LayerNorm. Experiment with OMP_NUM_THREADS=4, times in s, c5.12xlarge |batchxchanne| New code | MKL | | 1x 32 | 0.0000288| 0.0000278| | 128x 32 | 0.0000308| 0.0000311| | 2560x 32 | 0.0000712| 0.0000672| | 4096x 32 | 0.0000946| 0.0000910| | 8192x 32 | 0.0001597| 0.0001523| |16384x 32 | 0.0002905| 0.0002619| | 1x 64 | 0.0000264| 0.0000256| | 128x 64 | 0.0000339| 0.0000330| | 2560x 64 | 0.0000829| 0.0000972| | 4096x 64 | 0.0001137| 0.0001356| | 8192x 64 | 0.0002027| 0.0002435| |16384x 64 | 0.0003715| 0.0004639| | 1x 128 | 0.0000262| 0.0000263| | 128x 128 | 0.0000325| 0.0000389| | 2560x 128 | 0.0001074| 0.0001580| | 4096x 128 | 0.0001505| 0.0002336| | 8192x 128 | 0.0002861| 0.0004481| |16384x 128 | 0.0005648| 0.0008613| | 1x 256 | 0.0000273| 0.0000276| | 128x 256 | 0.0000390| 0.0000431| | 2560x 256 | 0.0001533| 0.0002811| | 4096x 256 | 0.0002258| 0.0004300| | 8192x 256 | 0.0004300| 0.0008464| |16384x 256 | 0.0010436| 0.0017613| | 1x 512 | 0.0000256| 0.0000302| | 128x 512 | 0.0000408| 0.0000551| | 2560x 512 | 0.0002444| 0.0005225| | 4096x 512 | 0.0003828| 0.0008147| | 8192x 512 | 0.0008832| 0.0017192| |16384x 512 | 0.0058463| 0.0074497| | 1x 768 | 0.0000252| 0.0000308| | 128x 768 | 0.0000450| 0.0000676| | 2560x 768 | 0.0003440| 0.0007719| | 4096x 768 | 0.0005890| 0.0013346| | 8192x 768 | 0.0014946| 0.0026145| |16384x 768 | 0.0089495| 0.0113557| | 1x 1024 | 0.0000285| 0.0000308| | 128x 1024 | 0.0000487| 0.0000786| | 2560x 1024 | 0.0004614| 0.0010190| | 4096x 1024 | 0.0008083| 0.0017376| | 8192x 1024 | 0.0059020| 0.0075588| |16384x 1024 | 0.0116553| 0.0146855| Benchmark program ```python import mxnet as mx import time def time_procedure(shape, count): data = mx.nd.random_uniform(shape=shape, low=-1.0, high = 1.0) factors = mx.nd.random_uniform(shape=(shape[-1],)) mx.nd.waitall() begin = time.time() for i in range(0, count): out = mx.nd.LayerNorm(data, factors, factors) mx.nd.waitall() return (time.time() - begin) / count count = 200 for channel in [32, 64, 128, 256, 512, 768, 1024]: for batch in [1, 128, 2560, 4096, 8192, 16384]: s = (batch, channel) timing = time_procedure(s, count) print("{:5d}x{:5d} | {:.7f}".format(s[0], s[1], timing)) ``` * Enable pragma omp simd on MSVC * Fix MSVC error C3016: 'j': index variable in OpenMP 'for' statement must have signed integral type * Try to make MSVC happy since it doesn't have ssize_t * Revert "Remove MKL version of LayerNorm." This reverts commit 740c4726c3068ac30b3809cd6280fa7e91af8c52. * Restore MKL layer normalization code, but it isn't called yet * Pull division out of the hot loop * Option to use MKL version requested by @samskalicky * Add -DUSE_MKL_LAYERNORM=ON to ubuntu MKL CPU test Co-authored-by: Kenneth Heafield <kheafiel@amazon.com>
2021-01-04 08:57:05 +00:00
-DUSE_MKL_LAYERNORM=ON \
-DUSE_BLAS=MKL \
-DBUILD_EXTENSION_PATH=/work/mxnet/example/extensions/lib_external_ops \
-GNinja /work/mxnet
ninja
}
build_ubuntu_cpu_cmake_debug() {
set -ex
cd /work/build
CC=gcc-7 CXX=g++-7 cmake \
-DCMAKE_BUILD_TYPE=Debug \
-DENABLE_TESTCOVERAGE=ON \
-DUSE_CUDA=OFF \
-DUSE_TVM_OP=ON \
-DUSE_BLAS=Open \
-DUSE_OPENMP=OFF \
-DUSE_OPENCV=ON \
-DUSE_SIGNAL_HANDLER=ON \
-G Ninja \
/work/mxnet
ninja
}
build_ubuntu_cpu_cmake_no_tvm_op() {
set -ex
cd /work/build
CC=gcc-7 CXX=g++-7 cmake \
-DUSE_CUDA=OFF \
-DUSE_TVM_OP=OFF \
-DUSE_BLAS=Open \
-DUSE_OPENMP=OFF \
-DUSE_OPENCV=ON \
-DUSE_SIGNAL_HANDLER=ON \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_EXTENSION_PATH=/work/mxnet/example/extensions/lib_external_ops \
-G Ninja \
/work/mxnet
ninja
}
build_ubuntu_cpu_cmake_asan() {
set -ex
cd /work/build
cmake \
-DUSE_CUDA=OFF \
-DUSE_BLAS=Open \
-DUSE_ONEDNN=OFF \
-DUSE_OPENMP=OFF \
-DUSE_OPENCV=OFF \
-DCMAKE_BUILD_TYPE=Debug \
-DUSE_GPERFTOOLS=OFF \
-DUSE_JEMALLOC=OFF \
-DUSE_ASAN=ON \
/work/mxnet
make -j $(nproc) mxnet
}
build_ubuntu_cpu_gcc8_werror() {
set -ex
cd /work/build
CC=gcc-8 CXX=g++-8 cmake \
-DUSE_BLAS=Open \
-DUSE_CUDA=OFF \
-DCMAKE_BUILD_TYPE="RelWithDebInfo" \
-GNinja /work/mxnet
ninja
}
build_ubuntu_cpu_clang10_werror() {
set -ex
cd /work/build
CXX=clang++-10 CC=clang-10 cmake \
-DUSE_BLAS=Open \
-DUSE_CUDA=OFF \
-DCMAKE_BUILD_TYPE="RelWithDebInfo" \
-GNinja /work/mxnet
ninja
}
build_ubuntu_gpu_clang10_werror() {
set -ex
cd /work/build
# Disable cpp package as OpWrapperGenerator.py dlopens libmxnet.so,
# requiring presence of cuda driver libraries that are missing on CI host
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/cuda-10.1/targets/x86_64-linux/lib/stubs
Switch to C++17 and modernize toolchain + CI (#17984) As per #17968, require C++17 compatible compiler. For cuda code, use C++14 mode introduced in Cuda 9. C++17 support for Cuda will be available in Cuda 11. Switching to C++17 requires modernizing the toolchain, which exposed a number of technical debt issues in the codebase. All blocking issues are fixed as part of this PR. See the full list below. This PR contains the following specific changes: Switch CI pipeline to use gcc7 on Ubuntu and CentOS Switch CD pipeline to CentOS 7 with https://www.softwarecollections.org/en/scls/rhscl/devtoolset-7/ This enables us to build with gcc7 C++17 compiler while keeping a relatively old glibc requirement for distribution. Simplify ARM Edge builds Switch to standard Ubuntu / Debian cross-compilation toolchain for ARMv7, ARMv8 Switch to https://toolchains.bootlin.com/ toolchain for ARMv6 (the Debian ARMv6 toolchain is for ARMv4 + ARMv5 + ARMv6, but we wish to only target ARMv6 and make use of ARMv6 features) Remove reliance on dockcross for cross compilation. Simplify Jetson build Use standard Ubuntu / Debian cross-compilation toolchain for ARMv8 Upgrade to Cuda 10 and Jetpack 4.3 Simplify build setup Simplify QEMU ARM virtualization test setup on CI Remove complex "Virtual Machine in Docker" logic and run a QEMU based Docker container instead based on arm32v7/ubuntu Fix out of bounds vector accesses in SoftmaxGradOpType MKLDNNFCBackward Fix use of non-standard rand_r function (which is not available on anymore on newer Android toolchains and shouldn't be use in any case). Fix reproducibility of RNN with Dropout Fix reproducibility of DGL Graph Sampling Operators Update tests for Android Edge build to NDK19. The previously used standalone toolchain is obsolete. Those Dockerfiles that required refactoring as part of the effort were refactored based on the following consideration Maximize the use of system dependencies provided by the distribution instead of manually installing dependencies from source or from third party vendors. This reduces the complexity of the installation process and essentially pins the dependency versions, increasing CI stability. Further, Dockerfile build speed is improved. To facilitate this, use recent distribution versions. We still ensure backwards compatibility via CentOS7 based build and test stages Minimize the number of layers in the Dockerfile. Don't have 5 different script files executed, each calling apt-get update and install, but just execute once. Speeds up the build and reduces image size. Keep each Dockerfile simple and tailored to a purpose, instead of running 20 scripts to install dependencies for every thinkable scenario, which is unmaintainable. Some more small changes: Remove outdated references to Cuda 7 and Cuda 8 in various files. Remove C++03 support in mshadow Disable broken tests NumpyBooleanAssignForwardCPU #17990 test_init.test_rsp_const_init #17988 quantized_elemwise_mul #18034 List of squashed commits * cpp standard * Remove leftover files of Cuda 7 and Cuda 8 support * thrust 1.9.8 for clang10 * compiler warnings * Disable broken test_init.test_rsp_const_init * Disable tests invoking NumpyBooleanAssignForwardCPU * Fix out of bounds access in SoftmaxGradOpType * Use CentOS 7 for staticbuilds CentOS 7 fullfills the requirements for PEP 599 manylinux-2014 and provides a C++17 toolchain. * Fix MKLDNNFCBackward * Update edge toolchain * Support platforms without rand_r * Cleanup random.h * Greatly simplify qemu setup * Remove unused functions in Jenkins_steps.groovy * Skip quantized_elemwise_mul due QuantizedElemwiseMulOpShape bug * Fix R package installation https://github.com/apache/incubator-mxnet/issues/18042 * Fix centos ccache * Fix GPU Makefile staticbuild on CentOS7 * CentOS7 NCCL * CentOS7 staticbuild fix link with libculibos
2020-04-14 10:29:29 -07:00
# Workaround https://github.com/thrust/thrust/issues/1072
# Can be deleted on Cuda 11
export CXXFLAGS="-I/usr/local/thrust"
CXX=clang++-10 CC=clang-10 cmake \
-DUSE_BLAS=Open \
-DUSE_CUDA=ON \
-DUSE_NVML=OFF \
-DMXNET_CUDA_ARCH="$CI_CMAKE_CUDA_ARCH" \
-DCMAKE_BUILD_TYPE="RelWithDebInfo" \
-GNinja /work/mxnet
ninja
}
Switch to C++17 and modernize toolchain + CI (#17984) As per #17968, require C++17 compatible compiler. For cuda code, use C++14 mode introduced in Cuda 9. C++17 support for Cuda will be available in Cuda 11. Switching to C++17 requires modernizing the toolchain, which exposed a number of technical debt issues in the codebase. All blocking issues are fixed as part of this PR. See the full list below. This PR contains the following specific changes: Switch CI pipeline to use gcc7 on Ubuntu and CentOS Switch CD pipeline to CentOS 7 with https://www.softwarecollections.org/en/scls/rhscl/devtoolset-7/ This enables us to build with gcc7 C++17 compiler while keeping a relatively old glibc requirement for distribution. Simplify ARM Edge builds Switch to standard Ubuntu / Debian cross-compilation toolchain for ARMv7, ARMv8 Switch to https://toolchains.bootlin.com/ toolchain for ARMv6 (the Debian ARMv6 toolchain is for ARMv4 + ARMv5 + ARMv6, but we wish to only target ARMv6 and make use of ARMv6 features) Remove reliance on dockcross for cross compilation. Simplify Jetson build Use standard Ubuntu / Debian cross-compilation toolchain for ARMv8 Upgrade to Cuda 10 and Jetpack 4.3 Simplify build setup Simplify QEMU ARM virtualization test setup on CI Remove complex "Virtual Machine in Docker" logic and run a QEMU based Docker container instead based on arm32v7/ubuntu Fix out of bounds vector accesses in SoftmaxGradOpType MKLDNNFCBackward Fix use of non-standard rand_r function (which is not available on anymore on newer Android toolchains and shouldn't be use in any case). Fix reproducibility of RNN with Dropout Fix reproducibility of DGL Graph Sampling Operators Update tests for Android Edge build to NDK19. The previously used standalone toolchain is obsolete. Those Dockerfiles that required refactoring as part of the effort were refactored based on the following consideration Maximize the use of system dependencies provided by the distribution instead of manually installing dependencies from source or from third party vendors. This reduces the complexity of the installation process and essentially pins the dependency versions, increasing CI stability. Further, Dockerfile build speed is improved. To facilitate this, use recent distribution versions. We still ensure backwards compatibility via CentOS7 based build and test stages Minimize the number of layers in the Dockerfile. Don't have 5 different script files executed, each calling apt-get update and install, but just execute once. Speeds up the build and reduces image size. Keep each Dockerfile simple and tailored to a purpose, instead of running 20 scripts to install dependencies for every thinkable scenario, which is unmaintainable. Some more small changes: Remove outdated references to Cuda 7 and Cuda 8 in various files. Remove C++03 support in mshadow Disable broken tests NumpyBooleanAssignForwardCPU #17990 test_init.test_rsp_const_init #17988 quantized_elemwise_mul #18034 List of squashed commits * cpp standard * Remove leftover files of Cuda 7 and Cuda 8 support * thrust 1.9.8 for clang10 * compiler warnings * Disable broken test_init.test_rsp_const_init * Disable tests invoking NumpyBooleanAssignForwardCPU * Fix out of bounds access in SoftmaxGradOpType * Use CentOS 7 for staticbuilds CentOS 7 fullfills the requirements for PEP 599 manylinux-2014 and provides a C++17 toolchain. * Fix MKLDNNFCBackward * Update edge toolchain * Support platforms without rand_r * Cleanup random.h * Greatly simplify qemu setup * Remove unused functions in Jenkins_steps.groovy * Skip quantized_elemwise_mul due QuantizedElemwiseMulOpShape bug * Fix R package installation https://github.com/apache/incubator-mxnet/issues/18042 * Fix centos ccache * Fix GPU Makefile staticbuild on CentOS7 * CentOS7 NCCL * CentOS7 staticbuild fix link with libculibos
2020-04-14 10:29:29 -07:00
build_ubuntu_cpu_clang6() {
set -ex
cd /work/build
Support static link to openblas & autodetect LP64 vs ILP64 settings (#19174) This PR forces static link to libopenblas.a on all CI pipelines to avoid the name clashing issue (except for windows where visual studio does not support static link to openblas according to this https://github.com/xianyi/OpenBLAS/wiki/How-to-use-OpenBLAS-in-Microsoft-Visual-Studio see bottom). On ubuntu and centos7 we changed from apt get/ yum openblas and lapack to building openblas(blas+lapack) from source. Also we add support LAPACKE api for non-mkl builds. The background is: In mxnet we wrap lapack functions in c_lapack_api.h so that we hide the differences in the underlying blas/lapack libraries such as mkl, openblas, atlas, and accelerate. For mkl we use/wrap the LAPACKE (https://www.netlib.org/lapack/lapacke.html) c interfaces which are the cleanest. For the rest of the libraries we wrap the old CLAPACK interfaces. Openblas is by default built with lapack support and the binary will contain a full set of LAPACKE functions. Thus this poc adds a build option with which we can use the LAPACKE apis even for openblas. This change will make ilp64 blas/lapack support easier as now we have the same wrapping logic or both mkl and openblas with USE_LAPACKE_INTERFACE = ON. Support for ilp64 mkl #19067 will automatically mean support for ilp64 openblas. Known issue: linux distros ship openblas binaries WITHOUT lapack so this option can only work if we build openblas from source. This is not a problem for our mxnet binary distributions as we always use our own openblas build there. However, For users building mxnet from source they must be advised against using this option unless they also build openblas from source
2020-12-04 11:00:18 -08:00
export OpenBLAS_HOME=/usr/local/openblas-clang/
Switch to C++17 and modernize toolchain + CI (#17984) As per #17968, require C++17 compatible compiler. For cuda code, use C++14 mode introduced in Cuda 9. C++17 support for Cuda will be available in Cuda 11. Switching to C++17 requires modernizing the toolchain, which exposed a number of technical debt issues in the codebase. All blocking issues are fixed as part of this PR. See the full list below. This PR contains the following specific changes: Switch CI pipeline to use gcc7 on Ubuntu and CentOS Switch CD pipeline to CentOS 7 with https://www.softwarecollections.org/en/scls/rhscl/devtoolset-7/ This enables us to build with gcc7 C++17 compiler while keeping a relatively old glibc requirement for distribution. Simplify ARM Edge builds Switch to standard Ubuntu / Debian cross-compilation toolchain for ARMv7, ARMv8 Switch to https://toolchains.bootlin.com/ toolchain for ARMv6 (the Debian ARMv6 toolchain is for ARMv4 + ARMv5 + ARMv6, but we wish to only target ARMv6 and make use of ARMv6 features) Remove reliance on dockcross for cross compilation. Simplify Jetson build Use standard Ubuntu / Debian cross-compilation toolchain for ARMv8 Upgrade to Cuda 10 and Jetpack 4.3 Simplify build setup Simplify QEMU ARM virtualization test setup on CI Remove complex "Virtual Machine in Docker" logic and run a QEMU based Docker container instead based on arm32v7/ubuntu Fix out of bounds vector accesses in SoftmaxGradOpType MKLDNNFCBackward Fix use of non-standard rand_r function (which is not available on anymore on newer Android toolchains and shouldn't be use in any case). Fix reproducibility of RNN with Dropout Fix reproducibility of DGL Graph Sampling Operators Update tests for Android Edge build to NDK19. The previously used standalone toolchain is obsolete. Those Dockerfiles that required refactoring as part of the effort were refactored based on the following consideration Maximize the use of system dependencies provided by the distribution instead of manually installing dependencies from source or from third party vendors. This reduces the complexity of the installation process and essentially pins the dependency versions, increasing CI stability. Further, Dockerfile build speed is improved. To facilitate this, use recent distribution versions. We still ensure backwards compatibility via CentOS7 based build and test stages Minimize the number of layers in the Dockerfile. Don't have 5 different script files executed, each calling apt-get update and install, but just execute once. Speeds up the build and reduces image size. Keep each Dockerfile simple and tailored to a purpose, instead of running 20 scripts to install dependencies for every thinkable scenario, which is unmaintainable. Some more small changes: Remove outdated references to Cuda 7 and Cuda 8 in various files. Remove C++03 support in mshadow Disable broken tests NumpyBooleanAssignForwardCPU #17990 test_init.test_rsp_const_init #17988 quantized_elemwise_mul #18034 List of squashed commits * cpp standard * Remove leftover files of Cuda 7 and Cuda 8 support * thrust 1.9.8 for clang10 * compiler warnings * Disable broken test_init.test_rsp_const_init * Disable tests invoking NumpyBooleanAssignForwardCPU * Fix out of bounds access in SoftmaxGradOpType * Use CentOS 7 for staticbuilds CentOS 7 fullfills the requirements for PEP 599 manylinux-2014 and provides a C++17 toolchain. * Fix MKLDNNFCBackward * Update edge toolchain * Support platforms without rand_r * Cleanup random.h * Greatly simplify qemu setup * Remove unused functions in Jenkins_steps.groovy * Skip quantized_elemwise_mul due QuantizedElemwiseMulOpShape bug * Fix R package installation https://github.com/apache/incubator-mxnet/issues/18042 * Fix centos ccache * Fix GPU Makefile staticbuild on CentOS7 * CentOS7 NCCL * CentOS7 staticbuild fix link with libculibos
2020-04-14 10:29:29 -07:00
CXX=clang++-6.0 CC=clang-6.0 cmake \
-DUSE_BLAS=Open \
-DUSE_ONEDNN=OFF \
-DUSE_CUDA=OFF \
-DUSE_OPENMP=OFF \
-DUSE_DIST_KVSTORE=ON \
-G Ninja /work/mxnet
ninja
}
build_ubuntu_cpu_clang100() {
set -ex
cd /work/build
Support static link to openblas & autodetect LP64 vs ILP64 settings (#19174) This PR forces static link to libopenblas.a on all CI pipelines to avoid the name clashing issue (except for windows where visual studio does not support static link to openblas according to this https://github.com/xianyi/OpenBLAS/wiki/How-to-use-OpenBLAS-in-Microsoft-Visual-Studio see bottom). On ubuntu and centos7 we changed from apt get/ yum openblas and lapack to building openblas(blas+lapack) from source. Also we add support LAPACKE api for non-mkl builds. The background is: In mxnet we wrap lapack functions in c_lapack_api.h so that we hide the differences in the underlying blas/lapack libraries such as mkl, openblas, atlas, and accelerate. For mkl we use/wrap the LAPACKE (https://www.netlib.org/lapack/lapacke.html) c interfaces which are the cleanest. For the rest of the libraries we wrap the old CLAPACK interfaces. Openblas is by default built with lapack support and the binary will contain a full set of LAPACKE functions. Thus this poc adds a build option with which we can use the LAPACKE apis even for openblas. This change will make ilp64 blas/lapack support easier as now we have the same wrapping logic or both mkl and openblas with USE_LAPACKE_INTERFACE = ON. Support for ilp64 mkl #19067 will automatically mean support for ilp64 openblas. Known issue: linux distros ship openblas binaries WITHOUT lapack so this option can only work if we build openblas from source. This is not a problem for our mxnet binary distributions as we always use our own openblas build there. However, For users building mxnet from source they must be advised against using this option unless they also build openblas from source
2020-12-04 11:00:18 -08:00
export OpenBLAS_HOME=/usr/local/openblas-clang/
CXX=clang++-10 CC=clang-10 cmake \
-DUSE_BLAS=Open \
-DUSE_ONEDNN=OFF \
-DUSE_CUDA=OFF \
-DUSE_OPENMP=ON \
-DUSE_DIST_KVSTORE=ON \
-G Ninja /work/mxnet
ninja
}
build_ubuntu_cpu_clang_tidy() {
set -ex
cd /work/build
Support static link to openblas & autodetect LP64 vs ILP64 settings (#19174) This PR forces static link to libopenblas.a on all CI pipelines to avoid the name clashing issue (except for windows where visual studio does not support static link to openblas according to this https://github.com/xianyi/OpenBLAS/wiki/How-to-use-OpenBLAS-in-Microsoft-Visual-Studio see bottom). On ubuntu and centos7 we changed from apt get/ yum openblas and lapack to building openblas(blas+lapack) from source. Also we add support LAPACKE api for non-mkl builds. The background is: In mxnet we wrap lapack functions in c_lapack_api.h so that we hide the differences in the underlying blas/lapack libraries such as mkl, openblas, atlas, and accelerate. For mkl we use/wrap the LAPACKE (https://www.netlib.org/lapack/lapacke.html) c interfaces which are the cleanest. For the rest of the libraries we wrap the old CLAPACK interfaces. Openblas is by default built with lapack support and the binary will contain a full set of LAPACKE functions. Thus this poc adds a build option with which we can use the LAPACKE apis even for openblas. This change will make ilp64 blas/lapack support easier as now we have the same wrapping logic or both mkl and openblas with USE_LAPACKE_INTERFACE = ON. Support for ilp64 mkl #19067 will automatically mean support for ilp64 openblas. Known issue: linux distros ship openblas binaries WITHOUT lapack so this option can only work if we build openblas from source. This is not a problem for our mxnet binary distributions as we always use our own openblas build there. However, For users building mxnet from source they must be advised against using this option unless they also build openblas from source
2020-12-04 11:00:18 -08:00
export OpenBLAS_HOME=/usr/local/openblas-clang/
# TODO(leezu) USE_OPENMP=OFF 3rdparty/dmlc-core/CMakeLists.txt:79 broken?
CXX=clang++-10 CC=clang-10 cmake \
-DUSE_BLAS=Open \
-DUSE_ONEDNN=OFF \
-DUSE_CUDA=OFF \
-DUSE_OPENMP=OFF \
-DCMAKE_BUILD_TYPE=Debug \
-DUSE_DIST_KVSTORE=ON \
-DCMAKE_CXX_CLANG_TIDY=clang-tidy-10 \
-G Ninja /work/mxnet
ninja
}
build_ubuntu_cpu_clang6_onednn() {
set -ex
cd /work/build
Support static link to openblas & autodetect LP64 vs ILP64 settings (#19174) This PR forces static link to libopenblas.a on all CI pipelines to avoid the name clashing issue (except for windows where visual studio does not support static link to openblas according to this https://github.com/xianyi/OpenBLAS/wiki/How-to-use-OpenBLAS-in-Microsoft-Visual-Studio see bottom). On ubuntu and centos7 we changed from apt get/ yum openblas and lapack to building openblas(blas+lapack) from source. Also we add support LAPACKE api for non-mkl builds. The background is: In mxnet we wrap lapack functions in c_lapack_api.h so that we hide the differences in the underlying blas/lapack libraries such as mkl, openblas, atlas, and accelerate. For mkl we use/wrap the LAPACKE (https://www.netlib.org/lapack/lapacke.html) c interfaces which are the cleanest. For the rest of the libraries we wrap the old CLAPACK interfaces. Openblas is by default built with lapack support and the binary will contain a full set of LAPACKE functions. Thus this poc adds a build option with which we can use the LAPACKE apis even for openblas. This change will make ilp64 blas/lapack support easier as now we have the same wrapping logic or both mkl and openblas with USE_LAPACKE_INTERFACE = ON. Support for ilp64 mkl #19067 will automatically mean support for ilp64 openblas. Known issue: linux distros ship openblas binaries WITHOUT lapack so this option can only work if we build openblas from source. This is not a problem for our mxnet binary distributions as we always use our own openblas build there. However, For users building mxnet from source they must be advised against using this option unless they also build openblas from source
2020-12-04 11:00:18 -08:00
export OpenBLAS_HOME=/usr/local/openblas-clang/
Switch to C++17 and modernize toolchain + CI (#17984) As per #17968, require C++17 compatible compiler. For cuda code, use C++14 mode introduced in Cuda 9. C++17 support for Cuda will be available in Cuda 11. Switching to C++17 requires modernizing the toolchain, which exposed a number of technical debt issues in the codebase. All blocking issues are fixed as part of this PR. See the full list below. This PR contains the following specific changes: Switch CI pipeline to use gcc7 on Ubuntu and CentOS Switch CD pipeline to CentOS 7 with https://www.softwarecollections.org/en/scls/rhscl/devtoolset-7/ This enables us to build with gcc7 C++17 compiler while keeping a relatively old glibc requirement for distribution. Simplify ARM Edge builds Switch to standard Ubuntu / Debian cross-compilation toolchain for ARMv7, ARMv8 Switch to https://toolchains.bootlin.com/ toolchain for ARMv6 (the Debian ARMv6 toolchain is for ARMv4 + ARMv5 + ARMv6, but we wish to only target ARMv6 and make use of ARMv6 features) Remove reliance on dockcross for cross compilation. Simplify Jetson build Use standard Ubuntu / Debian cross-compilation toolchain for ARMv8 Upgrade to Cuda 10 and Jetpack 4.3 Simplify build setup Simplify QEMU ARM virtualization test setup on CI Remove complex "Virtual Machine in Docker" logic and run a QEMU based Docker container instead based on arm32v7/ubuntu Fix out of bounds vector accesses in SoftmaxGradOpType MKLDNNFCBackward Fix use of non-standard rand_r function (which is not available on anymore on newer Android toolchains and shouldn't be use in any case). Fix reproducibility of RNN with Dropout Fix reproducibility of DGL Graph Sampling Operators Update tests for Android Edge build to NDK19. The previously used standalone toolchain is obsolete. Those Dockerfiles that required refactoring as part of the effort were refactored based on the following consideration Maximize the use of system dependencies provided by the distribution instead of manually installing dependencies from source or from third party vendors. This reduces the complexity of the installation process and essentially pins the dependency versions, increasing CI stability. Further, Dockerfile build speed is improved. To facilitate this, use recent distribution versions. We still ensure backwards compatibility via CentOS7 based build and test stages Minimize the number of layers in the Dockerfile. Don't have 5 different script files executed, each calling apt-get update and install, but just execute once. Speeds up the build and reduces image size. Keep each Dockerfile simple and tailored to a purpose, instead of running 20 scripts to install dependencies for every thinkable scenario, which is unmaintainable. Some more small changes: Remove outdated references to Cuda 7 and Cuda 8 in various files. Remove C++03 support in mshadow Disable broken tests NumpyBooleanAssignForwardCPU #17990 test_init.test_rsp_const_init #17988 quantized_elemwise_mul #18034 List of squashed commits * cpp standard * Remove leftover files of Cuda 7 and Cuda 8 support * thrust 1.9.8 for clang10 * compiler warnings * Disable broken test_init.test_rsp_const_init * Disable tests invoking NumpyBooleanAssignForwardCPU * Fix out of bounds access in SoftmaxGradOpType * Use CentOS 7 for staticbuilds CentOS 7 fullfills the requirements for PEP 599 manylinux-2014 and provides a C++17 toolchain. * Fix MKLDNNFCBackward * Update edge toolchain * Support platforms without rand_r * Cleanup random.h * Greatly simplify qemu setup * Remove unused functions in Jenkins_steps.groovy * Skip quantized_elemwise_mul due QuantizedElemwiseMulOpShape bug * Fix R package installation https://github.com/apache/incubator-mxnet/issues/18042 * Fix centos ccache * Fix GPU Makefile staticbuild on CentOS7 * CentOS7 NCCL * CentOS7 staticbuild fix link with libculibos
2020-04-14 10:29:29 -07:00
CXX=clang++-6.0 CC=clang-6.0 cmake \
-DUSE_BLAS=Open \
-DUSE_ONEDNN=ON \
-DUSE_CUDA=OFF \
-DUSE_OPENMP=OFF \
-G Ninja /work/mxnet
ninja
}
build_ubuntu_cpu_clang100_onednn() {
set -ex
cd /work/build
Support static link to openblas & autodetect LP64 vs ILP64 settings (#19174) This PR forces static link to libopenblas.a on all CI pipelines to avoid the name clashing issue (except for windows where visual studio does not support static link to openblas according to this https://github.com/xianyi/OpenBLAS/wiki/How-to-use-OpenBLAS-in-Microsoft-Visual-Studio see bottom). On ubuntu and centos7 we changed from apt get/ yum openblas and lapack to building openblas(blas+lapack) from source. Also we add support LAPACKE api for non-mkl builds. The background is: In mxnet we wrap lapack functions in c_lapack_api.h so that we hide the differences in the underlying blas/lapack libraries such as mkl, openblas, atlas, and accelerate. For mkl we use/wrap the LAPACKE (https://www.netlib.org/lapack/lapacke.html) c interfaces which are the cleanest. For the rest of the libraries we wrap the old CLAPACK interfaces. Openblas is by default built with lapack support and the binary will contain a full set of LAPACKE functions. Thus this poc adds a build option with which we can use the LAPACKE apis even for openblas. This change will make ilp64 blas/lapack support easier as now we have the same wrapping logic or both mkl and openblas with USE_LAPACKE_INTERFACE = ON. Support for ilp64 mkl #19067 will automatically mean support for ilp64 openblas. Known issue: linux distros ship openblas binaries WITHOUT lapack so this option can only work if we build openblas from source. This is not a problem for our mxnet binary distributions as we always use our own openblas build there. However, For users building mxnet from source they must be advised against using this option unless they also build openblas from source
2020-12-04 11:00:18 -08:00
export OpenBLAS_HOME=/usr/local/openblas-clang/
CXX=clang++-10 CC=clang-10 cmake \
-DUSE_BLAS=Open \
-DUSE_ONEDNN=ON \
-DUSE_CUDA=OFF \
-G Ninja /work/mxnet
ninja
}
build_ubuntu_cpu_onednn() {
set -ex
cd /work/build
CC=gcc-7 CXX=g++-7 cmake \
-DCMAKE_BUILD_TYPE="RelWithDebInfo" \
-DENABLE_TESTCOVERAGE=ON \
-DUSE_TVM_OP=ON \
-DUSE_BLAS=Open \
-DUSE_ONEDNN=ON \
-DUSE_CUDA=OFF \
-DBUILD_EXTENSION_PATH=/work/mxnet/example/extensions/lib_external_ops \
-G Ninja /work/mxnet
ninja
}
build_ubuntu_cpu_onednn_mkl() {
set -ex
cd /work/build
CC=gcc-7 CXX=g++-7 cmake \
-DCMAKE_BUILD_TYPE="RelWithDebInfo" \
-DENABLE_TESTCOVERAGE=OFF \
-DUSE_ONEDNN=ON \
-DUSE_CUDA=OFF \
-DUSE_TVM_OP=ON \
-DUSE_BLAS=MKL \
-DBUILD_EXTENSION_PATH=/work/mxnet/example/extensions/lib_external_ops \
-GNinja /work/mxnet
ninja
}
[MXNET-703] TensorRT runtime integration (#11325) * [MXNET-703] TensorRT runtime integration Co-authored-by: Clement Fuji-Tsang <caenorst@hotmail.com> Co-authored-by: Kellen Sunderland <kellen.sunderland@gmail.com> * correctly assign self._optimized_symbol in executor * declare GetTrtCompatibleSubsets and ReplaceSubgraph only if MXNET_USE_TENSORRT * add comments in ReplaceSubgraph * Addressing Haibin's code review points * Check that shared_buffer is not empty when USE_TENSORRT is set * Added check that TensorRT binding is for inference only * Removed redundant decl. * WIP Refactored TRT integration and tests * Add more build guards, remove unused code * Remove ccache report * Remove redundant const in declaration * Clean Cmake TRT files * Remove TensorRT env var usage We don't want to use environment variables with TensorRT yet, the logic being that we want to try and have as much fwd compatiblity as possible when working on an experimental feature. Were we to add env vars they would have to be gaurenteed to work in the future until a major version change. Moving the functionality to a contrib call reduces this risk. * Use contrib optimize_graph instaed of bind * Clean up cycle detector * Convert lenet test to contrib optimize * Protect interface with trt build flag * Fix whitespace issues * Add another build guard to c_api * Move get_optimized_symbol to contrib area * Ignore gz files in test folder * Make trt optimization implicit * Remove unused declaration * Replace build guards with runtime errors * Change default value of TensorRT to off This is change applies to both TensorRT and non-TensorRT builds. * Warn user when TRT not active at runtime * Move TensorRTBind declaration, add descriptive errors * Test TensorRT graph execution, fix bugs * Fix lint and whitespace issues * Fix typo * Removed default value for set_use_tensorrt * Improved documentation and fixed spacing issues * Move static exec funcs to util files * Update comments to match util style * Apply const to loop element * Fix a few namespace issues * Make static funcs inline to avoid compiler warning * Remove unused inference code from lenet5_train * Add explicit trt contrib bind, update tests to use it * Rename trt bind call * Remove documentation that is not needed for trt * Reorder arguments, allow position calling
2018-08-10 02:38:04 -07:00
build_ubuntu_gpu_tensorrt() {
set -ex
export CC=gcc-7
export CXX=g++-7
export ONNX_NAMESPACE=onnx
export PYBIN=$(which python3)
PYVERFULL=$($PYBIN -V | awk '{print $2}')
export PYVER=${PYVERFULL%.*}
Switch to C++17 and modernize toolchain + CI (#17984) As per #17968, require C++17 compatible compiler. For cuda code, use C++14 mode introduced in Cuda 9. C++17 support for Cuda will be available in Cuda 11. Switching to C++17 requires modernizing the toolchain, which exposed a number of technical debt issues in the codebase. All blocking issues are fixed as part of this PR. See the full list below. This PR contains the following specific changes: Switch CI pipeline to use gcc7 on Ubuntu and CentOS Switch CD pipeline to CentOS 7 with https://www.softwarecollections.org/en/scls/rhscl/devtoolset-7/ This enables us to build with gcc7 C++17 compiler while keeping a relatively old glibc requirement for distribution. Simplify ARM Edge builds Switch to standard Ubuntu / Debian cross-compilation toolchain for ARMv7, ARMv8 Switch to https://toolchains.bootlin.com/ toolchain for ARMv6 (the Debian ARMv6 toolchain is for ARMv4 + ARMv5 + ARMv6, but we wish to only target ARMv6 and make use of ARMv6 features) Remove reliance on dockcross for cross compilation. Simplify Jetson build Use standard Ubuntu / Debian cross-compilation toolchain for ARMv8 Upgrade to Cuda 10 and Jetpack 4.3 Simplify build setup Simplify QEMU ARM virtualization test setup on CI Remove complex "Virtual Machine in Docker" logic and run a QEMU based Docker container instead based on arm32v7/ubuntu Fix out of bounds vector accesses in SoftmaxGradOpType MKLDNNFCBackward Fix use of non-standard rand_r function (which is not available on anymore on newer Android toolchains and shouldn't be use in any case). Fix reproducibility of RNN with Dropout Fix reproducibility of DGL Graph Sampling Operators Update tests for Android Edge build to NDK19. The previously used standalone toolchain is obsolete. Those Dockerfiles that required refactoring as part of the effort were refactored based on the following consideration Maximize the use of system dependencies provided by the distribution instead of manually installing dependencies from source or from third party vendors. This reduces the complexity of the installation process and essentially pins the dependency versions, increasing CI stability. Further, Dockerfile build speed is improved. To facilitate this, use recent distribution versions. We still ensure backwards compatibility via CentOS7 based build and test stages Minimize the number of layers in the Dockerfile. Don't have 5 different script files executed, each calling apt-get update and install, but just execute once. Speeds up the build and reduces image size. Keep each Dockerfile simple and tailored to a purpose, instead of running 20 scripts to install dependencies for every thinkable scenario, which is unmaintainable. Some more small changes: Remove outdated references to Cuda 7 and Cuda 8 in various files. Remove C++03 support in mshadow Disable broken tests NumpyBooleanAssignForwardCPU #17990 test_init.test_rsp_const_init #17988 quantized_elemwise_mul #18034 List of squashed commits * cpp standard * Remove leftover files of Cuda 7 and Cuda 8 support * thrust 1.9.8 for clang10 * compiler warnings * Disable broken test_init.test_rsp_const_init * Disable tests invoking NumpyBooleanAssignForwardCPU * Fix out of bounds access in SoftmaxGradOpType * Use CentOS 7 for staticbuilds CentOS 7 fullfills the requirements for PEP 599 manylinux-2014 and provides a C++17 toolchain. * Fix MKLDNNFCBackward * Update edge toolchain * Support platforms without rand_r * Cleanup random.h * Greatly simplify qemu setup * Remove unused functions in Jenkins_steps.groovy * Skip quantized_elemwise_mul due QuantizedElemwiseMulOpShape bug * Fix R package installation https://github.com/apache/incubator-mxnet/issues/18042 * Fix centos ccache * Fix GPU Makefile staticbuild on CentOS7 * CentOS7 NCCL * CentOS7 staticbuild fix link with libculibos
2020-04-14 10:29:29 -07:00
[MXNET-703] TensorRT runtime integration (#11325) * [MXNET-703] TensorRT runtime integration Co-authored-by: Clement Fuji-Tsang <caenorst@hotmail.com> Co-authored-by: Kellen Sunderland <kellen.sunderland@gmail.com> * correctly assign self._optimized_symbol in executor * declare GetTrtCompatibleSubsets and ReplaceSubgraph only if MXNET_USE_TENSORRT * add comments in ReplaceSubgraph * Addressing Haibin's code review points * Check that shared_buffer is not empty when USE_TENSORRT is set * Added check that TensorRT binding is for inference only * Removed redundant decl. * WIP Refactored TRT integration and tests * Add more build guards, remove unused code * Remove ccache report * Remove redundant const in declaration * Clean Cmake TRT files * Remove TensorRT env var usage We don't want to use environment variables with TensorRT yet, the logic being that we want to try and have as much fwd compatiblity as possible when working on an experimental feature. Were we to add env vars they would have to be gaurenteed to work in the future until a major version change. Moving the functionality to a contrib call reduces this risk. * Use contrib optimize_graph instaed of bind * Clean up cycle detector * Convert lenet test to contrib optimize * Protect interface with trt build flag * Fix whitespace issues * Add another build guard to c_api * Move get_optimized_symbol to contrib area * Ignore gz files in test folder * Make trt optimization implicit * Remove unused declaration * Replace build guards with runtime errors * Change default value of TensorRT to off This is change applies to both TensorRT and non-TensorRT builds. * Warn user when TRT not active at runtime * Move TensorRTBind declaration, add descriptive errors * Test TensorRT graph execution, fix bugs * Fix lint and whitespace issues * Fix typo * Removed default value for set_use_tensorrt * Improved documentation and fixed spacing issues * Move static exec funcs to util files * Update comments to match util style * Apply const to loop element * Fix a few namespace issues * Make static funcs inline to avoid compiler warning * Remove unused inference code from lenet5_train * Add explicit trt contrib bind, update tests to use it * Rename trt bind call * Remove documentation that is not needed for trt * Reorder arguments, allow position calling
2018-08-10 02:38:04 -07:00
# Build ONNX
pushd .
echo "Installing ONNX."
cd 3rdparty/onnx-tensorrt/third_party/onnx
rm -rf build
mkdir -p build
cd build
cmake -DPYTHON_EXECUTABLE=$PYBIN -DCMAKE_CXX_FLAGS=-I/usr/include/python${PYVER} -DBUILD_SHARED_LIBS=ON ..
make -j$(nproc)
[MXNET-703] TensorRT runtime integration (#11325) * [MXNET-703] TensorRT runtime integration Co-authored-by: Clement Fuji-Tsang <caenorst@hotmail.com> Co-authored-by: Kellen Sunderland <kellen.sunderland@gmail.com> * correctly assign self._optimized_symbol in executor * declare GetTrtCompatibleSubsets and ReplaceSubgraph only if MXNET_USE_TENSORRT * add comments in ReplaceSubgraph * Addressing Haibin's code review points * Check that shared_buffer is not empty when USE_TENSORRT is set * Added check that TensorRT binding is for inference only * Removed redundant decl. * WIP Refactored TRT integration and tests * Add more build guards, remove unused code * Remove ccache report * Remove redundant const in declaration * Clean Cmake TRT files * Remove TensorRT env var usage We don't want to use environment variables with TensorRT yet, the logic being that we want to try and have as much fwd compatiblity as possible when working on an experimental feature. Were we to add env vars they would have to be gaurenteed to work in the future until a major version change. Moving the functionality to a contrib call reduces this risk. * Use contrib optimize_graph instaed of bind * Clean up cycle detector * Convert lenet test to contrib optimize * Protect interface with trt build flag * Fix whitespace issues * Add another build guard to c_api * Move get_optimized_symbol to contrib area * Ignore gz files in test folder * Make trt optimization implicit * Remove unused declaration * Replace build guards with runtime errors * Change default value of TensorRT to off This is change applies to both TensorRT and non-TensorRT builds. * Warn user when TRT not active at runtime * Move TensorRTBind declaration, add descriptive errors * Test TensorRT graph execution, fix bugs * Fix lint and whitespace issues * Fix typo * Removed default value for set_use_tensorrt * Improved documentation and fixed spacing issues * Move static exec funcs to util files * Update comments to match util style * Apply const to loop element * Fix a few namespace issues * Make static funcs inline to avoid compiler warning * Remove unused inference code from lenet5_train * Add explicit trt contrib bind, update tests to use it * Rename trt bind call * Remove documentation that is not needed for trt * Reorder arguments, allow position calling
2018-08-10 02:38:04 -07:00
export LIBRARY_PATH=`pwd`:`pwd`/onnx/:$LIBRARY_PATH
export CPLUS_INCLUDE_PATH=`pwd`:$CPLUS_INCLUDE_PATH
export CXXFLAGS=-I`pwd`
[MXNET-703] TensorRT runtime integration (#11325) * [MXNET-703] TensorRT runtime integration Co-authored-by: Clement Fuji-Tsang <caenorst@hotmail.com> Co-authored-by: Kellen Sunderland <kellen.sunderland@gmail.com> * correctly assign self._optimized_symbol in executor * declare GetTrtCompatibleSubsets and ReplaceSubgraph only if MXNET_USE_TENSORRT * add comments in ReplaceSubgraph * Addressing Haibin's code review points * Check that shared_buffer is not empty when USE_TENSORRT is set * Added check that TensorRT binding is for inference only * Removed redundant decl. * WIP Refactored TRT integration and tests * Add more build guards, remove unused code * Remove ccache report * Remove redundant const in declaration * Clean Cmake TRT files * Remove TensorRT env var usage We don't want to use environment variables with TensorRT yet, the logic being that we want to try and have as much fwd compatiblity as possible when working on an experimental feature. Were we to add env vars they would have to be gaurenteed to work in the future until a major version change. Moving the functionality to a contrib call reduces this risk. * Use contrib optimize_graph instaed of bind * Clean up cycle detector * Convert lenet test to contrib optimize * Protect interface with trt build flag * Fix whitespace issues * Add another build guard to c_api * Move get_optimized_symbol to contrib area * Ignore gz files in test folder * Make trt optimization implicit * Remove unused declaration * Replace build guards with runtime errors * Change default value of TensorRT to off This is change applies to both TensorRT and non-TensorRT builds. * Warn user when TRT not active at runtime * Move TensorRTBind declaration, add descriptive errors * Test TensorRT graph execution, fix bugs * Fix lint and whitespace issues * Fix typo * Removed default value for set_use_tensorrt * Improved documentation and fixed spacing issues * Move static exec funcs to util files * Update comments to match util style * Apply const to loop element * Fix a few namespace issues * Make static funcs inline to avoid compiler warning * Remove unused inference code from lenet5_train * Add explicit trt contrib bind, update tests to use it * Rename trt bind call * Remove documentation that is not needed for trt * Reorder arguments, allow position calling
2018-08-10 02:38:04 -07:00
popd
# Build ONNX-TensorRT
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib
export CPLUS_INCLUDE_PATH=${CPLUS_INCLUDE_PATH}:/usr/local/cuda/targets/x86_64-linux/include/
[MXNET-703] TensorRT runtime integration (#11325) * [MXNET-703] TensorRT runtime integration Co-authored-by: Clement Fuji-Tsang <caenorst@hotmail.com> Co-authored-by: Kellen Sunderland <kellen.sunderland@gmail.com> * correctly assign self._optimized_symbol in executor * declare GetTrtCompatibleSubsets and ReplaceSubgraph only if MXNET_USE_TENSORRT * add comments in ReplaceSubgraph * Addressing Haibin's code review points * Check that shared_buffer is not empty when USE_TENSORRT is set * Added check that TensorRT binding is for inference only * Removed redundant decl. * WIP Refactored TRT integration and tests * Add more build guards, remove unused code * Remove ccache report * Remove redundant const in declaration * Clean Cmake TRT files * Remove TensorRT env var usage We don't want to use environment variables with TensorRT yet, the logic being that we want to try and have as much fwd compatiblity as possible when working on an experimental feature. Were we to add env vars they would have to be gaurenteed to work in the future until a major version change. Moving the functionality to a contrib call reduces this risk. * Use contrib optimize_graph instaed of bind * Clean up cycle detector * Convert lenet test to contrib optimize * Protect interface with trt build flag * Fix whitespace issues * Add another build guard to c_api * Move get_optimized_symbol to contrib area * Ignore gz files in test folder * Make trt optimization implicit * Remove unused declaration * Replace build guards with runtime errors * Change default value of TensorRT to off This is change applies to both TensorRT and non-TensorRT builds. * Warn user when TRT not active at runtime * Move TensorRTBind declaration, add descriptive errors * Test TensorRT graph execution, fix bugs * Fix lint and whitespace issues * Fix typo * Removed default value for set_use_tensorrt * Improved documentation and fixed spacing issues * Move static exec funcs to util files * Update comments to match util style * Apply const to loop element * Fix a few namespace issues * Make static funcs inline to avoid compiler warning * Remove unused inference code from lenet5_train * Add explicit trt contrib bind, update tests to use it * Rename trt bind call * Remove documentation that is not needed for trt * Reorder arguments, allow position calling
2018-08-10 02:38:04 -07:00
pushd .
cd 3rdparty/onnx-tensorrt/
mkdir -p build
cd build
cmake -DPYTHON_EXECUTABLE=$PYBIN -DONNX_NAMESPACE=$ONNX_NAMESPACE ..
[MXNET-703] TensorRT runtime integration (#11325) * [MXNET-703] TensorRT runtime integration Co-authored-by: Clement Fuji-Tsang <caenorst@hotmail.com> Co-authored-by: Kellen Sunderland <kellen.sunderland@gmail.com> * correctly assign self._optimized_symbol in executor * declare GetTrtCompatibleSubsets and ReplaceSubgraph only if MXNET_USE_TENSORRT * add comments in ReplaceSubgraph * Addressing Haibin's code review points * Check that shared_buffer is not empty when USE_TENSORRT is set * Added check that TensorRT binding is for inference only * Removed redundant decl. * WIP Refactored TRT integration and tests * Add more build guards, remove unused code * Remove ccache report * Remove redundant const in declaration * Clean Cmake TRT files * Remove TensorRT env var usage We don't want to use environment variables with TensorRT yet, the logic being that we want to try and have as much fwd compatiblity as possible when working on an experimental feature. Were we to add env vars they would have to be gaurenteed to work in the future until a major version change. Moving the functionality to a contrib call reduces this risk. * Use contrib optimize_graph instaed of bind * Clean up cycle detector * Convert lenet test to contrib optimize * Protect interface with trt build flag * Fix whitespace issues * Add another build guard to c_api * Move get_optimized_symbol to contrib area * Ignore gz files in test folder * Make trt optimization implicit * Remove unused declaration * Replace build guards with runtime errors * Change default value of TensorRT to off This is change applies to both TensorRT and non-TensorRT builds. * Warn user when TRT not active at runtime * Move TensorRTBind declaration, add descriptive errors * Test TensorRT graph execution, fix bugs * Fix lint and whitespace issues * Fix typo * Removed default value for set_use_tensorrt * Improved documentation and fixed spacing issues * Move static exec funcs to util files * Update comments to match util style * Apply const to loop element * Fix a few namespace issues * Make static funcs inline to avoid compiler warning * Remove unused inference code from lenet5_train * Add explicit trt contrib bind, update tests to use it * Rename trt bind call * Remove documentation that is not needed for trt * Reorder arguments, allow position calling
2018-08-10 02:38:04 -07:00
make -j$(nproc)
export LIBRARY_PATH=`pwd`:$LIBRARY_PATH
popd
mkdir -p /work/mxnet/lib/
cp 3rdparty/onnx-tensorrt/third_party/onnx/build/*.so /work/mxnet/lib/
cp -L 3rdparty/onnx-tensorrt/build/libnvonnxparser.so /work/mxnet/lib/
[MXNET-703] TensorRT runtime integration (#11325) * [MXNET-703] TensorRT runtime integration Co-authored-by: Clement Fuji-Tsang <caenorst@hotmail.com> Co-authored-by: Kellen Sunderland <kellen.sunderland@gmail.com> * correctly assign self._optimized_symbol in executor * declare GetTrtCompatibleSubsets and ReplaceSubgraph only if MXNET_USE_TENSORRT * add comments in ReplaceSubgraph * Addressing Haibin's code review points * Check that shared_buffer is not empty when USE_TENSORRT is set * Added check that TensorRT binding is for inference only * Removed redundant decl. * WIP Refactored TRT integration and tests * Add more build guards, remove unused code * Remove ccache report * Remove redundant const in declaration * Clean Cmake TRT files * Remove TensorRT env var usage We don't want to use environment variables with TensorRT yet, the logic being that we want to try and have as much fwd compatiblity as possible when working on an experimental feature. Were we to add env vars they would have to be gaurenteed to work in the future until a major version change. Moving the functionality to a contrib call reduces this risk. * Use contrib optimize_graph instaed of bind * Clean up cycle detector * Convert lenet test to contrib optimize * Protect interface with trt build flag * Fix whitespace issues * Add another build guard to c_api * Move get_optimized_symbol to contrib area * Ignore gz files in test folder * Make trt optimization implicit * Remove unused declaration * Replace build guards with runtime errors * Change default value of TensorRT to off This is change applies to both TensorRT and non-TensorRT builds. * Warn user when TRT not active at runtime * Move TensorRTBind declaration, add descriptive errors * Test TensorRT graph execution, fix bugs * Fix lint and whitespace issues * Fix typo * Removed default value for set_use_tensorrt * Improved documentation and fixed spacing issues * Move static exec funcs to util files * Update comments to match util style * Apply const to loop element * Fix a few namespace issues * Make static funcs inline to avoid compiler warning * Remove unused inference code from lenet5_train * Add explicit trt contrib bind, update tests to use it * Rename trt bind call * Remove documentation that is not needed for trt * Reorder arguments, allow position calling
2018-08-10 02:38:04 -07:00
cd /work/build
cmake -DUSE_CUDA=1 \
-DUSE_CUDNN=1 \
-DUSE_OPENCV=1 \
-DUSE_TENSORRT=1 \
-DUSE_INT64_TENSOR_SIZE=1 \
-DUSE_OPENMP=0 \
-DUSE_BLAS=Open \
-DUSE_ONEDNN=0 \
-DUSE_NVML=OFF \
-DMXNET_CUDA_ARCH="$CI_CMAKE_CUDA_ARCH" \
-G Ninja \
/work/mxnet
ninja
[MXNET-703] TensorRT runtime integration (#11325) * [MXNET-703] TensorRT runtime integration Co-authored-by: Clement Fuji-Tsang <caenorst@hotmail.com> Co-authored-by: Kellen Sunderland <kellen.sunderland@gmail.com> * correctly assign self._optimized_symbol in executor * declare GetTrtCompatibleSubsets and ReplaceSubgraph only if MXNET_USE_TENSORRT * add comments in ReplaceSubgraph * Addressing Haibin's code review points * Check that shared_buffer is not empty when USE_TENSORRT is set * Added check that TensorRT binding is for inference only * Removed redundant decl. * WIP Refactored TRT integration and tests * Add more build guards, remove unused code * Remove ccache report * Remove redundant const in declaration * Clean Cmake TRT files * Remove TensorRT env var usage We don't want to use environment variables with TensorRT yet, the logic being that we want to try and have as much fwd compatiblity as possible when working on an experimental feature. Were we to add env vars they would have to be gaurenteed to work in the future until a major version change. Moving the functionality to a contrib call reduces this risk. * Use contrib optimize_graph instaed of bind * Clean up cycle detector * Convert lenet test to contrib optimize * Protect interface with trt build flag * Fix whitespace issues * Add another build guard to c_api * Move get_optimized_symbol to contrib area * Ignore gz files in test folder * Make trt optimization implicit * Remove unused declaration * Replace build guards with runtime errors * Change default value of TensorRT to off This is change applies to both TensorRT and non-TensorRT builds. * Warn user when TRT not active at runtime * Move TensorRTBind declaration, add descriptive errors * Test TensorRT graph execution, fix bugs * Fix lint and whitespace issues * Fix typo * Removed default value for set_use_tensorrt * Improved documentation and fixed spacing issues * Move static exec funcs to util files * Update comments to match util style * Apply const to loop element * Fix a few namespace issues * Make static funcs inline to avoid compiler warning * Remove unused inference code from lenet5_train * Add explicit trt contrib bind, update tests to use it * Rename trt bind call * Remove documentation that is not needed for trt * Reorder arguments, allow position calling
2018-08-10 02:38:04 -07:00
}
build_ubuntu_gpu_onednn() {
set -ex
cd /work/build
CC=gcc-7 CXX=g++-7 cmake \
-DCMAKE_BUILD_TYPE="RelWithDebInfo" \
-DUSE_BLAS=Open \
-DUSE_CUDA=ON \
-DUSE_NVML=OFF \
-DMXNET_CUDA_ARCH="$CI_CMAKE_CUDA_ARCH" \
-DBUILD_EXTENSION_PATH=/work/mxnet/example/extensions/lib_external_ops \
-G Ninja /work/mxnet
ninja
}
build_ubuntu_gpu_onednn_nocudnn() {
set -ex
cd /work/build
CC=gcc-7 CXX=g++-7 cmake \
-DCMAKE_BUILD_TYPE="RelWithDebInfo" \
-DUSE_BLAS=Open \
-DUSE_CUDA=ON \
-DUSE_NVML=OFF \
-DMXNET_CUDA_ARCH="$CI_CMAKE_CUDA_ARCH" \
-DUSE_CUDNN=OFF \
-DBUILD_EXTENSION_PATH=/work/mxnet/example/extensions/lib_external_ops \
-G Ninja /work/mxnet
ninja
}
build_ubuntu_gpu() {
set -ex
cd /work/build
# Work around to link libcuda to libmxnet
# should be removed after https://github.com/apache/incubator-mxnet/issues/17858 is resolved.
ln -s -f /usr/local/cuda/targets/x86_64-linux/lib/stubs/libcuda.so libcuda.so.1
export LIBRARY_PATH=${LIBRARY_PATH}:/work/build
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/work/build
CC=gcc-7 CXX=g++-7 cmake \
-DCMAKE_BUILD_TYPE="RelWithDebInfo" \
-DUSE_CUDA=ON \
-DUSE_NVML=OFF \
-DMXNET_CUDA_ARCH="$CI_CMAKE_CUDA_ARCH" \
-DUSE_CUDNN=ON \
-DUSE_CPP_PACKAGE=ON \
-DUSE_BLAS=Open \
-DUSE_ONEDNN=OFF \
-DUSE_DIST_KVSTORE=ON \
-DBUILD_CYTHON_MODULES=ON \
-DBUILD_EXTENSION_PATH=/work/mxnet/example/extensions/lib_external_ops \
-G Ninja /work/mxnet
ninja -j$(($(nproc)/2))
}
build_ubuntu_gpu_debug() {
set -ex
cd /work/build
CC=gcc-7 CXX=g++-7 cmake \
-DCMAKE_BUILD_TYPE=Debug \
-DUSE_CUDA=ON \
-DUSE_NVML=OFF \
-DMXNET_CUDA_ARCH="$CI_CMAKE_CUDA_ARCH" \
-DUSE_CUDNN=ON \
-DUSE_BLAS=Open \
-DUSE_ONEDNN=OFF \
-DUSE_DIST_KVSTORE=ON \
-DBUILD_CYTHON_MODULES=ON \
-G Ninja /work/mxnet
ninja
}
build_ubuntu_cpu_large_tensor() {
set -ex
cd /work/build
CC=gcc-7 CXX=g++-7 cmake \
-DUSE_SIGNAL_HANDLER=ON \
-DUSE_CUDA=OFF \
-DUSE_CUDNN=OFF \
-DUSE_BLAS=Open \
-DUSE_ONEDNN=ON \
-G Ninja \
/work/mxnet
ninja
}
build_ubuntu_gpu_large_tensor() {
set -ex
cd /work/build
CC=gcc-7 CXX=g++-7 cmake \
-DUSE_SIGNAL_HANDLER=ON \
-DUSE_CUDA=ON \
-DUSE_CUDNN=ON \
-DUSE_NVML=OFF \
-DUSE_BLAS=Open \
-DUSE_ONEDNN=ON \
-DUSE_DIST_KVSTORE=ON \
-DCMAKE_BUILD_TYPE=Release \
-DMXNET_CUDA_ARCH="$CI_CMAKE_CUDA_ARCH" \
-G Ninja \
/work/mxnet
ninja
}
# Testing
sanity_check() {
set -ex
sanity_clang
sanity_license
sanity_cmakelint
sanity_tutorial
sanity_python_prospector
sanity_cpp
}
sanity_cmakelint() {
set -exu
git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' | grep -E -z -v '^(3rdparty)|cmake/Modules/|cmake/upstream/' | xargs -0 cmakelint --config=.cmakelintrc --quiet
}
sanity_tutorial() {
set -ex
export DMLC_LOG_STACK_TRACE_DEPTH=100
OMP_NUM_THREADS=$(expr $(nproc) / 4) pytest -n 4 tests/tutorials/test_sanity_tutorials.py
}
sanity_license() {
set -ex
tools/license_header.py check
}
sanity_cpp() {
set -ex
3rdparty/dmlc-core/scripts/lint.py mxnet cpp include src plugin cpp-package tests --exclude_path src/operator/contrib/ctc_include include/onednn
}
sanity_python_prospector() {
set -e
set +x
# Run Prospector
python3 -m prospector --profile prospector.yaml | tee prospector-output.txt
error_cnt=$(awk '/Messages Found:/{print $NF}' prospector-output.txt)
if [ $error_cnt -ne 0 ]; then
echo 'Please fix the above Prospector warnings.'
rm -rf prospector-output.txt
exit 1
fi
rm -rf prospector-output.txt
}
sanity_clang() {
set -e
set +x
# .github/workgflows/greetings.yml passes BASE_SHA, GITHUB_RUN_ID, GITHUB_BASE_REF for pull requests.
BASE_SHA="${GITHUB_PR_BASE_SHA}"
GITHUB_RUN_ID="${GITHUB_PR_RUN_ID}"
GITHUB_BASE_REF="${GITHUB_PR_BASE_REF}"
if [ "${BASE_SHA}" == "" ]; then
BASE_SHA=`git show-ref --hash refs/remotes/origin/master`
if [ "${GITHUB_RUN_ID}" == "" ] || [ "${GITHUB_BASE_REF}" == "" ]; then
GITHUB_RUN_ID=`(git log --pretty=format:'%h' -n 1)`
GITHUB_BASE_REF="master"
fi
fi
git remote add "${GITHUB_RUN_ID}" https://github.com/apache/incubator-mxnet.git
git fetch "${GITHUB_RUN_ID}" "$GITHUB_BASE_REF"
tools/lint/clang_format_ci.sh "${BASE_SHA}"
GIT_DIFFERENCE=$(git diff)
if [[ -z $GIT_DIFFERENCE ]]; then
git remote remove "${GITHUB_RUN_ID}" # temporary remote is removed
return
fi
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo "| Clang-format failures found! Run: "
echo "| tools/lint/clang_format_ci.sh ${BASE_SHA} "
echo "| to fix this error. "
echo "| For more info, see: https://mxnet.apache.org/versions/master/community/clang_format_guide"
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo "$GIT_DIFFERENCE"
git remote remove "${GITHUB_RUN_ID}" # temporary remote is removed
exit 1
}
2019-05-23 12:48:44 +02:00
# Tests libmxnet
# Parameters:
# $1 -> mxnet_variant: The variant of the libmxnet.so library
cd_unittest_ubuntu() {
set -ex
source /opt/rh/rh-python38/enable
2019-05-23 12:48:44 +02:00
export PYTHONPATH=./python/
export MXNET_ONEDNN_DEBUG=0 # Ignored if not present
2019-05-23 12:48:44 +02:00
export MXNET_STORAGE_FALLBACK_LOG_VERBOSE=0
export MXNET_SUBGRAPH_VERBOSE=0
export MXNET_ENABLE_CYTHON=0
export CD_JOB=1 # signal this is a CD run so any unecessary tests can be skipped
export DMLC_LOG_STACK_TRACE_DEPTH=100
2019-05-23 12:48:44 +02:00
local mxnet_variant=${1:?"This function requires a mxnet variant as the first argument"}
OMP_NUM_THREADS=$(expr $(nproc) / 4) pytest -m 'not serial' -n 4 --durations=50 --verbose tests/python/unittest
pytest -m 'serial' --durations=50 --verbose tests/python/unittest
2019-05-23 12:48:44 +02:00
# https://github.com/apache/mxnet/issues/11801
2019-05-23 12:48:44 +02:00
# if [[ ${mxnet_variant} = "cpu" ]] || [[ ${mxnet_variant} = "mkl" ]]; then
# integrationtest_ubuntu_cpu_dist_kvstore
# fi
if [[ ${mxnet_variant} = cu* ]]; then
MXNET_GPU_MEM_POOL_TYPE=Unpooled \
MXNET_ENGINE_TYPE=NaiveEngine \
OMP_NUM_THREADS=$(expr $(nproc) / 4) pytest -m 'not serial' -k 'test_operator' -n 4 --durations=50 --verbose tests/python/gpu
MXNET_GPU_MEM_POOL_TYPE=Unpooled \
OMP_NUM_THREADS=$(expr $(nproc) / 4) pytest -m 'not serial' -k 'not test_operator and not test_amp_init.py' -n 4 --durations=50 --verbose tests/python/gpu
pytest -m 'serial' --durations=50 --verbose tests/python/gpu
pytest --durations=50 --verbose tests/python/gpu/test_amp_init.py
2019-05-23 12:48:44 +02:00
# TODO(szha): fix and reenable the hanging issue. tracked in #18098
# integrationtest_ubuntu_gpu_dist_kvstore
# TODO(eric-haibin-lin): fix and reenable
# integrationtest_ubuntu_gpu_byteps
2019-05-23 12:48:44 +02:00
fi
if [[ ${mxnet_variant} = *mkl ]]; then
OMP_NUM_THREADS=$(expr $(nproc) / 4) pytest -n 4 --durations=50 --verbose tests/python/dnnl
2019-05-23 12:48:44 +02:00
fi
}
unittest_ubuntu_python3_cpu_onnx() {
set -ex
export PYTHONPATH=./python/
export MXNET_SUBGRAPH_VERBOSE=0
export DMLC_LOG_STACK_TRACE_DEPTH=10
pytest --cov-report xml:onnx_unittest.xml --verbose tests/python/onnx/test_operators.py
pytest --cov-report xml:onnx_unittest.xml --cov-append --verbose tests/python/onnx/test_models.py
}
unittest_ubuntu_python3_cpu() {
set -ex
export PYTHONPATH=./python/
export MXNET_ONEDNN_DEBUG=0 # Ignored if not present
export MXNET_STORAGE_FALLBACK_LOG_VERBOSE=0
export MXNET_SUBGRAPH_VERBOSE=0
[MXNET-545] Fix broken cython build (#10951) * Fix broken build with cython 0.28 * Fix setup.py to be compatible with cython 0.28 * Fix broken cython ndarray module * Revised comments * Replace hard coded library path with one obtained by find_lib_path * Add documentation for MXNET_ENABLE_CYTHON and MXNET_ENFORCE_CYTHON * Add cython build to CI * Fix for cython CI * Adjust python environment for cython CI * Add make variables to set python executable * Fix typo * Fix nnvm include path * Does not use ccache for cython * Fix issues with the wildcards in the library list in Jenkinsfile * Fix issues with the wildcards in the library list in Jenkinsfile (continued) * Fix issues with the wildcards in the library list in Jenkinsfile (continued) * Intentionally introduce a bug to check that the tests actually runwith cython * Remove the intentionally introduced bug * Update installation doc * Retrigger CI * Run cython CI in ubuntu environment instead of CentOS environment * Commit a missed file * Fix a bug in check_cython * Refine environments for cython CI * Restore unrelated changes * Fix a problem occurring when the cython modules for python 2 and 3 are built successively * Trigger CI * Pin the cython version in the CI * Catch up #11320 * Remove optional arguments unused after #11320 * Trigger CI * Trigger CI * Trigger CI * Remove unnecessary stype argument from the NDArrayBase constructor * Revise confusing initialization of `_ndarray_cls` * Add cython build for python3 in CI * Fix misplaced cython build in CI * Adjust CI environments for cython * Fix invalid path for cython generated .so files in cmake build * Revert invalid fix * Revise docs * Revise check_cython * Temporaily use make instead of cmake for debugging * Temporal changes for debugging * Temporal changes for debugging * Temporaily use ctypes instead of cython modules for debugging * Temporaily disable ccache for debugging * Temporaily use make (DEV = 0) instead of cmake for debugging * Temporaily disable cudnn for debugging * Restore temporal changes * Temporarily disable coverage report * Adapt to Jenkinsfile_utils * Adapt to Jenkinsfile_utils (cont.) * Restore unrelated changes * Restore temporal changes * Resolving conflict * Test with the cmake build is removed * Add MXNET_ENABLE_CYTHON=0 to tensorrt test * Fix typo * Trigger CI * Trigger CI * Adapt to Jenkinsfile refactoring * Adapt to Jenkinsfile refactoring (cont.) * Trigger CI * Trigger CI * Stash missing cython modules * Trigger CI * CMake build of cython modules without unit tests * Fix typo * Trigger CI * Fix a mistake introduced in merging process * trigger test * Update Jenkinsfile_utils.groovy * Trigger CI * Trigger CI * Trigger CI * Trigger tests * Trigger tests * Trigger tests * Trigger tests * Trigger tests * Trigger tests * Trigger tests * Trigger tests
2019-05-25 07:36:30 +09:00
export MXNET_ENABLE_CYTHON=0
export DMLC_LOG_STACK_TRACE_DEPTH=100
OMP_NUM_THREADS=$(expr $(nproc) / 4) pytest -m 'not serial' -k 'not test_operator' -n 4 --durations=50 --cov-report xml:tests_unittest.xml --verbose tests/python/unittest
MXNET_ENGINE_TYPE=NaiveEngine \
OMP_NUM_THREADS=$(expr $(nproc) / 4) pytest -m 'not serial' -k 'test_operator' -n 4 --durations=50 --cov-report xml:tests_unittest.xml --cov-append --verbose tests/python/unittest
pytest -m 'serial' --durations=50 --cov-report xml:tests_unittest.xml --cov-append --verbose tests/python/unittest
}
unittest_ubuntu_python3_cpu_onednn() {
set -ex
[MXNET-290] MKLDNN support for model quantization (#10433) * mkldnn support for quantization * fix output number in graph * update licsence * modify Jenkinsfile * modify Jenkinsfile * mkldnn has no int8 fc api, excluded_sym_names includes fc for cpu * add mkldnn uint8 pass for quantization graph * update ut * retrig ic * remove no mkldnn quantization test temp * seperate mkldnn quantization ut from gpu quantization ut * rm dev_id check for cpu * add mkl tests dictionary * resolve review comments * simplify DequantizeStorageType() logic * simplify quantize/quantized_conv storage type logic * Add mkldnn_OIhw4i16o4i type case (needed by int8) * INT8 conv/pooling: share with FP32 convolution/pooling class/function * minor indent changes * Remove unnecessary mkldnn_quantized_pooling-inl.h * Fix minor issue * Fix lint * delete duplicated data type * fix bugs and convert requantize data to NDArray * fix lint * fix requantize storgetype * fix requantize storge type * Fix coding style comments * Fix compile issue * Change to use quantized_dtype option to support uint8/int8 scenarios * fix gpu test quantization failure * Fix indent * fix quantized pooling param parser * Fix imagenet_gen_qsym.py option style * retrigger jenkins * retrigger again * trigger jenkins * Resolve further comments * share test code * remove unnecessary test code * add test_quantize_model for cpu * add comments in quantize_graph_pass.cc * jenkins * jenkins * improve coding style * improve coding style * Add naive CPU quantization test back and share quantization code between naive-CPU/MKLDNN/GPU * rename test_quantization_cpu.py to test_quantization_mkldnn.py * code style * trigger * Adjust variable naming for test quantization * add qdtype for quantized op test case to test/bypass all cases explicitly * change expressions to be consistent * revert unnecessary change
2018-06-14 12:58:33 +08:00
export PYTHONPATH=./python/
export MXNET_ONEDNN_DEBUG=0 # Ignored if not present
export MXNET_STORAGE_FALLBACK_LOG_VERBOSE=0
export MXNET_SUBGRAPH_VERBOSE=0
[MXNET-545] Fix broken cython build (#10951) * Fix broken build with cython 0.28 * Fix setup.py to be compatible with cython 0.28 * Fix broken cython ndarray module * Revised comments * Replace hard coded library path with one obtained by find_lib_path * Add documentation for MXNET_ENABLE_CYTHON and MXNET_ENFORCE_CYTHON * Add cython build to CI * Fix for cython CI * Adjust python environment for cython CI * Add make variables to set python executable * Fix typo * Fix nnvm include path * Does not use ccache for cython * Fix issues with the wildcards in the library list in Jenkinsfile * Fix issues with the wildcards in the library list in Jenkinsfile (continued) * Fix issues with the wildcards in the library list in Jenkinsfile (continued) * Intentionally introduce a bug to check that the tests actually runwith cython * Remove the intentionally introduced bug * Update installation doc * Retrigger CI * Run cython CI in ubuntu environment instead of CentOS environment * Commit a missed file * Fix a bug in check_cython * Refine environments for cython CI * Restore unrelated changes * Fix a problem occurring when the cython modules for python 2 and 3 are built successively * Trigger CI * Pin the cython version in the CI * Catch up #11320 * Remove optional arguments unused after #11320 * Trigger CI * Trigger CI * Trigger CI * Remove unnecessary stype argument from the NDArrayBase constructor * Revise confusing initialization of `_ndarray_cls` * Add cython build for python3 in CI * Fix misplaced cython build in CI * Adjust CI environments for cython * Fix invalid path for cython generated .so files in cmake build * Revert invalid fix * Revise docs * Revise check_cython * Temporaily use make instead of cmake for debugging * Temporal changes for debugging * Temporal changes for debugging * Temporaily use ctypes instead of cython modules for debugging * Temporaily disable ccache for debugging * Temporaily use make (DEV = 0) instead of cmake for debugging * Temporaily disable cudnn for debugging * Restore temporal changes * Temporarily disable coverage report * Adapt to Jenkinsfile_utils * Adapt to Jenkinsfile_utils (cont.) * Restore unrelated changes * Restore temporal changes * Resolving conflict * Test with the cmake build is removed * Add MXNET_ENABLE_CYTHON=0 to tensorrt test * Fix typo * Trigger CI * Trigger CI * Adapt to Jenkinsfile refactoring * Adapt to Jenkinsfile refactoring (cont.) * Trigger CI * Trigger CI * Stash missing cython modules * Trigger CI * CMake build of cython modules without unit tests * Fix typo * Trigger CI * Fix a mistake introduced in merging process * trigger test * Update Jenkinsfile_utils.groovy * Trigger CI * Trigger CI * Trigger CI * Trigger tests * Trigger tests * Trigger tests * Trigger tests * Trigger tests * Trigger tests * Trigger tests * Trigger tests
2019-05-25 07:36:30 +09:00
export MXNET_ENABLE_CYTHON=0
export DMLC_LOG_STACK_TRACE_DEPTH=100
OMP_NUM_THREADS=$(expr $(nproc) / 4) pytest -m 'not serial' -k 'not test_operator' -n 4 --durations=50 --cov-report xml:tests_unittest.xml --verbose tests/python/unittest
MXNET_ENGINE_TYPE=NaiveEngine \
OMP_NUM_THREADS=$(expr $(nproc) / 4) pytest -m 'not serial' -k 'test_operator' -n 4 --durations=50 --cov-report xml:tests_unittest.xml --cov-append --verbose tests/python/unittest
pytest -m 'serial' --durations=50 --cov-report xml:tests_unittest.xml --cov-append --verbose tests/python/unittest
pytest --durations=50 --cov-report xml:tests_mkl.xml --verbose tests/python/dnnl
}
unittest_array_api_standardization() {
set -ex
python3 -m pip install -e /work/mxnet/python --user
cd ..
git clone https://github.com/data-apis/array-api-tests.git
pushd /work/array-api-tests
git checkout c1dba80a196a03f880d2e0a998a272fb3867b720
export ARRAY_API_TESTS_MODULE=mxnet.numpy pytest
export MXNET_ENABLE_CYTHON=1
export DMLC_LOG_STACK_TRACE_DEPTH=100
python3 -m pytest --reruns 3 --durations=50 --cov-report xml:tests_api.xml --verbose array_api_tests/test_creation_functions.py
python3 -m pytest --reruns 3 --durations=50 --cov-report xml:tests_api.xml --verbose array_api_tests/test_indexing.py
python3 -m pytest --reruns 3 --durations=50 --cov-report xml:tests_api.xml --verbose array_api_tests/test_elementwise_functions.py
python3 -m pytest --reruns 3 --durations=50 --cov-report xml:tests_api.xml --verbose array_api_tests/test_constants.py
python3 -m pytest --reruns 3 --durations=50 --cov-report xml:tests_api.xml --verbose array_api_tests/test_broadcasting.py
python3 -m pytest --reruns 3 --durations=50 --cov-report xml:tests_api.xml --verbose \
array_api_tests/test_type_promotion.py::test_elementwise_function_two_arg_bool_type_promotion
python3 -m pytest --reruns 3 --durations=50 --cov-report xml:tests_api.xml --verbose \
array_api_tests/test_type_promotion.py::test_elementwise_function_two_arg_promoted_type_promotion
python3 -m pytest --reruns 3 --durations=50 --cov-report xml:tests_api.xml --verbose \
array_api_tests/test_type_promotion.py::test_elementwise_function_one_arg_bool
python3 -m pytest --reruns 3 --durations=50 --cov-report xml:tests_api.xml --verbose \
array_api_tests/test_type_promotion.py::test_elementwise_function_one_arg_type_promotion
python3 -m pytest --reruns 3 --durations=50 --cov-report xml:tests_api.xml --verbose \
array_api_tests/test_type_promotion.py::test_operator_one_arg_type_promotion
python3 -m pytest --reruns 3 --durations=50 --cov-report xml:tests_api.xml --verbose \
array_api_tests/test_type_promotion.py::test_operator_two_arg_bool_promotion
python3 -m pytest --reruns 3 --durations=50 --cov-report xml:tests_api.xml --verbose \
array_api_tests/test_type_promotion.py::test_operator_two_arg_promoted_promotion
python3 -m pytest --reruns 3 --durations=50 --cov-report xml:tests_api.xml --verbose \
array_api_tests/test_type_promotion.py::test_operator_inplace_two_arg_promoted_promotion
popd
}
unittest_ubuntu_python3_gpu() {
set -ex
export PYTHONPATH=./python/
export MXNET_ONEDNN_DEBUG=0 # Ignored if not present
export MXNET_STORAGE_FALLBACK_LOG_VERBOSE=0
export MXNET_SUBGRAPH_VERBOSE=0
export CUDNN_VERSION=${CUDNN_VERSION:-7.0.3}
[MXNET-545] Fix broken cython build (#10951) * Fix broken build with cython 0.28 * Fix setup.py to be compatible with cython 0.28 * Fix broken cython ndarray module * Revised comments * Replace hard coded library path with one obtained by find_lib_path * Add documentation for MXNET_ENABLE_CYTHON and MXNET_ENFORCE_CYTHON * Add cython build to CI * Fix for cython CI * Adjust python environment for cython CI * Add make variables to set python executable * Fix typo * Fix nnvm include path * Does not use ccache for cython * Fix issues with the wildcards in the library list in Jenkinsfile * Fix issues with the wildcards in the library list in Jenkinsfile (continued) * Fix issues with the wildcards in the library list in Jenkinsfile (continued) * Intentionally introduce a bug to check that the tests actually runwith cython * Remove the intentionally introduced bug * Update installation doc * Retrigger CI * Run cython CI in ubuntu environment instead of CentOS environment * Commit a missed file * Fix a bug in check_cython * Refine environments for cython CI * Restore unrelated changes * Fix a problem occurring when the cython modules for python 2 and 3 are built successively * Trigger CI * Pin the cython version in the CI * Catch up #11320 * Remove optional arguments unused after #11320 * Trigger CI * Trigger CI * Trigger CI * Remove unnecessary stype argument from the NDArrayBase constructor * Revise confusing initialization of `_ndarray_cls` * Add cython build for python3 in CI * Fix misplaced cython build in CI * Adjust CI environments for cython * Fix invalid path for cython generated .so files in cmake build * Revert invalid fix * Revise docs * Revise check_cython * Temporaily use make instead of cmake for debugging * Temporal changes for debugging * Temporal changes for debugging * Temporaily use ctypes instead of cython modules for debugging * Temporaily disable ccache for debugging * Temporaily use make (DEV = 0) instead of cmake for debugging * Temporaily disable cudnn for debugging * Restore temporal changes * Temporarily disable coverage report * Adapt to Jenkinsfile_utils * Adapt to Jenkinsfile_utils (cont.) * Restore unrelated changes * Restore temporal changes * Resolving conflict * Test with the cmake build is removed * Add MXNET_ENABLE_CYTHON=0 to tensorrt test * Fix typo * Trigger CI * Trigger CI * Adapt to Jenkinsfile refactoring * Adapt to Jenkinsfile refactoring (cont.) * Trigger CI * Trigger CI * Stash missing cython modules * Trigger CI * CMake build of cython modules without unit tests * Fix typo * Trigger CI * Fix a mistake introduced in merging process * trigger test * Update Jenkinsfile_utils.groovy * Trigger CI * Trigger CI * Trigger CI * Trigger tests * Trigger tests * Trigger tests * Trigger tests * Trigger tests * Trigger tests * Trigger tests * Trigger tests
2019-05-25 07:36:30 +09:00
export MXNET_ENABLE_CYTHON=0
export DMLC_LOG_STACK_TRACE_DEPTH=100
MXNET_GPU_MEM_POOL_TYPE=Unpooled \
OMP_NUM_THREADS=$(expr $(nproc) / 4) pytest -m 'not serial' -k 'not test_operator and not test_amp_init.py' -n 4 --durations=50 --cov-report xml:tests_gpu.xml --verbose tests/python/gpu
MXNET_GPU_MEM_POOL_TYPE=Unpooled \
MXNET_ENGINE_TYPE=NaiveEngine \
OMP_NUM_THREADS=$(expr $(nproc) / 4) pytest -m 'not serial' -k 'test_operator' -n 4 --durations=50 --cov-report xml:tests_gpu.xml --cov-append --verbose tests/python/gpu
pytest -m 'serial' --durations=50 --cov-report xml:tests_gpu.xml --cov-append --verbose tests/python/gpu
pytest --durations=50 --cov-report xml:tests_gpu.xml --cov-append --verbose tests/python/gpu/test_amp_init.py
[MXNET-545] Fix broken cython build (#10951) * Fix broken build with cython 0.28 * Fix setup.py to be compatible with cython 0.28 * Fix broken cython ndarray module * Revised comments * Replace hard coded library path with one obtained by find_lib_path * Add documentation for MXNET_ENABLE_CYTHON and MXNET_ENFORCE_CYTHON * Add cython build to CI * Fix for cython CI * Adjust python environment for cython CI * Add make variables to set python executable * Fix typo * Fix nnvm include path * Does not use ccache for cython * Fix issues with the wildcards in the library list in Jenkinsfile * Fix issues with the wildcards in the library list in Jenkinsfile (continued) * Fix issues with the wildcards in the library list in Jenkinsfile (continued) * Intentionally introduce a bug to check that the tests actually runwith cython * Remove the intentionally introduced bug * Update installation doc * Retrigger CI * Run cython CI in ubuntu environment instead of CentOS environment * Commit a missed file * Fix a bug in check_cython * Refine environments for cython CI * Restore unrelated changes * Fix a problem occurring when the cython modules for python 2 and 3 are built successively * Trigger CI * Pin the cython version in the CI * Catch up #11320 * Remove optional arguments unused after #11320 * Trigger CI * Trigger CI * Trigger CI * Remove unnecessary stype argument from the NDArrayBase constructor * Revise confusing initialization of `_ndarray_cls` * Add cython build for python3 in CI * Fix misplaced cython build in CI * Adjust CI environments for cython * Fix invalid path for cython generated .so files in cmake build * Revert invalid fix * Revise docs * Revise check_cython * Temporaily use make instead of cmake for debugging * Temporal changes for debugging * Temporal changes for debugging * Temporaily use ctypes instead of cython modules for debugging * Temporaily disable ccache for debugging * Temporaily use make (DEV = 0) instead of cmake for debugging * Temporaily disable cudnn for debugging * Restore temporal changes * Temporarily disable coverage report * Adapt to Jenkinsfile_utils * Adapt to Jenkinsfile_utils (cont.) * Restore unrelated changes * Restore temporal changes * Resolving conflict * Test with the cmake build is removed * Add MXNET_ENABLE_CYTHON=0 to tensorrt test * Fix typo * Trigger CI * Trigger CI * Adapt to Jenkinsfile refactoring * Adapt to Jenkinsfile refactoring (cont.) * Trigger CI * Trigger CI * Stash missing cython modules * Trigger CI * CMake build of cython modules without unit tests * Fix typo * Trigger CI * Fix a mistake introduced in merging process * trigger test * Update Jenkinsfile_utils.groovy * Trigger CI * Trigger CI * Trigger CI * Trigger tests * Trigger tests * Trigger tests * Trigger tests * Trigger tests * Trigger tests * Trigger tests * Trigger tests
2019-05-25 07:36:30 +09:00
}
unittest_ubuntu_python3_gpu_cython() {
set -ex
export PYTHONPATH=./python/
export MXNET_ONEDNN_DEBUG=1 # Ignored if not present
[MXNET-545] Fix broken cython build (#10951) * Fix broken build with cython 0.28 * Fix setup.py to be compatible with cython 0.28 * Fix broken cython ndarray module * Revised comments * Replace hard coded library path with one obtained by find_lib_path * Add documentation for MXNET_ENABLE_CYTHON and MXNET_ENFORCE_CYTHON * Add cython build to CI * Fix for cython CI * Adjust python environment for cython CI * Add make variables to set python executable * Fix typo * Fix nnvm include path * Does not use ccache for cython * Fix issues with the wildcards in the library list in Jenkinsfile * Fix issues with the wildcards in the library list in Jenkinsfile (continued) * Fix issues with the wildcards in the library list in Jenkinsfile (continued) * Intentionally introduce a bug to check that the tests actually runwith cython * Remove the intentionally introduced bug * Update installation doc * Retrigger CI * Run cython CI in ubuntu environment instead of CentOS environment * Commit a missed file * Fix a bug in check_cython * Refine environments for cython CI * Restore unrelated changes * Fix a problem occurring when the cython modules for python 2 and 3 are built successively * Trigger CI * Pin the cython version in the CI * Catch up #11320 * Remove optional arguments unused after #11320 * Trigger CI * Trigger CI * Trigger CI * Remove unnecessary stype argument from the NDArrayBase constructor * Revise confusing initialization of `_ndarray_cls` * Add cython build for python3 in CI * Fix misplaced cython build in CI * Adjust CI environments for cython * Fix invalid path for cython generated .so files in cmake build * Revert invalid fix * Revise docs * Revise check_cython * Temporaily use make instead of cmake for debugging * Temporal changes for debugging * Temporal changes for debugging * Temporaily use ctypes instead of cython modules for debugging * Temporaily disable ccache for debugging * Temporaily use make (DEV = 0) instead of cmake for debugging * Temporaily disable cudnn for debugging * Restore temporal changes * Temporarily disable coverage report * Adapt to Jenkinsfile_utils * Adapt to Jenkinsfile_utils (cont.) * Restore unrelated changes * Restore temporal changes * Resolving conflict * Test with the cmake build is removed * Add MXNET_ENABLE_CYTHON=0 to tensorrt test * Fix typo * Trigger CI * Trigger CI * Adapt to Jenkinsfile refactoring * Adapt to Jenkinsfile refactoring (cont.) * Trigger CI * Trigger CI * Stash missing cython modules * Trigger CI * CMake build of cython modules without unit tests * Fix typo * Trigger CI * Fix a mistake introduced in merging process * trigger test * Update Jenkinsfile_utils.groovy * Trigger CI * Trigger CI * Trigger CI * Trigger tests * Trigger tests * Trigger tests * Trigger tests * Trigger tests * Trigger tests * Trigger tests * Trigger tests
2019-05-25 07:36:30 +09:00
export MXNET_STORAGE_FALLBACK_LOG_VERBOSE=0
export MXNET_SUBGRAPH_VERBOSE=0
[MXNET-545] Fix broken cython build (#10951) * Fix broken build with cython 0.28 * Fix setup.py to be compatible with cython 0.28 * Fix broken cython ndarray module * Revised comments * Replace hard coded library path with one obtained by find_lib_path * Add documentation for MXNET_ENABLE_CYTHON and MXNET_ENFORCE_CYTHON * Add cython build to CI * Fix for cython CI * Adjust python environment for cython CI * Add make variables to set python executable * Fix typo * Fix nnvm include path * Does not use ccache for cython * Fix issues with the wildcards in the library list in Jenkinsfile * Fix issues with the wildcards in the library list in Jenkinsfile (continued) * Fix issues with the wildcards in the library list in Jenkinsfile (continued) * Intentionally introduce a bug to check that the tests actually runwith cython * Remove the intentionally introduced bug * Update installation doc * Retrigger CI * Run cython CI in ubuntu environment instead of CentOS environment * Commit a missed file * Fix a bug in check_cython * Refine environments for cython CI * Restore unrelated changes * Fix a problem occurring when the cython modules for python 2 and 3 are built successively * Trigger CI * Pin the cython version in the CI * Catch up #11320 * Remove optional arguments unused after #11320 * Trigger CI * Trigger CI * Trigger CI * Remove unnecessary stype argument from the NDArrayBase constructor * Revise confusing initialization of `_ndarray_cls` * Add cython build for python3 in CI * Fix misplaced cython build in CI * Adjust CI environments for cython * Fix invalid path for cython generated .so files in cmake build * Revert invalid fix * Revise docs * Revise check_cython * Temporaily use make instead of cmake for debugging * Temporal changes for debugging * Temporal changes for debugging * Temporaily use ctypes instead of cython modules for debugging * Temporaily disable ccache for debugging * Temporaily use make (DEV = 0) instead of cmake for debugging * Temporaily disable cudnn for debugging * Restore temporal changes * Temporarily disable coverage report * Adapt to Jenkinsfile_utils * Adapt to Jenkinsfile_utils (cont.) * Restore unrelated changes * Restore temporal changes * Resolving conflict * Test with the cmake build is removed * Add MXNET_ENABLE_CYTHON=0 to tensorrt test * Fix typo * Trigger CI * Trigger CI * Adapt to Jenkinsfile refactoring * Adapt to Jenkinsfile refactoring (cont.) * Trigger CI * Trigger CI * Stash missing cython modules * Trigger CI * CMake build of cython modules without unit tests * Fix typo * Trigger CI * Fix a mistake introduced in merging process * trigger test * Update Jenkinsfile_utils.groovy * Trigger CI * Trigger CI * Trigger CI * Trigger tests * Trigger tests * Trigger tests * Trigger tests * Trigger tests * Trigger tests * Trigger tests * Trigger tests
2019-05-25 07:36:30 +09:00
export CUDNN_VERSION=${CUDNN_VERSION:-7.0.3}
export MXNET_ENABLE_CYTHON=1
export MXNET_ENFORCE_CYTHON=1
export DMLC_LOG_STACK_TRACE_DEPTH=100
check_cython
MXNET_GPU_MEM_POOL_TYPE=Unpooled \
OMP_NUM_THREADS=$(expr $(nproc) / 4) pytest -m 'not serial' -k 'not test_operator and not test_amp_init.py' -n 4 --durations=50 --cov-report xml:tests_gpu.xml --verbose tests/python/gpu
MXNET_GPU_MEM_POOL_TYPE=Unpooled \
MXNET_ENGINE_TYPE=NaiveEngine \
OMP_NUM_THREADS=$(expr $(nproc) / 4) pytest -m 'not serial' -k 'test_operator' -n 4 --durations=50 --cov-report xml:tests_gpu.xml --cov-append --verbose tests/python/gpu
pytest -m 'serial' --durations=50 --cov-report xml:tests_gpu.xml --cov-append --verbose tests/python/gpu
pytest --durations=50 --cov-report xml:tests_gpu.xml --cov-append --verbose tests/python/gpu/test_amp_init.py
}
unittest_ubuntu_python3_gpu_nocudnn() {
set -ex
export PYTHONPATH=./python/
export MXNET_STORAGE_FALLBACK_LOG_VERBOSE=0
export MXNET_SUBGRAPH_VERBOSE=0
export CUDNN_OFF_TEST_ONLY=true
[MXNET-545] Fix broken cython build (#10951) * Fix broken build with cython 0.28 * Fix setup.py to be compatible with cython 0.28 * Fix broken cython ndarray module * Revised comments * Replace hard coded library path with one obtained by find_lib_path * Add documentation for MXNET_ENABLE_CYTHON and MXNET_ENFORCE_CYTHON * Add cython build to CI * Fix for cython CI * Adjust python environment for cython CI * Add make variables to set python executable * Fix typo * Fix nnvm include path * Does not use ccache for cython * Fix issues with the wildcards in the library list in Jenkinsfile * Fix issues with the wildcards in the library list in Jenkinsfile (continued) * Fix issues with the wildcards in the library list in Jenkinsfile (continued) * Intentionally introduce a bug to check that the tests actually runwith cython * Remove the intentionally introduced bug * Update installation doc * Retrigger CI * Run cython CI in ubuntu environment instead of CentOS environment * Commit a missed file * Fix a bug in check_cython * Refine environments for cython CI * Restore unrelated changes * Fix a problem occurring when the cython modules for python 2 and 3 are built successively * Trigger CI * Pin the cython version in the CI * Catch up #11320 * Remove optional arguments unused after #11320 * Trigger CI * Trigger CI * Trigger CI * Remove unnecessary stype argument from the NDArrayBase constructor * Revise confusing initialization of `_ndarray_cls` * Add cython build for python3 in CI * Fix misplaced cython build in CI * Adjust CI environments for cython * Fix invalid path for cython generated .so files in cmake build * Revert invalid fix * Revise docs * Revise check_cython * Temporaily use make instead of cmake for debugging * Temporal changes for debugging * Temporal changes for debugging * Temporaily use ctypes instead of cython modules for debugging * Temporaily disable ccache for debugging * Temporaily use make (DEV = 0) instead of cmake for debugging * Temporaily disable cudnn for debugging * Restore temporal changes * Temporarily disable coverage report * Adapt to Jenkinsfile_utils * Adapt to Jenkinsfile_utils (cont.) * Restore unrelated changes * Restore temporal changes * Resolving conflict * Test with the cmake build is removed * Add MXNET_ENABLE_CYTHON=0 to tensorrt test * Fix typo * Trigger CI * Trigger CI * Adapt to Jenkinsfile refactoring * Adapt to Jenkinsfile refactoring (cont.) * Trigger CI * Trigger CI * Stash missing cython modules * Trigger CI * CMake build of cython modules without unit tests * Fix typo * Trigger CI * Fix a mistake introduced in merging process * trigger test * Update Jenkinsfile_utils.groovy * Trigger CI * Trigger CI * Trigger CI * Trigger tests * Trigger tests * Trigger tests * Trigger tests * Trigger tests * Trigger tests * Trigger tests * Trigger tests
2019-05-25 07:36:30 +09:00
export MXNET_ENABLE_CYTHON=0
export DMLC_LOG_STACK_TRACE_DEPTH=100
MXNET_GPU_MEM_POOL_TYPE=Unpooled \
OMP_NUM_THREADS=$(expr $(nproc) / 4) pytest -m 'not serial' -k 'not test_operator and not test_amp_init.py' -n 4 --durations=50 --cov-report xml:tests_gpu.xml --verbose tests/python/gpu
MXNET_GPU_MEM_POOL_TYPE=Unpooled \
MXNET_ENGINE_TYPE=NaiveEngine \
OMP_NUM_THREADS=$(expr $(nproc) / 4) pytest -m 'not serial' -k 'test_operator' -n 4 --durations=50 --cov-report xml:tests_gpu.xml --cov-append --verbose tests/python/gpu
pytest -m 'serial' --durations=50 --cov-report xml:tests_gpu.xml --cov-append --verbose tests/python/gpu
pytest --durations=50 --cov-report xml:tests_gpu.xml --cov-append --verbose tests/python/gpu/test_amp_init.py
}
unittest_cpp() {
set -ex
export DMLC_LOG_STACK_TRACE_DEPTH=100
build/tests/mxnet_unit_tests
}
unittest_centos7_cpu() {
set -ex
source /opt/rh/rh-python38/enable
cd /work/mxnet
export DMLC_LOG_STACK_TRACE_DEPTH=100
OMP_NUM_THREADS=$(expr $(nproc) / 4) python -m pytest -m 'not serial' -k 'not test_operator' -n 4 --durations=50 --cov-report xml:tests_unittest.xml --verbose tests/python/unittest
MXNET_ENGINE_TYPE=NaiveEngine \
OMP_NUM_THREADS=$(expr $(nproc) / 4) python -m pytest -m 'not serial' -k 'test_operator' -n 4 --durations=50 --cov-report xml:tests_unittest.xml --cov-append --verbose tests/python/unittest
python -m pytest -m 'serial' --durations=50 --cov-report xml:tests_unittest.xml --cov-append --verbose tests/python/unittest
OMP_NUM_THREADS=$(expr $(nproc) / 4) python -m pytest -n 4 --durations=50 --cov-report xml:tests_train.xml --verbose tests/python/train
}
unittest_centos7_gpu() {
set -ex
source /opt/rh/rh-python38/enable
cd /work/mxnet
export CUDNN_VERSION=${CUDNN_VERSION:-7.0.3}
export DMLC_LOG_STACK_TRACE_DEPTH=100
MXNET_GPU_MEM_POOL_TYPE=Unpooled \
OMP_NUM_THREADS=$(expr $(nproc) / 4) pytest -m 'not serial' -k 'not test_operator and not test_amp_init.py' -n 4 --durations=50 --cov-report xml:tests_gpu.xml --cov-append --verbose tests/python/gpu
MXNET_GPU_MEM_POOL_TYPE=Unpooled \
MXNET_ENGINE_TYPE=NaiveEngine \
OMP_NUM_THREADS=$(expr $(nproc) / 4) pytest -m 'not serial' -k 'test_operator' -n 4 --durations=50 --cov-report xml:tests_gpu.xml --cov-append --verbose tests/python/gpu
pytest -m 'serial' --durations=50 --cov-report xml:tests_gpu.xml --cov-append --verbose tests/python/gpu
pytest --durations=50 --cov-report xml:tests_gpu.xml --cov-append --verbose tests/python/gpu/test_amp_init.py
}
integrationtest_ubuntu_cpp_package_gpu() {
set -ex
export DMLC_LOG_STACK_TRACE_DEPTH=10
cpp-package/tests/ci_test.sh
}
test_python3_data_interchange_gpu() {
set -ex
python3 -m pip install torch==1.10.0+cu113 torchvision==0.11.1+cu113 torchaudio==0.10.0+cu113 \
-f https://download.pytorch.org/whl/cu113/torch_stable.html
MXNET_ENGINE_TYPE=ThreadedEngineAsync \
python3 -m pytest --durations=50 tests/python/array-api/test_data_interchange.py
}
integrationtest_ubuntu_cpu_onnx() {
[MXNET-34] Onnx Module to import onnx models into mxnet (#9963) * Onnx Module to import onnx models into mxnet * Change package name to onnx from serde. * Remove onnx install time dependency * Remove Renamer class * Add apache license to files. * Refactor test files to tests/python folder. * Removed export folder. * Refactor Attribute COnverter logic Signed-off-by: Acharya <aanirud@8c85904b0bf4.ant.amazon.com> * Changing the translation and utils file. Signed-off-by: Acharya <aanirud@8c85904b0bf4.ant.amazon.com> * - Fixed Pylint issues - Added Sigmoid operator. - Add onnx, protobuf as CI pipeline dependencies. Signed-off-by: Acharya <aanirud@8c85904b0bf4.ant.amazon.com> * Add UTs for reduce ops. Signed-off-by: Acharya <aanirud@8c85904b0bf4.ant.amazon.com> * pylint - newline, whitespace. Signed-off-by: Acharya <aanirud@8c85904b0bf4.ant.amazon.com> * Added operators: - AvgPool - ArgMax - ArgMin - Abs Minor changes in logic for import_onnx * Added operators: - Ceil - Cast - Constant * - Added Pad operator support. - Minor changes for comments * RandomUniform,Normal,Sub,Mul,Div,Tanh,Relu,Reciprocal,Sqrt operators added. Signed-off-by: Acharya <aanirud@8c85904b0bf4.ant.amazon.com> * lint fix * Add protobuf-compile to CI bash script. Add MatMul and Pow operator. Signed-off-by: Acharya <aanirud@8c85904b0bf4.ant.amazon.com> * Max,Min,Sum,Reduce operators. Signed-off-by: Acharya <aanirud@8c85904b0bf4.ant.amazon.com> * BatchNorm,SpatialBN, Split Signed-off-by: Acharya <aanirud@8c85904b0bf4.ant.amazon.com> * Slice,Transpose and Squeeze Operators. Signed-off-by: Acharya <aanirud@8c85904b0bf4.ant.amazon.com> * Onnx tests in CI integration tests. Signed-off-by: Acharya <aanirud@8c85904b0bf4.ant.amazon.com> * Addressing Marco's comments Signed-off-by: Acharya <aanirud@8c85904b0bf4.ant.amazon.com> * Floor, LeakyRelu, Elu, PRelu, Softmax, Exp, Log operator. * Added operators: - Convolution - Deconvolution Refactored convert_operator * lint fix * Rebase fix * Added Maxpool operator * Adding FullyConnected operator * Adding operator- GlobalPooling - max and avg Minor lint fixes. * Adding operator - Gemm * Change test Path, LRN and Dropout operator. * Add asserts for the super_res example. Signed-off-by: Acharya <aanirud@8c85904b0bf4.ant.amazon.com> * Fixing conv test failures. Removed redundant code * Update Jenkins job. Signed-off-by: Acharya <aanirud@8c85904b0bf4.ant.amazon.com> * Nits: Removing commented out code * Rebase after Docker PR * Fetch test files by version number. Verify the high resolution example. Signed-off-by: Acharya <aanirud@8c85904b0bf4.ant.amazon.com> * Fix method arguments for Python3.5+ Signed-off-by: Acharya <aanirud@8c85904b0bf4.ant.amazon.com> * Remove logging configuration from test files. Signed-off-by: Acharya <aanirud@8c85904b0bf4.ant.amazon.com> * Verify result image in example by hash Signed-off-by: Acharya <aanirud@8c85904b0bf4.ant.amazon.com> * Remove fetching test files by ETag. Will add it as a separate PR as per review comments. Signed-off-by: Acharya <aanirud@8c85904b0bf4.ant.amazon.com>
2018-03-14 13:42:59 -07:00
set -ex
export PYTHONPATH=./python/
2020-11-24 13:52:02 -08:00
export MXNET_SUBGRAPH_VERBOSE=0
export DMLC_LOG_STACK_TRACE_DEPTH=100
python3 tests/python/unittest/onnx/backend_test.py
#OMP_NUM_THREADS=$(expr $(nproc) / 4) pytest -n 4 tests/python/unittest/onnx/mxnet_export_test.py
#OMP_NUM_THREADS=$(expr $(nproc) / 4) pytest -n 4 tests/python/unittest/onnx/test_models.py
#OMP_NUM_THREADS=$(expr $(nproc) / 4) pytest -n 4 tests/python/unittest/onnx/test_node.py
#OMP_NUM_THREADS=$(expr $(nproc) / 4) pytest -n 4 tests/python/unittest/onnx/test_onnxruntime.py
[MXNET-34] Onnx Module to import onnx models into mxnet (#9963) * Onnx Module to import onnx models into mxnet * Change package name to onnx from serde. * Remove onnx install time dependency * Remove Renamer class * Add apache license to files. * Refactor test files to tests/python folder. * Removed export folder. * Refactor Attribute COnverter logic Signed-off-by: Acharya <aanirud@8c85904b0bf4.ant.amazon.com> * Changing the translation and utils file. Signed-off-by: Acharya <aanirud@8c85904b0bf4.ant.amazon.com> * - Fixed Pylint issues - Added Sigmoid operator. - Add onnx, protobuf as CI pipeline dependencies. Signed-off-by: Acharya <aanirud@8c85904b0bf4.ant.amazon.com> * Add UTs for reduce ops. Signed-off-by: Acharya <aanirud@8c85904b0bf4.ant.amazon.com> * pylint - newline, whitespace. Signed-off-by: Acharya <aanirud@8c85904b0bf4.ant.amazon.com> * Added operators: - AvgPool - ArgMax - ArgMin - Abs Minor changes in logic for import_onnx * Added operators: - Ceil - Cast - Constant * - Added Pad operator support. - Minor changes for comments * RandomUniform,Normal,Sub,Mul,Div,Tanh,Relu,Reciprocal,Sqrt operators added. Signed-off-by: Acharya <aanirud@8c85904b0bf4.ant.amazon.com> * lint fix * Add protobuf-compile to CI bash script. Add MatMul and Pow operator. Signed-off-by: Acharya <aanirud@8c85904b0bf4.ant.amazon.com> * Max,Min,Sum,Reduce operators. Signed-off-by: Acharya <aanirud@8c85904b0bf4.ant.amazon.com> * BatchNorm,SpatialBN, Split Signed-off-by: Acharya <aanirud@8c85904b0bf4.ant.amazon.com> * Slice,Transpose and Squeeze Operators. Signed-off-by: Acharya <aanirud@8c85904b0bf4.ant.amazon.com> * Onnx tests in CI integration tests. Signed-off-by: Acharya <aanirud@8c85904b0bf4.ant.amazon.com> * Addressing Marco's comments Signed-off-by: Acharya <aanirud@8c85904b0bf4.ant.amazon.com> * Floor, LeakyRelu, Elu, PRelu, Softmax, Exp, Log operator. * Added operators: - Convolution - Deconvolution Refactored convert_operator * lint fix * Rebase fix * Added Maxpool operator * Adding FullyConnected operator * Adding operator- GlobalPooling - max and avg Minor lint fixes. * Adding operator - Gemm * Change test Path, LRN and Dropout operator. * Add asserts for the super_res example. Signed-off-by: Acharya <aanirud@8c85904b0bf4.ant.amazon.com> * Fixing conv test failures. Removed redundant code * Update Jenkins job. Signed-off-by: Acharya <aanirud@8c85904b0bf4.ant.amazon.com> * Nits: Removing commented out code * Rebase after Docker PR * Fetch test files by version number. Verify the high resolution example. Signed-off-by: Acharya <aanirud@8c85904b0bf4.ant.amazon.com> * Fix method arguments for Python3.5+ Signed-off-by: Acharya <aanirud@8c85904b0bf4.ant.amazon.com> * Remove logging configuration from test files. Signed-off-by: Acharya <aanirud@8c85904b0bf4.ant.amazon.com> * Verify result image in example by hash Signed-off-by: Acharya <aanirud@8c85904b0bf4.ant.amazon.com> * Remove fetching test files by ETag. Will add it as a separate PR as per review comments. Signed-off-by: Acharya <aanirud@8c85904b0bf4.ant.amazon.com>
2018-03-14 13:42:59 -07:00
}
integrationtest_ubuntu_cpu_dist_kvstore() {
set -ex
pushd .
export PYTHONPATH=./python/
export MXNET_STORAGE_FALLBACK_LOG_VERBOSE=0
export MXNET_SUBGRAPH_VERBOSE=0
export MXNET_USE_OPERATOR_TUNING=0
export DMLC_LOG_STACK_TRACE_DEPTH=100
cd tests/nightly/
python3 ../../tools/launch.py -n 7 --launcher local python3 dist_sync_kvstore.py --type=gluon_step_cpu
python3 ../../tools/launch.py -n 7 --launcher local python3 dist_sync_kvstore.py --type=gluon_sparse_step_cpu
python3 ../../tools/launch.py -n 7 --launcher local python3 dist_sync_kvstore.py --type=invalid_cpu
python3 ../../tools/launch.py -n 7 --launcher local python3 dist_sync_kvstore.py --type=gluon_type_cpu
python3 ../../tools/launch.py -n 7 --launcher local python3 dist_sync_kvstore.py
python3 ../../tools/launch.py -n 7 --launcher local python3 dist_sync_kvstore.py --no-multiprecision
python3 ../../tools/launch.py -n 7 --launcher local python3 dist_sync_kvstore.py --type=compressed_cpu_1bit
python3 ../../tools/launch.py -n 7 --launcher local python3 dist_sync_kvstore.py --type=compressed_cpu_1bit --no-multiprecision
python3 ../../tools/launch.py -n 7 --launcher local python3 dist_sync_kvstore.py --type=compressed_cpu_2bit
python3 ../../tools/launch.py -n 7 --launcher local python3 dist_sync_kvstore.py --type=compressed_cpu_2bit --no-multiprecision
python3 ../../tools/launch.py -n 3 --launcher local python3 test_server_profiling.py
popd
}
integrationtest_ubuntu_gpu_dist_kvstore() {
set -ex
export DMLC_LOG_STACK_TRACE_DEPTH=100
pushd .
cd /work/mxnet/python
pip3 install -e .
pip3 install --no-cache-dir horovod
cd /work/mxnet/tests/nightly
./test_distributed_training-gpu.sh
popd
}
BytePS trainer + tests (#18032) * [MXNET-#16795] Byteps-KVStore: Intergrate Byteps into mxnet as new type of kvstore backend (#17555) * Add Byteps backend for kvstore * Add a temp launcher for byteps backend * make the test fit for byteps kvstore. * final workable test * Remove trashy print and logs * correct comment * add hostfile for ci test * add ci test for byteps kvstore * add visibile devices for byteps-kvstore ci test * add licenses for tools/byteps_launcher.py * syntax error * pylint error (remove unused import like logging) * pylint error * pylint error * enable launching without hostfile (local byteps) * 1. rename byteps_kvstore.py to byteps.py; 2. shorten the launch option to ; 3. add instruction for -H and -SH options for launch; 4. add documentation for byteps kvstore in kvstore/base.py: create(name='local') * edit documentation of KVStoreBase::is_capable(capability); reture fasle for BytePS(KVStoreBase):is_capable(any). * pylint error * remove an error of arg.byteps * use --env option to set workers' environment * error in byteps-launcher.py * remove the unpurposed editing mistake in runtime_functions.sh * disable cpu support for byteps kvstore. * 1. format the document to avoid julia doc build error; 2. little change to nightly test; 3. add byteps copy right declararation in byteps_launcher.py 4. if args.byteps == True ===> if args.byteps * remove the --scheduler_ip and --scheduler_port options in launch.py * 1. maintain the origin value of broadcast and pushpull 2. optimize when out = value or [out]=value 3. add some missing documentation to avoid doc building error. * Add bytePS to CI * add dependency * +integrationtest_ubuntu_gpu_byteps * add byteps pipeline * disable a few tests * remove more tests * fix permission * remove apt-get * fix python path * improve logging * fix printns * add back CI Co-authored-by: Ubuntu <ubuntu@ip-172-31-39-16.ec2.internal> Co-authored-by: Piyush Ghai <ghai.8@osu.edu> Co-authored-by: eric-haibin-lin <linhaibin.eric@gmail.com> Co-authored-by: eric-haibin-lin <--global> Co-authored-by: Lin <haibilin@a483e7be4c92.ant.amazon.com> * fix byteps logging and declare tensor * check exceptions and return -1 * print logging in CI * Update byteps.py * Update runtime_functions.sh * add numa dependency * pin dependency * Update runtime_functions.sh * Update Dockerfile.build.ubuntu * Update runtime_functions.sh * Update runtime_functions.sh * Update runtime_functions.sh * Update runtime_functions.sh * Update Jenkins_steps.groovy * remove launcher. use bpslauncher instead. Co-authored-by: Chaokun Chang <33217209+ChaokunChang@users.noreply.github.com> Co-authored-by: Ubuntu <ubuntu@ip-172-31-39-16.ec2.internal> Co-authored-by: Piyush Ghai <ghai.8@osu.edu> Co-authored-by: Lin <haibilin@a483e7be4c92.ant.amazon.com> Co-authored-by: Ubuntu <ubuntu@ip-172-31-37-108.ec2.internal> Co-authored-by: EC2 Default User <ec2-user@ip-172-31-81-80.ec2.internal> Co-authored-by: Ubuntu <ubuntu@ip-172-31-57-164.ec2.internal>
2020-06-04 14:20:52 -07:00
integrationtest_ubuntu_gpu_byteps() {
set -ex
pushd .
export PYTHONPATH=$PWD/python/
export BYTEPS_WITHOUT_PYTORCH=1
export BYTEPS_WITHOUT_TENSORFLOW=1
pip3 install byteps==0.2.3 --user
git clone -b v0.2.3 https://github.com/bytedance/byteps ~/byteps
export MXNET_STORAGE_FALLBACK_LOG_VERBOSE=0
export MXNET_SUBGRAPH_VERBOSE=0
export DMLC_LOG_STACK_TRACE_DEPTH=100
BytePS trainer + tests (#18032) * [MXNET-#16795] Byteps-KVStore: Intergrate Byteps into mxnet as new type of kvstore backend (#17555) * Add Byteps backend for kvstore * Add a temp launcher for byteps backend * make the test fit for byteps kvstore. * final workable test * Remove trashy print and logs * correct comment * add hostfile for ci test * add ci test for byteps kvstore * add visibile devices for byteps-kvstore ci test * add licenses for tools/byteps_launcher.py * syntax error * pylint error (remove unused import like logging) * pylint error * pylint error * enable launching without hostfile (local byteps) * 1. rename byteps_kvstore.py to byteps.py; 2. shorten the launch option to ; 3. add instruction for -H and -SH options for launch; 4. add documentation for byteps kvstore in kvstore/base.py: create(name='local') * edit documentation of KVStoreBase::is_capable(capability); reture fasle for BytePS(KVStoreBase):is_capable(any). * pylint error * remove an error of arg.byteps * use --env option to set workers' environment * error in byteps-launcher.py * remove the unpurposed editing mistake in runtime_functions.sh * disable cpu support for byteps kvstore. * 1. format the document to avoid julia doc build error; 2. little change to nightly test; 3. add byteps copy right declararation in byteps_launcher.py 4. if args.byteps == True ===> if args.byteps * remove the --scheduler_ip and --scheduler_port options in launch.py * 1. maintain the origin value of broadcast and pushpull 2. optimize when out = value or [out]=value 3. add some missing documentation to avoid doc building error. * Add bytePS to CI * add dependency * +integrationtest_ubuntu_gpu_byteps * add byteps pipeline * disable a few tests * remove more tests * fix permission * remove apt-get * fix python path * improve logging * fix printns * add back CI Co-authored-by: Ubuntu <ubuntu@ip-172-31-39-16.ec2.internal> Co-authored-by: Piyush Ghai <ghai.8@osu.edu> Co-authored-by: eric-haibin-lin <linhaibin.eric@gmail.com> Co-authored-by: eric-haibin-lin <--global> Co-authored-by: Lin <haibilin@a483e7be4c92.ant.amazon.com> * fix byteps logging and declare tensor * check exceptions and return -1 * print logging in CI * Update byteps.py * Update runtime_functions.sh * add numa dependency * pin dependency * Update runtime_functions.sh * Update Dockerfile.build.ubuntu * Update runtime_functions.sh * Update runtime_functions.sh * Update runtime_functions.sh * Update runtime_functions.sh * Update Jenkins_steps.groovy * remove launcher. use bpslauncher instead. Co-authored-by: Chaokun Chang <33217209+ChaokunChang@users.noreply.github.com> Co-authored-by: Ubuntu <ubuntu@ip-172-31-39-16.ec2.internal> Co-authored-by: Piyush Ghai <ghai.8@osu.edu> Co-authored-by: Lin <haibilin@a483e7be4c92.ant.amazon.com> Co-authored-by: Ubuntu <ubuntu@ip-172-31-37-108.ec2.internal> Co-authored-by: EC2 Default User <ec2-user@ip-172-31-81-80.ec2.internal> Co-authored-by: Ubuntu <ubuntu@ip-172-31-57-164.ec2.internal>
2020-06-04 14:20:52 -07:00
cd tests/nightly/
export NVIDIA_VISIBLE_DEVICES=0
export DMLC_WORKER_ID=0 # your worker id
export DMLC_NUM_WORKER=1 # one worker
export DMLC_ROLE=worker
# the following value does not matter for non-distributed jobs
export DMLC_NUM_SERVER=1
export DMLC_PS_ROOT_URI=0.0.0.127
export DMLC_PS_ROOT_PORT=1234
python3 ~/byteps/launcher/launch.py python3 dist_device_sync_kvstore_byteps.py
popd
}
test_ubuntu_cpu_python3() {
set -ex
pushd .
export MXNET_LIBRARY_PATH=/work/build/libmxnet.so
export DMLC_LOG_STACK_TRACE_DEPTH=100
VENV=mxnet_py3_venv
virtualenv -p `which python3` $VENV
source $VENV/bin/activate
cd /work/mxnet/python
pip3 install -e .
cd /work/mxnet
OMP_NUM_THREADS=$(expr $(nproc) / 4) python3 -m pytest -m 'not serial' -k 'not test_operator' -n 4 --durations=50 --verbose tests/python/unittest
MXNET_ENGINE_TYPE=NaiveEngine \
OMP_NUM_THREADS=$(expr $(nproc) / 4) python3 -m pytest -m 'not serial' -k 'test_operator' -n 4 --durations=50 --verbose tests/python/unittest
python3 -m pytest -m 'serial' --durations=50 --verbose tests/python/unittest
popd
}
Switch to C++17 and modernize toolchain + CI (#17984) As per #17968, require C++17 compatible compiler. For cuda code, use C++14 mode introduced in Cuda 9. C++17 support for Cuda will be available in Cuda 11. Switching to C++17 requires modernizing the toolchain, which exposed a number of technical debt issues in the codebase. All blocking issues are fixed as part of this PR. See the full list below. This PR contains the following specific changes: Switch CI pipeline to use gcc7 on Ubuntu and CentOS Switch CD pipeline to CentOS 7 with https://www.softwarecollections.org/en/scls/rhscl/devtoolset-7/ This enables us to build with gcc7 C++17 compiler while keeping a relatively old glibc requirement for distribution. Simplify ARM Edge builds Switch to standard Ubuntu / Debian cross-compilation toolchain for ARMv7, ARMv8 Switch to https://toolchains.bootlin.com/ toolchain for ARMv6 (the Debian ARMv6 toolchain is for ARMv4 + ARMv5 + ARMv6, but we wish to only target ARMv6 and make use of ARMv6 features) Remove reliance on dockcross for cross compilation. Simplify Jetson build Use standard Ubuntu / Debian cross-compilation toolchain for ARMv8 Upgrade to Cuda 10 and Jetpack 4.3 Simplify build setup Simplify QEMU ARM virtualization test setup on CI Remove complex "Virtual Machine in Docker" logic and run a QEMU based Docker container instead based on arm32v7/ubuntu Fix out of bounds vector accesses in SoftmaxGradOpType MKLDNNFCBackward Fix use of non-standard rand_r function (which is not available on anymore on newer Android toolchains and shouldn't be use in any case). Fix reproducibility of RNN with Dropout Fix reproducibility of DGL Graph Sampling Operators Update tests for Android Edge build to NDK19. The previously used standalone toolchain is obsolete. Those Dockerfiles that required refactoring as part of the effort were refactored based on the following consideration Maximize the use of system dependencies provided by the distribution instead of manually installing dependencies from source or from third party vendors. This reduces the complexity of the installation process and essentially pins the dependency versions, increasing CI stability. Further, Dockerfile build speed is improved. To facilitate this, use recent distribution versions. We still ensure backwards compatibility via CentOS7 based build and test stages Minimize the number of layers in the Dockerfile. Don't have 5 different script files executed, each calling apt-get update and install, but just execute once. Speeds up the build and reduces image size. Keep each Dockerfile simple and tailored to a purpose, instead of running 20 scripts to install dependencies for every thinkable scenario, which is unmaintainable. Some more small changes: Remove outdated references to Cuda 7 and Cuda 8 in various files. Remove C++03 support in mshadow Disable broken tests NumpyBooleanAssignForwardCPU #17990 test_init.test_rsp_const_init #17988 quantized_elemwise_mul #18034 List of squashed commits * cpp standard * Remove leftover files of Cuda 7 and Cuda 8 support * thrust 1.9.8 for clang10 * compiler warnings * Disable broken test_init.test_rsp_const_init * Disable tests invoking NumpyBooleanAssignForwardCPU * Fix out of bounds access in SoftmaxGradOpType * Use CentOS 7 for staticbuilds CentOS 7 fullfills the requirements for PEP 599 manylinux-2014 and provides a C++17 toolchain. * Fix MKLDNNFCBackward * Update edge toolchain * Support platforms without rand_r * Cleanup random.h * Greatly simplify qemu setup * Remove unused functions in Jenkins_steps.groovy * Skip quantized_elemwise_mul due QuantizedElemwiseMulOpShape bug * Fix R package installation https://github.com/apache/incubator-mxnet/issues/18042 * Fix centos ccache * Fix GPU Makefile staticbuild on CentOS7 * CentOS7 NCCL * CentOS7 staticbuild fix link with libculibos
2020-04-14 10:29:29 -07:00
# QEMU based ARM tests
unittest_ubuntu_python3_arm() {
set -ex
export PYTHONPATH=./python/
export MXNET_ONEDNN_DEBUG=0 # Ignored if not present
Switch to C++17 and modernize toolchain + CI (#17984) As per #17968, require C++17 compatible compiler. For cuda code, use C++14 mode introduced in Cuda 9. C++17 support for Cuda will be available in Cuda 11. Switching to C++17 requires modernizing the toolchain, which exposed a number of technical debt issues in the codebase. All blocking issues are fixed as part of this PR. See the full list below. This PR contains the following specific changes: Switch CI pipeline to use gcc7 on Ubuntu and CentOS Switch CD pipeline to CentOS 7 with https://www.softwarecollections.org/en/scls/rhscl/devtoolset-7/ This enables us to build with gcc7 C++17 compiler while keeping a relatively old glibc requirement for distribution. Simplify ARM Edge builds Switch to standard Ubuntu / Debian cross-compilation toolchain for ARMv7, ARMv8 Switch to https://toolchains.bootlin.com/ toolchain for ARMv6 (the Debian ARMv6 toolchain is for ARMv4 + ARMv5 + ARMv6, but we wish to only target ARMv6 and make use of ARMv6 features) Remove reliance on dockcross for cross compilation. Simplify Jetson build Use standard Ubuntu / Debian cross-compilation toolchain for ARMv8 Upgrade to Cuda 10 and Jetpack 4.3 Simplify build setup Simplify QEMU ARM virtualization test setup on CI Remove complex "Virtual Machine in Docker" logic and run a QEMU based Docker container instead based on arm32v7/ubuntu Fix out of bounds vector accesses in SoftmaxGradOpType MKLDNNFCBackward Fix use of non-standard rand_r function (which is not available on anymore on newer Android toolchains and shouldn't be use in any case). Fix reproducibility of RNN with Dropout Fix reproducibility of DGL Graph Sampling Operators Update tests for Android Edge build to NDK19. The previously used standalone toolchain is obsolete. Those Dockerfiles that required refactoring as part of the effort were refactored based on the following consideration Maximize the use of system dependencies provided by the distribution instead of manually installing dependencies from source or from third party vendors. This reduces the complexity of the installation process and essentially pins the dependency versions, increasing CI stability. Further, Dockerfile build speed is improved. To facilitate this, use recent distribution versions. We still ensure backwards compatibility via CentOS7 based build and test stages Minimize the number of layers in the Dockerfile. Don't have 5 different script files executed, each calling apt-get update and install, but just execute once. Speeds up the build and reduces image size. Keep each Dockerfile simple and tailored to a purpose, instead of running 20 scripts to install dependencies for every thinkable scenario, which is unmaintainable. Some more small changes: Remove outdated references to Cuda 7 and Cuda 8 in various files. Remove C++03 support in mshadow Disable broken tests NumpyBooleanAssignForwardCPU #17990 test_init.test_rsp_const_init #17988 quantized_elemwise_mul #18034 List of squashed commits * cpp standard * Remove leftover files of Cuda 7 and Cuda 8 support * thrust 1.9.8 for clang10 * compiler warnings * Disable broken test_init.test_rsp_const_init * Disable tests invoking NumpyBooleanAssignForwardCPU * Fix out of bounds access in SoftmaxGradOpType * Use CentOS 7 for staticbuilds CentOS 7 fullfills the requirements for PEP 599 manylinux-2014 and provides a C++17 toolchain. * Fix MKLDNNFCBackward * Update edge toolchain * Support platforms without rand_r * Cleanup random.h * Greatly simplify qemu setup * Remove unused functions in Jenkins_steps.groovy * Skip quantized_elemwise_mul due QuantizedElemwiseMulOpShape bug * Fix R package installation https://github.com/apache/incubator-mxnet/issues/18042 * Fix centos ccache * Fix GPU Makefile staticbuild on CentOS7 * CentOS7 NCCL * CentOS7 staticbuild fix link with libculibos
2020-04-14 10:29:29 -07:00
export MXNET_STORAGE_FALLBACK_LOG_VERBOSE=0
export MXNET_SUBGRAPH_VERBOSE=0
export MXNET_ENABLE_CYTHON=0
export DMLC_LOG_STACK_TRACE_DEPTH=100
python3 -m pytest -n 2 --verbose tests/python/unittest/test_engine.py
Switch to C++17 and modernize toolchain + CI (#17984) As per #17968, require C++17 compatible compiler. For cuda code, use C++14 mode introduced in Cuda 9. C++17 support for Cuda will be available in Cuda 11. Switching to C++17 requires modernizing the toolchain, which exposed a number of technical debt issues in the codebase. All blocking issues are fixed as part of this PR. See the full list below. This PR contains the following specific changes: Switch CI pipeline to use gcc7 on Ubuntu and CentOS Switch CD pipeline to CentOS 7 with https://www.softwarecollections.org/en/scls/rhscl/devtoolset-7/ This enables us to build with gcc7 C++17 compiler while keeping a relatively old glibc requirement for distribution. Simplify ARM Edge builds Switch to standard Ubuntu / Debian cross-compilation toolchain for ARMv7, ARMv8 Switch to https://toolchains.bootlin.com/ toolchain for ARMv6 (the Debian ARMv6 toolchain is for ARMv4 + ARMv5 + ARMv6, but we wish to only target ARMv6 and make use of ARMv6 features) Remove reliance on dockcross for cross compilation. Simplify Jetson build Use standard Ubuntu / Debian cross-compilation toolchain for ARMv8 Upgrade to Cuda 10 and Jetpack 4.3 Simplify build setup Simplify QEMU ARM virtualization test setup on CI Remove complex "Virtual Machine in Docker" logic and run a QEMU based Docker container instead based on arm32v7/ubuntu Fix out of bounds vector accesses in SoftmaxGradOpType MKLDNNFCBackward Fix use of non-standard rand_r function (which is not available on anymore on newer Android toolchains and shouldn't be use in any case). Fix reproducibility of RNN with Dropout Fix reproducibility of DGL Graph Sampling Operators Update tests for Android Edge build to NDK19. The previously used standalone toolchain is obsolete. Those Dockerfiles that required refactoring as part of the effort were refactored based on the following consideration Maximize the use of system dependencies provided by the distribution instead of manually installing dependencies from source or from third party vendors. This reduces the complexity of the installation process and essentially pins the dependency versions, increasing CI stability. Further, Dockerfile build speed is improved. To facilitate this, use recent distribution versions. We still ensure backwards compatibility via CentOS7 based build and test stages Minimize the number of layers in the Dockerfile. Don't have 5 different script files executed, each calling apt-get update and install, but just execute once. Speeds up the build and reduces image size. Keep each Dockerfile simple and tailored to a purpose, instead of running 20 scripts to install dependencies for every thinkable scenario, which is unmaintainable. Some more small changes: Remove outdated references to Cuda 7 and Cuda 8 in various files. Remove C++03 support in mshadow Disable broken tests NumpyBooleanAssignForwardCPU #17990 test_init.test_rsp_const_init #17988 quantized_elemwise_mul #18034 List of squashed commits * cpp standard * Remove leftover files of Cuda 7 and Cuda 8 support * thrust 1.9.8 for clang10 * compiler warnings * Disable broken test_init.test_rsp_const_init * Disable tests invoking NumpyBooleanAssignForwardCPU * Fix out of bounds access in SoftmaxGradOpType * Use CentOS 7 for staticbuilds CentOS 7 fullfills the requirements for PEP 599 manylinux-2014 and provides a C++17 toolchain. * Fix MKLDNNFCBackward * Update edge toolchain * Support platforms without rand_r * Cleanup random.h * Greatly simplify qemu setup * Remove unused functions in Jenkins_steps.groovy * Skip quantized_elemwise_mul due QuantizedElemwiseMulOpShape bug * Fix R package installation https://github.com/apache/incubator-mxnet/issues/18042 * Fix centos ccache * Fix GPU Makefile staticbuild on CentOS7 * CentOS7 NCCL * CentOS7 staticbuild fix link with libculibos
2020-04-14 10:29:29 -07:00
}
[MXNET-405] Add 2 new pipelines to the Official CI and run nightly tests. (#10827) * Migrate Nightlies PR1 * Run all tests * Fix RAT and Comment out KVstore for now * Comment out the chmod and test * remove chmod from rat and CW * One more check * changes * run install on cpu instead of gpu * Fix failing pip * Fix Pip * typo-fix * Run Pip on cpu instance * Add a README * Remove pip-test * add pip test back * Add BLC to jenkinsfile format * add permissions * include the git add, commit, push for broken link checker * push not working, comment * Review Comments 1: remove g++-5 and parallize make * Review Comments 2: change dockerfile name, update mx_lib, remove commented line * Review Comments 3: Separate out the dockerfiles for nightly tests * Review Comments 4: Move apache rat install to nightly install script * Review Comments 4: copy the rat folder into work * correct path * Change path Again * check tests * path * Uncomment KVStore * Fix rat and js tests * Move to docker_run and comment KVstore again * Adding docker_run for binaries Jenkinsfile * Permission and other fixes * fix RAT regex, add set -e to install funcs * Delete BLC, change chmod to 755 * JS: parallel make * Add links to github issues * change the instance type to cpu * Comment out pip installs to test build from source on cpu * typo * Add sudo for pip install * Add sudo to all pip install commands coz they cause CI to fail, linux only * Run compilation warnings on cpu instance * Change file perms and some cleanup * Fix the dockerfiles * Dockerfile updates * Merge JS dockerfile into nightly and remove export command * Pin repo versions and run cpu install from souce in cpu docker * Add yes to install in js script * remove sudo from index.md * Add sudo to test script instead * add sudo to test script
2018-06-20 19:17:45 -07:00
# Functions that run the nightly Tests:
#Runs Apache RAT Check on MXNet Source for License Headers
test_rat_check() {
set -e
2020-12-23 15:18:24 -05:00
set -o pipefail
pushd .
cd /usr/local/src/apache-rat-0.13
# Use shell number 5 to duplicate the log output. It get sprinted and stored in $OUTPUT at the same time https://stackoverflow.com/a/12451419
exec 5>&1
OUTPUT=$(java -jar apache-rat-0.13.jar -E /work/mxnet/rat-excludes -d /work/mxnet|tee >(cat - >&5))
ERROR_MESSAGE="Printing headers for text files without a valid license header"
echo "-------Process The Output-------"
if [[ $OUTPUT =~ $ERROR_MESSAGE ]]; then
echo "ERROR: RAT Check detected files with unknown licenses. Please fix and run test again!";
exit 1
else
echo "SUCCESS: There are no files with an Unknown License.";
fi
popd
[MXNET-405] Add 2 new pipelines to the Official CI and run nightly tests. (#10827) * Migrate Nightlies PR1 * Run all tests * Fix RAT and Comment out KVstore for now * Comment out the chmod and test * remove chmod from rat and CW * One more check * changes * run install on cpu instead of gpu * Fix failing pip * Fix Pip * typo-fix * Run Pip on cpu instance * Add a README * Remove pip-test * add pip test back * Add BLC to jenkinsfile format * add permissions * include the git add, commit, push for broken link checker * push not working, comment * Review Comments 1: remove g++-5 and parallize make * Review Comments 2: change dockerfile name, update mx_lib, remove commented line * Review Comments 3: Separate out the dockerfiles for nightly tests * Review Comments 4: Move apache rat install to nightly install script * Review Comments 4: copy the rat folder into work * correct path * Change path Again * check tests * path * Uncomment KVStore * Fix rat and js tests * Move to docker_run and comment KVstore again * Adding docker_run for binaries Jenkinsfile * Permission and other fixes * fix RAT regex, add set -e to install funcs * Delete BLC, change chmod to 755 * JS: parallel make * Add links to github issues * change the instance type to cpu * Comment out pip installs to test build from source on cpu * typo * Add sudo for pip install * Add sudo to all pip install commands coz they cause CI to fail, linux only * Run compilation warnings on cpu instance * Change file perms and some cleanup * Fix the dockerfiles * Dockerfile updates * Merge JS dockerfile into nightly and remove export command * Pin repo versions and run cpu install from souce in cpu docker * Add yes to install in js script * remove sudo from index.md * Add sudo to test script instead * add sudo to test script
2018-06-20 19:17:45 -07:00
}
#Single Node KVStore Test
nightly_test_KVStore_singleNode() {
set -ex
export PYTHONPATH=./python/
export DMLC_LOG_STACK_TRACE_DEPTH=100
2020-02-03 09:58:01 -08:00
tests/nightly/test_kvstore.py
[MXNET-405] Add 2 new pipelines to the Official CI and run nightly tests. (#10827) * Migrate Nightlies PR1 * Run all tests * Fix RAT and Comment out KVstore for now * Comment out the chmod and test * remove chmod from rat and CW * One more check * changes * run install on cpu instead of gpu * Fix failing pip * Fix Pip * typo-fix * Run Pip on cpu instance * Add a README * Remove pip-test * add pip test back * Add BLC to jenkinsfile format * add permissions * include the git add, commit, push for broken link checker * push not working, comment * Review Comments 1: remove g++-5 and parallize make * Review Comments 2: change dockerfile name, update mx_lib, remove commented line * Review Comments 3: Separate out the dockerfiles for nightly tests * Review Comments 4: Move apache rat install to nightly install script * Review Comments 4: copy the rat folder into work * correct path * Change path Again * check tests * path * Uncomment KVStore * Fix rat and js tests * Move to docker_run and comment KVstore again * Adding docker_run for binaries Jenkinsfile * Permission and other fixes * fix RAT regex, add set -e to install funcs * Delete BLC, change chmod to 755 * JS: parallel make * Add links to github issues * change the instance type to cpu * Comment out pip installs to test build from source on cpu * typo * Add sudo for pip install * Add sudo to all pip install commands coz they cause CI to fail, linux only * Run compilation warnings on cpu instance * Change file perms and some cleanup * Fix the dockerfiles * Dockerfile updates * Merge JS dockerfile into nightly and remove export command * Pin repo versions and run cpu install from souce in cpu docker * Add yes to install in js script * remove sudo from index.md * Add sudo to test script instead * add sudo to test script
2018-06-20 19:17:45 -07:00
}
#Test Large Tensor Size
nightly_test_large_tensor() {
set -ex
export PYTHONPATH=./python/
export DMLC_LOG_STACK_TRACE_DEPTH=100
pytest -s --exitfirst --verbose --timeout=7200 tests/nightly/test_np_large_array.py
}
[MXNET-651] MXNet Model Backwards Compatibility Checker (#11626) * Added MNIST-MLP-Module-API models to check model save and load_checkpoint methods * Added LENET with Conv2D operator training file * Added LENET with Conv2d operator inference file * Added LanguageModelling with RNN training file * Added LamguageModelling with RNN inference file * Added hybridized LENET Gluon Model training file * Added hybridized LENET gluon model inference file * Added license headers * Refactored the model and inference files and extracted out duplicate code in a common file * Added runtime function for executing the MBCC files * Added JenkinsFile for MBCC to be run as a nightly job * Added boto3 install for s3 uploads * Added README for MBCC * Added license header * Added more common functions from lm_rnn_gluon_train and inference files into common.py to clean up code * Added scripts for training models on older versions of MXNet * Added check for preventing inference script from crashing in case no trained models are found * Fixed indentation issue * Replaced Penn Tree Bank Dataset with Sherlock Holmes Dataset * Fixed indentation issue * Removed training in models and added smaller models. Now we are simply checking a forward pass in the model with dummy data. * Updated README * Fixed indentation error * Fixed indentation error * Removed code duplication in the training file * Added comments for runtime_functions script for training files * Merged S3 Buckets for storing data and models into one * Automated the process to fetch MXNet versions from git tags * Added defensive checks for the case where the data might not be found * Fixed issue where we were performing inference on state model files * Replaced print statements with logging ones * Removed boto install statements and move them into ubuntu_python docker * Separated training and uploading of models into separate files so that training runs in Docker and upload runs outside Docker * Fixed pylint warnings * Updated comments and README * Removed the venv for training process * Fixed indentation in the MBCC Jenkins file and also separated out training and inference into two separate stages * Fixed indendation * Fixed erroneous single quote * Added --user flag to check for Jenkins error * Removed unused methods * Added force flag in the pip command to install mxnet * Removed the force-re-install flag * Changed exit 1 to exit 0 * Added quotes around the shell command * added packlibs and unpack libs for MXNet builds * Changed PythonPath from relative to absolute * Created dedicated bucket with correct permission * Fix for python path in training * Changed bucket name to CI bucket * Added set -ex to the upload shell script * Now raising an exception if no models are found in the S3 bucket * Added regex to train models script * Added check for performing inference only on models trained on same major versions * Added set -ex flags to shell scripts * Added multi-version regex checks in training * Fixed typo in regex * Now we will train models for all the minor versions for a given major version by traversing the tags * Added check for validating current_version
2018-07-31 02:50:13 -07:00
#Tests Model backwards compatibility on MXNet
nightly_model_backwards_compat_test() {
set -ex
export PYTHONPATH=/work/mxnet/python/
export DMLC_LOG_STACK_TRACE_DEPTH=100
[MXNET-651] MXNet Model Backwards Compatibility Checker (#11626) * Added MNIST-MLP-Module-API models to check model save and load_checkpoint methods * Added LENET with Conv2D operator training file * Added LENET with Conv2d operator inference file * Added LanguageModelling with RNN training file * Added LamguageModelling with RNN inference file * Added hybridized LENET Gluon Model training file * Added hybridized LENET gluon model inference file * Added license headers * Refactored the model and inference files and extracted out duplicate code in a common file * Added runtime function for executing the MBCC files * Added JenkinsFile for MBCC to be run as a nightly job * Added boto3 install for s3 uploads * Added README for MBCC * Added license header * Added more common functions from lm_rnn_gluon_train and inference files into common.py to clean up code * Added scripts for training models on older versions of MXNet * Added check for preventing inference script from crashing in case no trained models are found * Fixed indentation issue * Replaced Penn Tree Bank Dataset with Sherlock Holmes Dataset * Fixed indentation issue * Removed training in models and added smaller models. Now we are simply checking a forward pass in the model with dummy data. * Updated README * Fixed indentation error * Fixed indentation error * Removed code duplication in the training file * Added comments for runtime_functions script for training files * Merged S3 Buckets for storing data and models into one * Automated the process to fetch MXNet versions from git tags * Added defensive checks for the case where the data might not be found * Fixed issue where we were performing inference on state model files * Replaced print statements with logging ones * Removed boto install statements and move them into ubuntu_python docker * Separated training and uploading of models into separate files so that training runs in Docker and upload runs outside Docker * Fixed pylint warnings * Updated comments and README * Removed the venv for training process * Fixed indentation in the MBCC Jenkins file and also separated out training and inference into two separate stages * Fixed indendation * Fixed erroneous single quote * Added --user flag to check for Jenkins error * Removed unused methods * Added force flag in the pip command to install mxnet * Removed the force-re-install flag * Changed exit 1 to exit 0 * Added quotes around the shell command * added packlibs and unpack libs for MXNet builds * Changed PythonPath from relative to absolute * Created dedicated bucket with correct permission * Fix for python path in training * Changed bucket name to CI bucket * Added set -ex to the upload shell script * Now raising an exception if no models are found in the S3 bucket * Added regex to train models script * Added check for performing inference only on models trained on same major versions * Added set -ex flags to shell scripts * Added multi-version regex checks in training * Fixed typo in regex * Now we will train models for all the minor versions for a given major version by traversing the tags * Added check for validating current_version
2018-07-31 02:50:13 -07:00
./tests/nightly/model_backwards_compatibility_check/model_backward_compat_checker.sh
}
#Backfills S3 bucket with models trained on earlier versions of mxnet
nightly_model_backwards_compat_train() {
set -ex
export PYTHONPATH=./python/
export DMLC_LOG_STACK_TRACE_DEPTH=100
[MXNET-651] MXNet Model Backwards Compatibility Checker (#11626) * Added MNIST-MLP-Module-API models to check model save and load_checkpoint methods * Added LENET with Conv2D operator training file * Added LENET with Conv2d operator inference file * Added LanguageModelling with RNN training file * Added LamguageModelling with RNN inference file * Added hybridized LENET Gluon Model training file * Added hybridized LENET gluon model inference file * Added license headers * Refactored the model and inference files and extracted out duplicate code in a common file * Added runtime function for executing the MBCC files * Added JenkinsFile for MBCC to be run as a nightly job * Added boto3 install for s3 uploads * Added README for MBCC * Added license header * Added more common functions from lm_rnn_gluon_train and inference files into common.py to clean up code * Added scripts for training models on older versions of MXNet * Added check for preventing inference script from crashing in case no trained models are found * Fixed indentation issue * Replaced Penn Tree Bank Dataset with Sherlock Holmes Dataset * Fixed indentation issue * Removed training in models and added smaller models. Now we are simply checking a forward pass in the model with dummy data. * Updated README * Fixed indentation error * Fixed indentation error * Removed code duplication in the training file * Added comments for runtime_functions script for training files * Merged S3 Buckets for storing data and models into one * Automated the process to fetch MXNet versions from git tags * Added defensive checks for the case where the data might not be found * Fixed issue where we were performing inference on state model files * Replaced print statements with logging ones * Removed boto install statements and move them into ubuntu_python docker * Separated training and uploading of models into separate files so that training runs in Docker and upload runs outside Docker * Fixed pylint warnings * Updated comments and README * Removed the venv for training process * Fixed indentation in the MBCC Jenkins file and also separated out training and inference into two separate stages * Fixed indendation * Fixed erroneous single quote * Added --user flag to check for Jenkins error * Removed unused methods * Added force flag in the pip command to install mxnet * Removed the force-re-install flag * Changed exit 1 to exit 0 * Added quotes around the shell command * added packlibs and unpack libs for MXNet builds * Changed PythonPath from relative to absolute * Created dedicated bucket with correct permission * Fix for python path in training * Changed bucket name to CI bucket * Added set -ex to the upload shell script * Now raising an exception if no models are found in the S3 bucket * Added regex to train models script * Added check for performing inference only on models trained on same major versions * Added set -ex flags to shell scripts * Added multi-version regex checks in training * Fixed typo in regex * Now we will train models for all the minor versions for a given major version by traversing the tags * Added check for validating current_version
2018-07-31 02:50:13 -07:00
./tests/nightly/model_backwards_compatibility_check/train_mxnet_legacy_models.sh
}
nightly_tutorial_test_ubuntu_python3_gpu() {
set -ex
cd /work/mxnet/docs
export BUILD_VER=tutorial
export MXNET_DOCS_BUILD_MXNET=0
export DMLC_LOG_STACK_TRACE_DEPTH=100
make html
export MXNET_STORAGE_FALLBACK_LOG_VERBOSE=0
export MXNET_SUBGRAPH_VERBOSE=0
export PYTHONPATH=/work/mxnet/python/
export MXNET_TUTORIAL_TEST_KERNEL=python3
cd /work/mxnet/tests/tutorials
pytest --durations=50 --cov-report xml:tests_tutorials.xml --capture=no test_tutorials.py
}
nightly_estimator() {
set -ex
export DMLC_LOG_STACK_TRACE_DEPTH=100
cd /work/mxnet/tests/nightly/estimator
export PYTHONPATH=/work/mxnet/python/
pytest test_estimator_cnn.py
pytest test_sentiment_rnn.py
}
# For testing PRs
deploy_docs() {
set -ex
pushd .
export CC="ccache gcc"
export CXX="ccache g++"
build_python_docs
popd
}
build_docs_setup() {
build_folder="docs/_build"
mxnetlib_folder="/work/mxnet/lib"
mkdir -p $build_folder
mkdir -p $mxnetlib_folder
}
build_jekyll_docs() {
set -ex
pushd .
build_docs_setup
pushd docs/static_site
make clean
make html
popd
GZIP=-9 tar zcvf jekyll-artifacts.tgz -C docs/static_site/build html
mv jekyll-artifacts.tgz docs/_build/
popd
}
build_python_docs() {
set -ex
pushd .
build_docs_setup
pushd docs/python_docs
python3 -m pip install -r requirements
python3 -m pip install themes/mx-theme
python3 -m pip install -e /work/mxnet/python --user
export PATH=/home/jenkins_slave/.local/bin:$PATH
pushd python
cp tutorials/getting-started/crash-course/prepare_dataset.py .
make clean
make html EVAL=1
GZIP=-9 tar zcvf python-artifacts.tgz -C build/_build/html .
popd
mv python/python-artifacts.tgz /work/mxnet/docs/_build/
popd
popd
}
build_c_docs() {
set -ex
pushd .
build_docs_setup
doc_path="docs/cpp_docs"
pushd $doc_path
make clean
make html
doc_artifact="c-artifacts.tgz"
GZIP=-9 tar zcvf $doc_artifact -C build/html/html .
popd
mv $doc_path/$doc_artifact docs/_build/
popd
}
build_docs() {
pushd docs/_build
tar -xzf jekyll-artifacts.tgz
python_doc_folder='html/api/python/docs'
api_folder='html/api'
# Python has it's own landing page/site so we don't put it in /docs/api
mkdir -p $python_doc_folder && tar -xzf python-artifacts.tgz --directory $python_doc_folder
mkdir -p $api_folder/cpp/docs/api && tar -xzf c-artifacts.tgz --directory $api_folder/cpp/docs/api
# check if .asf.yaml file exists
if [ ! -f "html/.asf.yaml" ]; then
echo "html/.asf.yaml file does not exist. Exiting 1"
exit 1
fi
# check if .htaccess file exists
if [ ! -f "html/.htaccess" ]; then
echo "html/.htaccess file does not exist. Exiting 1"
exit 1
fi
# get the version
version=$(grep "RewriteRule" html/.htaccess | grep -E "versions\/[0-9]" | sed -nre 's/^[^0-9]*(([0-9]+\.)*[0-9]+).*/\1/p')
# count how many versions are found
lines=$(echo "$version" | wc -l)
# check if multiple versions are found
if [ "$lines" != "1" ]; then
echo "multiple versions detected: $lines. Exiting 1"
exit 1
fi
# check if no version is found
if [ "$version" == "" ]; then
echo "no version found. Exiting 1"
exit 1
fi
# print the one and only default mxnet version
echo "detected version is $version"
# check if the artifacts for this version exist
if [ -d "html/versions/$version/api" ]; then
echo "html/versions/$version/api directory exists"
else
echo "html/versions/$version/api directory does not exist! Exiting 1"
exit 1
fi
# copy the full site for this version to versions folder
mkdir -p html/versions/master
for f in 404.html api assets community ecosystem features trusted_by feed.xml get_started index.html; do
cp -r html/$f html/versions/master/
done
# clean up temp files
find html -type f -name '.DS_Store' -delete
# archive artifact
GZIP=-9 tar -zcvf full_website.tgz -C html .
popd
}
build_docs_beta() {
pushd docs/_build
tar -xzf jekyll-artifacts.tgz
python_doc_folder="html/versions/$BRANCH/api/python/docs"
cpp_doc_folder="html/versions/$BRANCH/api/cpp/docs"
mkdir -p $python_doc_folder && tar -xzf python-artifacts.tgz --directory $python_doc_folder
mkdir -p $cpp_doc_folder && tar -xzf c-artifacts.tgz --directory $cpp_doc_folder
GZIP=-9 tar -zcvf beta_website.tgz -C html .
popd
}
push_docs() {
folder_name=$1
set -ex
export PATH=~/.local/bin:$PATH
pushd docs/_build
tar -xzf full_website.tgz --strip-components 1
# check if folder_name already exists in versions
pushd versions
if [ -d "$folder_name" ]; then
echo "Folder $folder_name already exists in versions. Please double check the FOLDER_NAME variable in Jenkens pipeline"
exit 1
fi
mv master $folder_name
popd
zip -r9 versions.zip versions/.
# Upload versions folder
aws s3 cp versions.zip s3://mxnet-website-static-artifacts --acl public-read
# Backup versions folder with the latest version name
backup_file="versions_backup_upto_$folder_name.zip"
aws s3 cp s3://mxnet-website-static-artifacts/versions.zip s3://mxnet-website-static-artifacts/$backup_file --acl public-read
popd
}
create_repo() {
repo_folder=$1
mxnet_url=$2
git clone $mxnet_url $repo_folder --recursive
echo "Adding MXNet upstream repo..."
cd $repo_folder
git remote add upstream https://github.com/apache/mxnet
cd ..
}
refresh_branches() {
repo_folder=$1
cd $repo_folder
git fetch
git fetch upstream
cd ..
}
checkout() {
repo_folder=$1
cd $repo_folder
# Overriding configs later will cause a conflict here, so stashing...
git stash
# Fails to checkout if not available locally, so try upstream
git checkout "$repo_folder" || git branch $repo_folder "upstream/$repo_folder" && git checkout "$repo_folder" || exit 1
if [ $tag == 'master' ]; then
git pull
# master gets warnings as errors for Sphinx builds
OPTS="-W"
else
OPTS=
fi
git submodule update --init --recursive
cd ..
}
2019-05-23 12:48:44 +02:00
build_static_libmxnet() {
set -ex
pushd .
source /opt/rh/devtoolset-8/enable
source /opt/rh/rh-python38/enable
# Opt in to newer GCC C++ ABI. devtoolset defaults to ABI Version 2.
export CXXFLAGS="-fabi-version=11 -fabi-compat-version=7"
2019-05-23 12:48:44 +02:00
local mxnet_variant=${1:?"This function requires a python command as the first argument"}
source tools/staticbuild/build.sh ${mxnet_variant}
2019-05-23 12:48:44 +02:00
popd
}
# Tests CD PyPI packaging in CI
ci_package_pypi() {
set -ex
# copies oneDNN header files to 3rdparty/onednn/include/oneapi/dnnl/ as in CD
mkdir -p 3rdparty/onednn/include/oneapi/dnnl
cp include/onednn/oneapi/dnnl/dnnl_version.h 3rdparty/onednn/include/oneapi/dnnl/.
cp include/onednn/oneapi/dnnl/dnnl_config.h 3rdparty/onednn/include/oneapi/dnnl/.
local mxnet_variant=${1:?"This function requires a python command as the first argument"}
cd_package_pypi ${mxnet_variant}
cd_integration_test_pypi
}
# Packages libmxnet into wheel file
cd_package_pypi() {
set -ex
pushd .
source /opt/rh/devtoolset-8/enable
source /opt/rh/rh-python38/enable
# Opt in to newer GCC C++ ABI. devtoolset defaults to ABI Version 2.
export CXXFLAGS="-fabi-version=11 -fabi-compat-version=7"
local mxnet_variant=${1:?"This function requires a python command as the first argument"}
./cd/python/pypi/pypi_package.sh ${mxnet_variant}
popd
}
# Sanity checks wheel file
cd_integration_test_pypi() {
set -ex
source /opt/rh/rh-python38/enable
# install mxnet wheel package
pip3 install --user ./wheel_build/dist/*.whl
# execute tests
# TODO: Add tests (18549)
}
# Publishes wheel to PyPI
cd_pypi_publish() {
set -ex
pip3 install --user twine
python3 ./cd/python/pypi/pypi_publish.py `readlink -f wheel_build/dist/*.whl`
}
cd_s3_publish() {
set -ex
filepath=$(readlink -f wheel_build/dist/*.whl)
filename=$(basename $filepath)
variant=$(echo $filename | cut -d'-' -f1 | cut -d'_' -f2 -s)
if [ -z "${variant}" ]; then
variant="cpu"
fi
export PATH=/usr/local/bin:$PATH
2020-01-29 01:23:16 +08:00
aws s3 cp ${filepath} s3://apache-mxnet/dist/python/${variant}/${filename} --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers full=id=43f628fab72838a4f0b929d7f1993b14411f4b0294b011261bc6bd3e950a6822
}
build_static_python_cpu() {
set -ex
pushd .
export mxnet_variant=cpu
source /opt/rh/devtoolset-8/enable
source /opt/rh/rh-python38/enable
# Opt in to newer GCC C++ ABI. devtoolset defaults to ABI Version 2.
export CXXFLAGS="-fabi-version=11 -fabi-compat-version=7"
./ci/publish/python/build.sh
popd
}
build_static_python_cu102() {
set -ex
pushd .
export mxnet_variant=cu102
source /opt/rh/devtoolset-8/enable
source /opt/rh/rh-python38/enable
# Opt in to newer GCC C++ ABI. devtoolset defaults to ABI Version 2.
export CXXFLAGS="-fabi-version=11 -fabi-compat-version=7"
./ci/publish/python/build.sh
popd
}
# artifact repository unit tests
test_artifact_repository() {
set -ex
pushd .
2019-05-25 11:50:45 +02:00
cd cd/utils/
OMP_NUM_THREADS=$(expr $(nproc) / 4) pytest -n 4 test_artifact_repository.py
popd
}
##############################################################
# MAIN
#
# Run function passed as argument
set +x
if [ $# -gt 0 ]
then
$@
else
cat<<EOF
$0: Execute a function by passing it as an argument to the script:
Possible commands:
EOF
declare -F | cut -d' ' -f3
echo
fi