From 671ba54862ec226ee82cdc57f27b27258e9cf601 Mon Sep 17 00:00:00 2001 From: Manu Seth Date: Mon, 28 Jun 2021 09:31:19 +0000 Subject: [PATCH 01/14] add centos7 aarch64 build --- cd/mxnet_lib/Jenkins_pipeline.groovy | 2 +- .../Dockerfile.build.centos7_aarch64_cpu | 106 ++++++++++++++++++ ci/docker/install/requirements_aarch64 | 2 - 3 files changed, 107 insertions(+), 3 deletions(-) create mode 100644 ci/docker/Dockerfile.build.centos7_aarch64_cpu diff --git a/cd/mxnet_lib/Jenkins_pipeline.groovy b/cd/mxnet_lib/Jenkins_pipeline.groovy index f34988d1d1f1..ac372c621206 100644 --- a/cd/mxnet_lib/Jenkins_pipeline.groovy +++ b/cd/mxnet_lib/Jenkins_pipeline.groovy @@ -47,7 +47,7 @@ def build(mxnet_variant) { node(NODE_LINUX_AARCH64_CPU) { ws("workspace/mxnet_${libtype}/${mxnet_variant}/${env.BUILD_NUMBER}") { ci_utils.init_git() - ci_utils.docker_run('publish.ubuntu1804_aarch64_cpu', "build_static_libmxnet ${mxnet_variant}", false) + ci_utils.docker_run('centos7_aarch64_cpu', "build_static_libmxnet ${mxnet_variant}", false) ci_utils.pack_lib("mxnet_${mxnet_variant}", libmxnet_pipeline.get_stash(mxnet_variant)) } } diff --git a/ci/docker/Dockerfile.build.centos7_aarch64_cpu b/ci/docker/Dockerfile.build.centos7_aarch64_cpu new file mode 100644 index 000000000000..24c04dae528d --- /dev/null +++ b/ci/docker/Dockerfile.build.centos7_aarch64_cpu @@ -0,0 +1,106 @@ +# -*- mode: dockerfile -*- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# Dockerfile for CentOS 7 AArch64 CPU build. +# Via the CentOS 7 Dockerfiles, we ensure MXNet continues to run fine on older systems. + +FROM arm64v8/centos:7 + +WORKDIR /work/deps + +RUN yum -y check-update || true && \ + yum -y install epel-release centos-release-scl centos-release-scl-rh && \ + yum install -y \ + # Utilities + wget \ + unzip \ + patchelf \ + pandoc \ + # Development tools + git \ + make \ + ninja-build \ + automake \ + autoconf \ + libtool \ + protobuf-compiler \ + protobuf-devel \ + # CentOS Software Collections https://www.softwarecollections.org + devtoolset-10 \ + devtoolset-10-gcc \ + devtoolset-10-gcc-c++ \ + devtoolset-10-gcc-gfortran \ + rh-python38 \ + rh-python38-python-numpy \ + rh-python38-python-scipy \ + # Libraries + # Provide clbas headerfiles + opencv-devel \ + openssl-devel \ + zeromq-devel \ + # Build-dependencies for ccache 3.7.9 + gperf \ + libb2-devel \ + libzstd-devel \ + yum clean all + +RUN yum-config-manager --enable centos-sclo-rh-testing + +# Make Python 3.8 Software Collections available by default during +# the following build steps in this Dockerfile +SHELL [ "/usr/bin/scl", "enable", "devtoolset-10", "rh-python38" ] + +# Install minimum required cmake version +RUN cd /usr/local/src && \ + wget -nv https://cmake.org/files/v3.19/cmake-3.19.8-Linux-aarch64.sh && \ + sh cmake-3.19.8-Linux-aarch64.sh --prefix=/usr/local --skip-license && \ + rm cmake-3.19.8-Linux-aarch64.sh + +# ccache 3.7.9 has fixes for caching nvcc outputs +RUN cd /usr/local/src && \ + git clone --recursive https://github.com/ccache/ccache.git && \ + cd ccache && \ + git checkout v3.7.9 && \ + ./autogen.sh && \ + ./configure --disable-man && \ + make -j$(nproc) && \ + make install && \ + cd /usr/local/src && \ + rm -rf ccache + +# Fix the en_DK.UTF-8 locale to test locale invariance +RUN localedef -i en_DK -f UTF-8 en_DK.UTF-8 + +# Python dependencies +RUN python3 -m pip install --upgrade pip +COPY install/requirements_aarch64 /work/ +RUN python3 -m pip install -r /work/requirements_aarch64 + +ARG USER_ID=0 +COPY install/centos7_adduser.sh /work/ +RUN /work/centos7_adduser.sh + +ENV PYTHONPATH=./python/ +# Verify that MXNet works correctly when the C locale is set to a locale that uses a comma as the +# decimal separator. Please see #16134 for an example of a bug caused by incorrect handling of +# number serialization and deserialization. +ENV LC_NUMERIC=en_DK.UTF-8 +WORKDIR /work/mxnet + +COPY runtime_functions.sh /work/ + diff --git a/ci/docker/install/requirements_aarch64 b/ci/docker/install/requirements_aarch64 index c3662196a2fd..327a78f7d960 100644 --- a/ci/docker/install/requirements_aarch64 +++ b/ci/docker/install/requirements_aarch64 @@ -25,10 +25,8 @@ decorator==4.4.0 mock==2.0.0 nose==1.3.7 nose-timer==0.7.3 -numpy pylint==2.3.1 # pylint and astroid need to be aligned astroid==2.3.3 # pylint and astroid need to be aligned requests<2.19.0,>=2.18.4 -scipy setuptools coverage From c73a72748ab6c5bb1a0f679104b06b18c45d4719 Mon Sep 17 00:00:00 2001 From: Manu Seth Date: Mon, 28 Jun 2021 18:02:11 +0000 Subject: [PATCH 02/14] enable rh packages --- tools/staticbuild/build.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/staticbuild/build.sh b/tools/staticbuild/build.sh index 5a35bf58d3b0..3ce0ebdfadf4 100755 --- a/tools/staticbuild/build.sh +++ b/tools/staticbuild/build.sh @@ -50,6 +50,8 @@ fi export MAKE="make $ADD_MAKE_FLAG" if [[ $ARCH == 'aarch64' ]]; then + source /opt/rh/devtoolset-10/enable + source /opt/rh/rh-python38/enable export CC="gcc -fPIC -moutline-atomics" export CXX="g++ -fPIC -moutline-atomics" export PKG_CONFIG_PATH=$DEPS_PATH/lib/pkgconfig:$DEPS_PATH/lib64/pkgconfig:$DEPS_PATH/lib/aarch64-linux-gnu/pkgconfig:$PKG_CONFIG_PATH From 1c72875f5f4464fb609280c5582cb4eb377802ea Mon Sep 17 00:00:00 2001 From: Manu Seth Date: Mon, 28 Jun 2021 18:51:10 +0000 Subject: [PATCH 03/14] update openssl curl version --- tools/dependencies/curl.sh | 4 ++-- tools/dependencies/openssl.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/dependencies/curl.sh b/tools/dependencies/curl.sh index 8e546146eeaa..a3148fa678e7 100755 --- a/tools/dependencies/curl.sh +++ b/tools/dependencies/curl.sh @@ -19,7 +19,7 @@ # This script builds the static library of libcurl that can be used as dependency of mxnet. set -ex -LIBCURL_VERSION=7.61.0 +LIBCURL_VERSION=7.77.0 if [[ ! -f $DEPS_PATH/lib/libcurl.a ]]; then # download and build libcurl >&2 echo "Building libcurl..." @@ -30,7 +30,7 @@ if [[ ! -f $DEPS_PATH/lib/libcurl.a ]]; then pushd . cd $DEPS_PATH/curl-$LIBCURL_VERSION if [[ $PLATFORM == 'linux' ]]; then - CONFIG_FLAG="" + CONFIG_FLAG="--with-openssl" elif [[ $PLATFORM == 'darwin' ]]; then CONFIG_FLAG="--with-darwinssl" fi diff --git a/tools/dependencies/openssl.sh b/tools/dependencies/openssl.sh index 9709825d7e4a..697c73518308 100755 --- a/tools/dependencies/openssl.sh +++ b/tools/dependencies/openssl.sh @@ -19,7 +19,7 @@ # This script builds the static library of openssl that can be used as dependency of mxnet. set -ex -OPENSSL_VERSION=1.1.1b +OPENSSL_VERSION=1.1.1k if [[ ! -f $DEPS_PATH/lib/libssl.a ]] || [[ ! -f $DEPS_PATH/lib/libcrypto.a ]]; then # download and build openssl >&2 echo "Building openssl..." From 6e18e849dc7adff2d6b3c4cb6870fe1ea5845c40 Mon Sep 17 00:00:00 2001 From: Manu Seth Date: Mon, 28 Jun 2021 20:04:23 +0000 Subject: [PATCH 04/14] install rhel7 armpl --- cd/mxnet_lib/mxnet_lib_pipeline.groovy | 2 +- cd/python/docker/Dockerfile | 10 +- cd/python/docker/Jenkins_pipeline.groovy | 2 +- cd/python/pypi/Jenkins_pipeline.groovy | 2 +- cd/utils/mxnet_base_image.sh | 2 +- .../Dockerfile.build.centos7_aarch64_cpu | 7 ++ .../Dockerfile.publish.ubuntu1804_aarch64_cpu | 39 -------- ci/docker/install/ubuntu_aarch64_publish.sh | 93 ------------------- config/distribution/linux_aarch64_cpu.cmake | 2 +- tools/staticbuild/build.sh | 2 +- 10 files changed, 18 insertions(+), 143 deletions(-) delete mode 100644 ci/docker/Dockerfile.publish.ubuntu1804_aarch64_cpu delete mode 100755 ci/docker/install/ubuntu_aarch64_publish.sh diff --git a/cd/mxnet_lib/mxnet_lib_pipeline.groovy b/cd/mxnet_lib/mxnet_lib_pipeline.groovy index 5ca1bb1c6d00..9c154a911f97 100644 --- a/cd/mxnet_lib/mxnet_lib_pipeline.groovy +++ b/cd/mxnet_lib/mxnet_lib_pipeline.groovy @@ -76,7 +76,7 @@ def get_stash(mxnet_variant) { // The environment corresponds to the docker files in the 'docker' directory def get_environment(mxnet_variant) { if (mxnet_variant.startsWith("aarch64")) { - return "publish.ubuntu1804_aarch64_cpu" + return "centos7_aarch64_cpu" } else if (mxnet_variant.startsWith("cu")) { // Remove 'mkl' suffix from variant to properly format test environment return "ubuntu_gpu_${mxnet_variant.replace('mkl', '')}" diff --git a/cd/python/docker/Dockerfile b/cd/python/docker/Dockerfile index 28d85cff1f11..1468bb0a9f8b 100644 --- a/cd/python/docker/Dockerfile +++ b/cd/python/docker/Dockerfile @@ -36,12 +36,12 @@ RUN apt-get install -y libgomp1 ARG MXNET_VARIANT RUN if [ "$MXNET_VARIANT" = "aarch64_cpu" ] ; then echo "not installing libquadmath0 on aarch64" ; else apt-get install -y libquadmath0 ; fi -RUN if [ "$MXNET_VARIANT" = "aarch64_cpu" ] ; \ - then wget https://armkeil.blob.core.windows.net/developer/Files/downloads/hpc/arm-performance-libraries/21-0-0/Ubuntu18.04/arm-performance-libraries_21.0_Ubuntu-18.04_gcc-8.2.tar && \ - tar -xvf arm-performance-libraries_21.0_Ubuntu-18.04_gcc-8.2.tar && \ - arm-performance-libraries_21.0_Ubuntu-18.04_gcc-8.2/arm-performance-libraries_21.0_Ubuntu-18.04.sh -a; \ +RUN if [ "$MXNET_VARIANT" = "aarch64_cpu" ] ; then \ + wget https://armkeil.blob.core.windows.net/developer/Files/downloads/hpc/arm-performance-libraries/21-0-0/RHEL7/arm-performance-libraries_21.0_RHEL-7_gcc-10.2.tar && \ + tar -xvf arm-performance-libraries_21.0_RHEL-7_gcc-10.2.tar && \ + arm-performance-libraries_21.0_RHEL-7_gcc-10.2/arm-performance-libraries_21.0_RHEL-7.sh -a; \ fi -ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/opt/arm/armpl_21.0_gcc-8.2/lib/ +ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/opt/arm/armpl_21.0_gcc-10.2/lib ARG MXNET_COMMIT_ID ENV MXNET_COMMIT_ID=${MXNET_COMMIT_ID} diff --git a/cd/python/docker/Jenkins_pipeline.groovy b/cd/python/docker/Jenkins_pipeline.groovy index bf3df36556b6..46fc64714cc3 100644 --- a/cd/python/docker/Jenkins_pipeline.groovy +++ b/cd/python/docker/Jenkins_pipeline.groovy @@ -42,7 +42,7 @@ def get_pipeline(mxnet_variant) { // The environment corresponds to the docker files in the 'docker' directory def get_environment(mxnet_variant) { if (mxnet_variant.startsWith('aarch64')) { - return "publish.ubuntu1804_aarch64_cpu" + return "centos7_aarch64_cpu" } if (mxnet_variant.startsWith('cu')) { return "ubuntu_gpu_${mxnet_variant}" diff --git a/cd/python/pypi/Jenkins_pipeline.groovy b/cd/python/pypi/Jenkins_pipeline.groovy index dfb3018b4500..6be4bc0573eb 100644 --- a/cd/python/pypi/Jenkins_pipeline.groovy +++ b/cd/python/pypi/Jenkins_pipeline.groovy @@ -48,7 +48,7 @@ def get_pipeline(mxnet_variant) { // The environment corresponds to the docker files in the 'docker' directory def get_environment(mxnet_variant) { if (mxnet_variant.startsWith('aarch64')) { - return "publish.ubuntu1804_aarch64_cpu" + return "centos7_aarch64_cpu" } if (mxnet_variant.startsWith('cu')) { return "ubuntu_gpu_${mxnet_variant}" diff --git a/cd/utils/mxnet_base_image.sh b/cd/utils/mxnet_base_image.sh index 723332143080..467d0766354f 100755 --- a/cd/utils/mxnet_base_image.sh +++ b/cd/utils/mxnet_base_image.sh @@ -43,7 +43,7 @@ case ${mxnet_variant} in echo "ubuntu:18.04" ;; aarch64_cpu) - echo "arm64v8/ubuntu:18.04" + echo "arm64v8/centos:7" ;; *) echo "Error: Unrecognized mxnet-variant: '${mxnet_variant}'" diff --git a/ci/docker/Dockerfile.build.centos7_aarch64_cpu b/ci/docker/Dockerfile.build.centos7_aarch64_cpu index 24c04dae528d..0ccafbda5207 100644 --- a/ci/docker/Dockerfile.build.centos7_aarch64_cpu +++ b/ci/docker/Dockerfile.build.centos7_aarch64_cpu @@ -83,6 +83,13 @@ RUN cd /usr/local/src && \ cd /usr/local/src && \ rm -rf ccache +# Arm Performance Libraries 21.0 +RUN wget https://armkeil.blob.core.windows.net/developer/Files/downloads/hpc/arm-performance-libraries/21-0-0/RHEL7/arm-performance-libraries_21.0_RHEL-7_gcc-10.2.tar && \ + tar -xvf arm-performance-libraries_21.0_RHEL-7_gcc-10.2.tar && \ + arm-performance-libraries_21.0_RHEL-7_gcc-10.2/arm-performance-libraries_21.0_RHEL-7.sh -a + +ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/opt/arm/armpl_21.0_gcc-10.2/lib + # Fix the en_DK.UTF-8 locale to test locale invariance RUN localedef -i en_DK -f UTF-8 en_DK.UTF-8 diff --git a/ci/docker/Dockerfile.publish.ubuntu1804_aarch64_cpu b/ci/docker/Dockerfile.publish.ubuntu1804_aarch64_cpu deleted file mode 100644 index f4da407fc7d8..000000000000 --- a/ci/docker/Dockerfile.publish.ubuntu1804_aarch64_cpu +++ /dev/null @@ -1,39 +0,0 @@ -# -*- mode: dockerfile -*- -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -# Dockerfile to build and run MXNet on Ubuntu 18.04 for CPU - -FROM arm64v8/ubuntu:18.04 - -WORKDIR /work/deps - -COPY install/ubuntu_aarch64_publish.sh /work/ -RUN /work/ubuntu_aarch64_publish.sh -ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/opt/arm/armpl_21.0_gcc-8.2/lib/ -ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/gcc-8.5.0/lib64 -ENV PATH=${PATH}:/usr/local/gcc-8.5.0/bin - -ARG USER_ID=0 -ARG GROUP_ID=0 -COPY install/ubuntu_adduser.sh /work/ -RUN /work/ubuntu_adduser.sh - -COPY runtime_functions.sh /work/ - -WORKDIR /work/mxnet -ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib diff --git a/ci/docker/install/ubuntu_aarch64_publish.sh b/ci/docker/install/ubuntu_aarch64_publish.sh deleted file mode 100755 index 78165265187f..000000000000 --- a/ci/docker/install/ubuntu_aarch64_publish.sh +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/env 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 on Ubuntu 18.04 LTS for LINUX CPU/GPU -set -ex - -apt-get update -apt-get install -y software-properties-common -add-apt-repository ppa:ubuntu-toolchain-r/test -y -add-apt-repository ppa:openjdk-r/ppa -y # Java lib -apt-get update -apt-get install -y git \ - build-essential \ - ninja-build \ - libssl-dev \ - libcurl4-openssl-dev \ - ccache \ - unzip \ - libtool \ - curl \ - wget \ - sudo \ - gnupg \ - gnupg2 \ - gnupg-agent \ - libc6-lse \ - pandoc \ - python3 \ - python3-pip \ - automake \ - pkg-config \ - openjdk-8-jdk \ - patchelf - -# build gcc-8.5 from source -apt update -apt install -y flex bison -wget https://ftpmirror.gnu.org/gcc/gcc-8.5.0/gcc-8.5.0.tar.xz -tar xf gcc-8.5.0.tar.xz -cd gcc-8.5.0/ -sed -i contrib/download_prerequisites -e '/base_url=/s/ftp/http/' -contrib/download_prerequisites -cd .. -mkdir build && cd build -../gcc-8.5.0/configure -v --build=aarch64-linux-gnu --host=aarch64-linux-gnu --target=aarch64-linux-gnu --prefix=/usr/local/gcc-8.5.0 --enable-checking=release --enable-languages=c,c++,fortran --disable-multilib --program-suffix=-8.5 -make -j$(nproc) -sudo make install-strip -cd .. -rm -rf gcc-8.5.0.tar.xz -update-alternatives --install /usr/bin/gcc gcc /usr/local/gcc-8.5.0/bin/gcc-8.5 100 --slave /usr/bin/g++ g++ /usr/local/gcc-8.5.0/bin/g++-8.5 --slave /usr/bin/gcov gcov /usr/local/gcc-8.5.0/bin/gcov-8.5 --slave /usr/bin/gfortran gfortran /usr/local/gcc-8.5.0/bin/gfortran-8.5 - -curl -o apache-maven-3.3.9-bin.tar.gz -L http://www.eu.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz \ - || curl -o apache-maven-3.3.9-bin.tar.gz -L https://search.maven.org/remotecontent?filepath=org/apache/maven/apache-maven/3.3.9/apache-maven-3.3.9-bin.tar.gz - -tar xzf apache-maven-3.3.9-bin.tar.gz -mkdir /usr/local/maven -mv apache-maven-3.3.9/ /usr/local/maven/ -update-alternatives --install /usr/bin/mvn mvn /usr/local/maven/apache-maven-3.3.9/bin/mvn 1 -update-ca-certificates -f - -# the version of the pip shipped with ubuntu may be too lower, install a recent version here -python3 -m pip install --upgrade pip - -python3 -m pip install --upgrade --ignore-installed nose cpplint==1.3.0 pylint==2.3.1 nose-timer 'numpy<2.0.0,>1.16.0' 'requests<3,>=2.20.0' scipy boto3 - -# CMake 3.13.2+ is required -wget https://github.com/Kitware/CMake/releases/download/v3.16.5/cmake-3.16.5.tar.gz -tar -zxvf cmake-3.16.5.tar.gz -cd cmake-3.16.5 -./bootstrap -make -j$(nproc) -sudo make install - -# Download and set up Arm Performance Libraries -wget https://armkeil.blob.core.windows.net/developer/Files/downloads/hpc/arm-performance-libraries/21-0-0/Ubuntu18.04/arm-performance-libraries_21.0_Ubuntu-18.04_gcc-8.2.tar -tar -xvf arm-performance-libraries_21.0_Ubuntu-18.04_gcc-8.2.tar -arm-performance-libraries_21.0_Ubuntu-18.04_gcc-8.2/arm-performance-libraries_21.0_Ubuntu-18.04.sh -a diff --git a/config/distribution/linux_aarch64_cpu.cmake b/config/distribution/linux_aarch64_cpu.cmake index 26e7b2cbb267..a3947b846f46 100644 --- a/config/distribution/linux_aarch64_cpu.cmake +++ b/config/distribution/linux_aarch64_cpu.cmake @@ -42,4 +42,4 @@ set(MKLDNN_USE_ACL OFF CACHE BOOL "Integrate MKLDNN with Arm Compute Library") # Note that APL needs to be added to LD_LIBRARY_PATH set(MKLDNN_USE_APL ON CACHE BOOL "Integrate MKLDNN with Arm Performance Libraries") # Due to a MKLDNN bug we will need to manually set the ArmPL header -set(BLAS_INCLUDE_DIR "/opt/arm/armpl_21.0_gcc-8.2/include_lp64_mp" CACHE STRING "Specifies BLAS include dir") +set(BLAS_INCLUDE_DIR "/opt/arm/armpl_21.0_gcc-10.2/include_lp64_mp" CACHE STRING "Specifies BLAS include dir") diff --git a/tools/staticbuild/build.sh b/tools/staticbuild/build.sh index 3ce0ebdfadf4..7490b5d38f9b 100755 --- a/tools/staticbuild/build.sh +++ b/tools/staticbuild/build.sh @@ -62,7 +62,7 @@ else fi export FC="gfortran" if [[ $ARCH == 'aarch64' ]]; then - export CPATH=/opt/arm/armpl_21.0_gcc-8.2/include_lp64_mp:$CPATH + export CPATH=/opt/arm/armpl_21.0_gcc-10.2/include_lp64_mp:$CPATH else export CPATH=$DEPS_PATH/include:$CPATH fi From 94325db12abcad1378fd90d389ee6b9b3cd4dae4 Mon Sep 17 00:00:00 2001 From: Manu Seth Date: Mon, 28 Jun 2021 20:17:54 +0000 Subject: [PATCH 05/14] find armpl cmake --- cmake/Modules/FindArmPL.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmake/Modules/FindArmPL.cmake b/cmake/Modules/FindArmPL.cmake index 5ff4e44832c6..08b4de43e310 100644 --- a/cmake/Modules/FindArmPL.cmake +++ b/cmake/Modules/FindArmPL.cmake @@ -25,12 +25,12 @@ file(TO_CMAKE_PATH "$ENV{ArmPL_HOME}" ArmPL_HOME) SET(ArmPL_INCLUDE_SEARCH_PATHS - /opt/arm/armpl_21.0_gcc-8.2/include_lp64_mp + /opt/arm/armpl_21.0_gcc-10.2/include_lp64_mp ${ArmPL_HOME}/include_lp64_mp ) SET(ArmPL_LIB_SEARCH_PATHS - /opt/arm/armpl_21.0_gcc-8.2/lib + /opt/arm/armpl_21.0_gcc-10.2/lib ${ArmPL_HOME}/lib ) @@ -42,8 +42,8 @@ SET(ArmPL_LIBRARIES ${ArmPL_LIB} ${MATH_LIB} ${STRING_LIB} - /usr/local/gcc-8.5.0/lib64/libgfortran.so - /usr/lib/aarch64-linux-gnu/libm.so + libgfortran.so + libm.so ) SET(ArmPL_FOUND ON) From ae91af3154a3098dc48ac4e15b607cc293f66254 Mon Sep 17 00:00:00 2001 From: Manu Seth Date: Mon, 28 Jun 2021 21:45:17 +0000 Subject: [PATCH 06/14] test mkldnn build --- config/distribution/linux_aarch64_cpu.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/distribution/linux_aarch64_cpu.cmake b/config/distribution/linux_aarch64_cpu.cmake index a3947b846f46..1a7dd8cf0da7 100644 --- a/config/distribution/linux_aarch64_cpu.cmake +++ b/config/distribution/linux_aarch64_cpu.cmake @@ -40,6 +40,6 @@ set(ENV{ACL_ROOT_DIR} "") set(MKLDNN_USE_ACL OFF CACHE BOOL "Integrate MKLDNN with Arm Compute Library") # APL can be downloaded from https://developer.arm.com/tools-and-software/server-and-hpc/downloads/arm-performance-libraries # Note that APL needs to be added to LD_LIBRARY_PATH -set(MKLDNN_USE_APL ON CACHE BOOL "Integrate MKLDNN with Arm Performance Libraries") +set(MKLDNN_USE_APL OFF CACHE BOOL "Integrate MKLDNN with Arm Performance Libraries") # Due to a MKLDNN bug we will need to manually set the ArmPL header -set(BLAS_INCLUDE_DIR "/opt/arm/armpl_21.0_gcc-10.2/include_lp64_mp" CACHE STRING "Specifies BLAS include dir") +# set(BLAS_INCLUDE_DIR "/opt/arm/armpl_21.0_gcc-10.2/include_lp64_mp" CACHE STRING "Specifies BLAS include dir") From 4e033d79fe1737b86c00852a4051d3dfeffe745e Mon Sep 17 00:00:00 2001 From: Manu Seth Date: Tue, 29 Jun 2021 10:24:14 +0000 Subject: [PATCH 07/14] test ninja --- ci/docker/Dockerfile.build.centos7_aarch64_cpu | 17 ++++++++--------- tools/staticbuild/build_lib_cmake.sh | 2 +- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/ci/docker/Dockerfile.build.centos7_aarch64_cpu b/ci/docker/Dockerfile.build.centos7_aarch64_cpu index 0ccafbda5207..57e803bd3caa 100644 --- a/ci/docker/Dockerfile.build.centos7_aarch64_cpu +++ b/ci/docker/Dockerfile.build.centos7_aarch64_cpu @@ -49,7 +49,6 @@ RUN yum -y check-update || true && \ rh-python38-python-numpy \ rh-python38-python-scipy \ # Libraries - # Provide clbas headerfiles opencv-devel \ openssl-devel \ zeromq-devel \ @@ -59,17 +58,15 @@ RUN yum -y check-update || true && \ libzstd-devel \ yum clean all -RUN yum-config-manager --enable centos-sclo-rh-testing - # Make Python 3.8 Software Collections available by default during # the following build steps in this Dockerfile SHELL [ "/usr/bin/scl", "enable", "devtoolset-10", "rh-python38" ] # Install minimum required cmake version RUN cd /usr/local/src && \ - wget -nv https://cmake.org/files/v3.19/cmake-3.19.8-Linux-aarch64.sh && \ - sh cmake-3.19.8-Linux-aarch64.sh --prefix=/usr/local --skip-license && \ - rm cmake-3.19.8-Linux-aarch64.sh + wget -nv https://cmake.org/files/v3.20/cmake-3.20.5-linux-aarch64.sh && \ + sh cmake-3.20.5-linux-aarch64.sh --prefix=/usr/local --skip-license && \ + rm cmake-3.20.5-linux-aarch64.sh # ccache 3.7.9 has fixes for caching nvcc outputs RUN cd /usr/local/src && \ @@ -84,10 +81,12 @@ RUN cd /usr/local/src && \ rm -rf ccache # Arm Performance Libraries 21.0 -RUN wget https://armkeil.blob.core.windows.net/developer/Files/downloads/hpc/arm-performance-libraries/21-0-0/RHEL7/arm-performance-libraries_21.0_RHEL-7_gcc-10.2.tar && \ +RUN cd /usr/local/src && \ + wget https://armkeil.blob.core.windows.net/developer/Files/downloads/hpc/arm-performance-libraries/21-0-0/RHEL7/arm-performance-libraries_21.0_RHEL-7_gcc-10.2.tar && \ tar -xvf arm-performance-libraries_21.0_RHEL-7_gcc-10.2.tar && \ - arm-performance-libraries_21.0_RHEL-7_gcc-10.2/arm-performance-libraries_21.0_RHEL-7.sh -a - + arm-performance-libraries_21.0_RHEL-7_gcc-10.2/arm-performance-libraries_21.0_RHEL-7.sh -a && \ + cd /usr/local/src && \ + rm -rf arm-performance-libraries_21.0_RHEL-7_gcc-10.2.tar arm-performance-libraries_21.0_RHEL-7_gcc-10.2 ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/opt/arm/armpl_21.0_gcc-10.2/lib # Fix the en_DK.UTF-8 locale to test locale invariance diff --git a/tools/staticbuild/build_lib_cmake.sh b/tools/staticbuild/build_lib_cmake.sh index a29c393f9a9f..a915b47cdedd 100755 --- a/tools/staticbuild/build_lib_cmake.sh +++ b/tools/staticbuild/build_lib_cmake.sh @@ -32,7 +32,7 @@ git submodule update --init --recursive || true # Build libmxnet.so rm -rf build; mkdir build; cd build cmake -GNinja -C $cmake_config -DCMAKE_PREFIX_PATH=${DEPS_PATH} -DCMAKE_FIND_ROOT_PATH=${DEPS_PATH} .. -ninja +ninja-build cd - # Move to lib From 093d0ce5b815e6b8a131c5bedad67492d1de0ec3 Mon Sep 17 00:00:00 2001 From: Manu Seth Date: Thu, 1 Jul 2021 21:27:57 +0000 Subject: [PATCH 08/14] use armpl compiled with gcc-8 --- cd/python/docker/Dockerfile | 8 ++++---- ci/docker/Dockerfile.build.centos7_aarch64_cpu | 17 ++++++++--------- cmake/Modules/FindArmPL.cmake | 4 ++-- config/distribution/linux_aarch64_cpu.cmake | 4 ++-- tools/staticbuild/build.sh | 3 +-- 5 files changed, 17 insertions(+), 19 deletions(-) diff --git a/cd/python/docker/Dockerfile b/cd/python/docker/Dockerfile index 1468bb0a9f8b..d674363b6a1f 100644 --- a/cd/python/docker/Dockerfile +++ b/cd/python/docker/Dockerfile @@ -37,11 +37,11 @@ RUN apt-get install -y libgomp1 ARG MXNET_VARIANT RUN if [ "$MXNET_VARIANT" = "aarch64_cpu" ] ; then echo "not installing libquadmath0 on aarch64" ; else apt-get install -y libquadmath0 ; fi RUN if [ "$MXNET_VARIANT" = "aarch64_cpu" ] ; then \ - wget https://armkeil.blob.core.windows.net/developer/Files/downloads/hpc/arm-performance-libraries/21-0-0/RHEL7/arm-performance-libraries_21.0_RHEL-7_gcc-10.2.tar && \ - tar -xvf arm-performance-libraries_21.0_RHEL-7_gcc-10.2.tar && \ - arm-performance-libraries_21.0_RHEL-7_gcc-10.2/arm-performance-libraries_21.0_RHEL-7.sh -a; \ + wget https://armkeil.blob.core.windows.net/developer/Files/downloads/hpc/arm-performance-libraries/21-0-0/RHEL7/arm-performance-libraries_21.0_RHEL-7_gcc-8.2.tar && \ + tar -xvf arm-performance-libraries_21.0_RHEL-7_gcc-8.2.tar && \ + arm-performance-libraries_21.0_RHEL-7_gcc-8.2/arm-performance-libraries_21.0_RHEL-7.sh -a; \ fi -ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/opt/arm/armpl_21.0_gcc-10.2/lib +ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/opt/arm/armpl_21.0_gcc-8.2/lib ARG MXNET_COMMIT_ID ENV MXNET_COMMIT_ID=${MXNET_COMMIT_ID} diff --git a/ci/docker/Dockerfile.build.centos7_aarch64_cpu b/ci/docker/Dockerfile.build.centos7_aarch64_cpu index 57e803bd3caa..36415107ae6e 100644 --- a/ci/docker/Dockerfile.build.centos7_aarch64_cpu +++ b/ci/docker/Dockerfile.build.centos7_aarch64_cpu @@ -55,11 +55,11 @@ RUN yum -y check-update || true && \ # Build-dependencies for ccache 3.7.9 gperf \ libb2-devel \ - libzstd-devel \ + libzstd-devel && \ yum clean all -# Make Python 3.8 Software Collections available by default during -# the following build steps in this Dockerfile +# Make Red Hat Developer Toolset 10.0 and Python 3.8 Software Collections available by default +# during the following build steps in this Dockerfile SHELL [ "/usr/bin/scl", "enable", "devtoolset-10", "rh-python38" ] # Install minimum required cmake version @@ -82,12 +82,11 @@ RUN cd /usr/local/src && \ # Arm Performance Libraries 21.0 RUN cd /usr/local/src && \ - wget https://armkeil.blob.core.windows.net/developer/Files/downloads/hpc/arm-performance-libraries/21-0-0/RHEL7/arm-performance-libraries_21.0_RHEL-7_gcc-10.2.tar && \ - tar -xvf arm-performance-libraries_21.0_RHEL-7_gcc-10.2.tar && \ - arm-performance-libraries_21.0_RHEL-7_gcc-10.2/arm-performance-libraries_21.0_RHEL-7.sh -a && \ - cd /usr/local/src && \ - rm -rf arm-performance-libraries_21.0_RHEL-7_gcc-10.2.tar arm-performance-libraries_21.0_RHEL-7_gcc-10.2 -ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/opt/arm/armpl_21.0_gcc-10.2/lib + wget https://armkeil.blob.core.windows.net/developer/Files/downloads/hpc/arm-performance-libraries/21-0-0/RHEL7/arm-performance-libraries_21.0_RHEL-7_gcc-8.2.tar && \ + tar -xvf arm-performance-libraries_21.0_RHEL-7_gcc-8.2.tar && \ + arm-performance-libraries_21.0_RHEL-7_gcc-8.2/arm-performance-libraries_21.0_RHEL-7.sh -a && \ + rm -rf arm-performance-libraries_21.0_RHEL-7_gcc-8.2.tar arm-performance-libraries_21.0_RHEL-7_gcc-8.2 +ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/opt/arm/armpl_21.0_gcc-8.2/lib # Fix the en_DK.UTF-8 locale to test locale invariance RUN localedef -i en_DK -f UTF-8 en_DK.UTF-8 diff --git a/cmake/Modules/FindArmPL.cmake b/cmake/Modules/FindArmPL.cmake index 08b4de43e310..49d8e096d74a 100644 --- a/cmake/Modules/FindArmPL.cmake +++ b/cmake/Modules/FindArmPL.cmake @@ -25,12 +25,12 @@ file(TO_CMAKE_PATH "$ENV{ArmPL_HOME}" ArmPL_HOME) SET(ArmPL_INCLUDE_SEARCH_PATHS - /opt/arm/armpl_21.0_gcc-10.2/include_lp64_mp + /opt/arm/armpl_21.0_gcc-8.2/include_lp64_mp ${ArmPL_HOME}/include_lp64_mp ) SET(ArmPL_LIB_SEARCH_PATHS - /opt/arm/armpl_21.0_gcc-10.2/lib + /opt/arm/armpl_21.0_gcc-8.2/lib ${ArmPL_HOME}/lib ) diff --git a/config/distribution/linux_aarch64_cpu.cmake b/config/distribution/linux_aarch64_cpu.cmake index 1a7dd8cf0da7..26e7b2cbb267 100644 --- a/config/distribution/linux_aarch64_cpu.cmake +++ b/config/distribution/linux_aarch64_cpu.cmake @@ -40,6 +40,6 @@ set(ENV{ACL_ROOT_DIR} "") set(MKLDNN_USE_ACL OFF CACHE BOOL "Integrate MKLDNN with Arm Compute Library") # APL can be downloaded from https://developer.arm.com/tools-and-software/server-and-hpc/downloads/arm-performance-libraries # Note that APL needs to be added to LD_LIBRARY_PATH -set(MKLDNN_USE_APL OFF CACHE BOOL "Integrate MKLDNN with Arm Performance Libraries") +set(MKLDNN_USE_APL ON CACHE BOOL "Integrate MKLDNN with Arm Performance Libraries") # Due to a MKLDNN bug we will need to manually set the ArmPL header -# set(BLAS_INCLUDE_DIR "/opt/arm/armpl_21.0_gcc-10.2/include_lp64_mp" CACHE STRING "Specifies BLAS include dir") +set(BLAS_INCLUDE_DIR "/opt/arm/armpl_21.0_gcc-8.2/include_lp64_mp" CACHE STRING "Specifies BLAS include dir") diff --git a/tools/staticbuild/build.sh b/tools/staticbuild/build.sh index 7490b5d38f9b..295ad421a47c 100755 --- a/tools/staticbuild/build.sh +++ b/tools/staticbuild/build.sh @@ -51,7 +51,6 @@ export MAKE="make $ADD_MAKE_FLAG" if [[ $ARCH == 'aarch64' ]]; then source /opt/rh/devtoolset-10/enable - source /opt/rh/rh-python38/enable export CC="gcc -fPIC -moutline-atomics" export CXX="g++ -fPIC -moutline-atomics" export PKG_CONFIG_PATH=$DEPS_PATH/lib/pkgconfig:$DEPS_PATH/lib64/pkgconfig:$DEPS_PATH/lib/aarch64-linux-gnu/pkgconfig:$PKG_CONFIG_PATH @@ -62,7 +61,7 @@ else fi export FC="gfortran" if [[ $ARCH == 'aarch64' ]]; then - export CPATH=/opt/arm/armpl_21.0_gcc-10.2/include_lp64_mp:$CPATH + export CPATH=/opt/arm/armpl_21.0_gcc-8.2/include_lp64_mp:$CPATH else export CPATH=$DEPS_PATH/include:$CPATH fi From f467493c1756adb63b5714aeb10e971dbf93258e Mon Sep 17 00:00:00 2001 From: Manu Seth Date: Sat, 3 Jul 2021 01:23:50 +0000 Subject: [PATCH 09/14] enable py38 for unittests --- ci/docker/runtime_functions.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ci/docker/runtime_functions.sh b/ci/docker/runtime_functions.sh index 156264aaaea5..1de1a1238afb 100755 --- a/ci/docker/runtime_functions.sh +++ b/ci/docker/runtime_functions.sh @@ -984,6 +984,10 @@ cd_unittest_ubuntu() { local nose_cmd="nosetests-3.4" + if [[ ${mxnet_variant} = aarch64_cpu ]]; then + source /opt/rh/rh-python38/enable + fi + $nose_cmd $NOSE_TIMER_ARGUMENTS --verbose tests/python/unittest $nose_cmd $NOSE_TIMER_ARGUMENTS --verbose tests/python/quantization @@ -2017,6 +2021,9 @@ cd_package_pypi() { set -ex pushd . local mxnet_variant=${1:?"This function requires a python command as the first argument"} + if [[ ${mxnet_variant} = aarch64_cpu ]]; then + source /opt/rh/rh-python38/enable + fi ./cd/python/pypi/pypi_package.sh ${mxnet_variant} popd } From c71196682f63853ec46492790847cee58d052b47 Mon Sep 17 00:00:00 2001 From: Manu Seth Date: Sat, 3 Jul 2021 09:50:01 +0000 Subject: [PATCH 10/14] check previously failing tests --- tests/python/unittest/test_ndarray.py | 3 --- tests/python/unittest/test_numpy_interoperability.py | 2 -- tests/python/unittest/test_numpy_op.py | 2 -- tests/python/unittest/test_profiler.py | 4 ++-- 4 files changed, 2 insertions(+), 9 deletions(-) diff --git a/tests/python/unittest/test_ndarray.py b/tests/python/unittest/test_ndarray.py index 3f93cbe30284..c8fbf35065b7 100644 --- a/tests/python/unittest/test_ndarray.py +++ b/tests/python/unittest/test_ndarray.py @@ -31,13 +31,11 @@ from mxnet.test_utils import np_reduce from mxnet.test_utils import same from mxnet.test_utils import random_sample, rand_shape_nd, random_arrays -from mxnet.test_utils import is_aarch64_run from mxnet import runtime from numpy.testing import assert_allclose, assert_array_equal, assert_array_almost_equal import mxnet.autograd from mxnet.base import integer_types from mxnet.ndarray.ndarray import py_slice -import unittest def check_with_uniform(uf, arg_shapes, dim=None, npuf=None, rmin=-10, type_list=[np.float32]): @@ -1285,7 +1283,6 @@ def test_output(): @with_seed() -@unittest.skipIf(is_aarch64_run(), "test fails on aarch64 - tracked in #20289") def test_ndarray_fluent(): has_grad = set(['flatten', 'expand_dims', 'flip', 'tile', 'transpose', 'sum', 'nansum', 'prod', 'nanprod', 'mean', 'max', 'min', 'reshape', 'broadcast_to', 'split', 'split_v2', diff --git a/tests/python/unittest/test_numpy_interoperability.py b/tests/python/unittest/test_numpy_interoperability.py index 63e74c746d5b..fd8abf1849be 100644 --- a/tests/python/unittest/test_numpy_interoperability.py +++ b/tests/python/unittest/test_numpy_interoperability.py @@ -28,7 +28,6 @@ from mxnet.test_utils import assert_almost_equal from mxnet.test_utils import use_np from mxnet.test_utils import is_op_runnable -from mxnet.test_utils import is_aarch64_run from common import assertRaises, with_seed, random_seed, setup_module, teardown from mxnet.numpy_dispatch_protocol import with_array_function_protocol, with_array_ufunc_protocol from mxnet.numpy_dispatch_protocol import _NUMPY_ARRAY_FUNCTION_LIST, _NUMPY_ARRAY_UFUNC_LIST @@ -3067,7 +3066,6 @@ def test_np_memory_array_function(): @with_seed() @use_np -@unittest.skipIf(is_aarch64_run(), "test fails on aarch64 - tracked in #20289") @with_array_function_protocol def test_np_array_function_protocol(): check_interoperability(_NUMPY_ARRAY_FUNCTION_LIST) diff --git a/tests/python/unittest/test_numpy_op.py b/tests/python/unittest/test_numpy_op.py index 6833cd3fb765..add0620be71d 100644 --- a/tests/python/unittest/test_numpy_op.py +++ b/tests/python/unittest/test_numpy_op.py @@ -34,7 +34,6 @@ from mxnet.test_utils import check_numeric_gradient, use_np, collapse_sum_like, effective_dtype from mxnet.test_utils import new_matrix_with_real_eigvals_nd from mxnet.test_utils import new_sym_matrix_with_real_eigvals_nd -from mxnet.test_utils import is_aarch64_run from common import assertRaises, with_seed import random from mxnet.test_utils import verify_generator, gen_buckets_probs_with_ppf @@ -3575,7 +3574,6 @@ def hybrid_forward(self, F, x): @with_seed() @use_np -@unittest.skipIf(is_aarch64_run(), "test fails on aarch64 - tracked in #20289") def test_np_delete(): class TestDelete(HybridBlock): def __init__(self, obj, axis=None): diff --git a/tests/python/unittest/test_profiler.py b/tests/python/unittest/test_profiler.py index 8e8209f5235b..ae7352c19301 100644 --- a/tests/python/unittest/test_profiler.py +++ b/tests/python/unittest/test_profiler.py @@ -61,10 +61,10 @@ def test_profiler(): for i in range(iter_num): if i == begin_profiling_iter: - t0 = time.clock() + t0 = time.process_time() profiler.set_state('run') if i == end_profiling_iter: - t1 = time.clock() + t1 = time.process_time() profiler.set_state('stop') executor.forward() c = executor.outputs[0] From a81fb7449fe7c1d2d891d15caf15b9af2069875d Mon Sep 17 00:00:00 2001 From: Manu Seth Date: Sat, 3 Jul 2021 11:19:35 +0000 Subject: [PATCH 11/14] create symlink for ninja --- ci/docker/runtime_functions.sh | 3 +++ tools/staticbuild/build.sh | 1 - tools/staticbuild/build_lib_cmake.sh | 6 +++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ci/docker/runtime_functions.sh b/ci/docker/runtime_functions.sh index 1de1a1238afb..d2907e008717 100755 --- a/ci/docker/runtime_functions.sh +++ b/ci/docker/runtime_functions.sh @@ -2011,6 +2011,9 @@ build_static_libmxnet() { set -ex pushd . local mxnet_variant=${1:?"This function requires a python command as the first argument"} + if [[ ${mxnet_variant} = aarch64_cpu ]]; then + source /opt/rh/devtoolset-10/enable + fi CMAKE_STATICBUILD=1 source tools/staticbuild/build.sh ${mxnet_variant} popd diff --git a/tools/staticbuild/build.sh b/tools/staticbuild/build.sh index 295ad421a47c..5a35bf58d3b0 100755 --- a/tools/staticbuild/build.sh +++ b/tools/staticbuild/build.sh @@ -50,7 +50,6 @@ fi export MAKE="make $ADD_MAKE_FLAG" if [[ $ARCH == 'aarch64' ]]; then - source /opt/rh/devtoolset-10/enable export CC="gcc -fPIC -moutline-atomics" export CXX="g++ -fPIC -moutline-atomics" export PKG_CONFIG_PATH=$DEPS_PATH/lib/pkgconfig:$DEPS_PATH/lib64/pkgconfig:$DEPS_PATH/lib/aarch64-linux-gnu/pkgconfig:$PKG_CONFIG_PATH diff --git a/tools/staticbuild/build_lib_cmake.sh b/tools/staticbuild/build_lib_cmake.sh index a915b47cdedd..e6c14e4bb7a7 100755 --- a/tools/staticbuild/build_lib_cmake.sh +++ b/tools/staticbuild/build_lib_cmake.sh @@ -32,7 +32,11 @@ git submodule update --init --recursive || true # Build libmxnet.so rm -rf build; mkdir build; cd build cmake -GNinja -C $cmake_config -DCMAKE_PREFIX_PATH=${DEPS_PATH} -DCMAKE_FIND_ROOT_PATH=${DEPS_PATH} .. -ninja-build +if [[ ! $ARCH == 'aarch64' ]]; then + ninja +else + ninja-build +fi cd - # Move to lib From 7eaabf45e99a3669cd451638a30c8869a80df6a7 Mon Sep 17 00:00:00 2001 From: Manu Seth Date: Mon, 5 Jul 2021 05:08:49 +0000 Subject: [PATCH 12/14] fix cd pypi --- cd/python/pypi/Jenkins_pipeline.groovy | 2 +- cd/utils/mxnet_base_image.sh | 2 +- ci/docker/runtime_functions.sh | 14 ++++++++------ 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/cd/python/pypi/Jenkins_pipeline.groovy b/cd/python/pypi/Jenkins_pipeline.groovy index 6be4bc0573eb..8b2d37ff3090 100644 --- a/cd/python/pypi/Jenkins_pipeline.groovy +++ b/cd/python/pypi/Jenkins_pipeline.groovy @@ -73,7 +73,7 @@ def test(mxnet_variant) { // test wheel file def environment = get_environment(mxnet_variant) def nvidia_docker = mxnet_variant.startsWith('cu') - ci_utils.docker_run(environment, "cd_integration_test_pypi python3 ${nvidia_docker}", nvidia_docker) + ci_utils.docker_run(environment, "cd_integration_test_pypi ${mxnet_variant} ${nvidia_docker}", nvidia_docker) } } diff --git a/cd/utils/mxnet_base_image.sh b/cd/utils/mxnet_base_image.sh index 467d0766354f..723332143080 100755 --- a/cd/utils/mxnet_base_image.sh +++ b/cd/utils/mxnet_base_image.sh @@ -43,7 +43,7 @@ case ${mxnet_variant} in echo "ubuntu:18.04" ;; aarch64_cpu) - echo "arm64v8/centos:7" + echo "arm64v8/ubuntu:18.04" ;; *) echo "Error: Unrecognized mxnet-variant: '${mxnet_variant}'" diff --git a/ci/docker/runtime_functions.sh b/ci/docker/runtime_functions.sh index d2907e008717..8e1d31d6a0c5 100755 --- a/ci/docker/runtime_functions.sh +++ b/ci/docker/runtime_functions.sh @@ -2034,25 +2034,27 @@ cd_package_pypi() { # Sanity checks wheel file cd_integration_test_pypi() { set -ex - local python_cmd=${1:?"This function requires a python command as the first argument"} + local mxnet_variant=${1:?"This function requires a python command as the first argument"} local gpu_enabled=${2:-"false"} local test_conv_params='' local mnist_params='' - local pip_cmd='pip3' - if [ "${gpu_enabled}" = "true" ]; then mnist_params="--gpu 0" test_conv_params="--gpu" fi + if [[ ${mxnet_variant} = aarch64_cpu ]]; then + source /opt/rh/rh-python38/enable + fi + # install mxnet wheel package - ${pip_cmd} install --user ./wheel_build/dist/*.whl + python3 -m pip install --user ./wheel_build/dist/*.whl # execute tests - ${python_cmd} /work/mxnet/tests/python/train/test_conv.py ${test_conv_params} - ${python_cmd} /work/mxnet/example/image-classification/train_mnist.py ${mnist_params} + python3 /work/mxnet/tests/python/train/test_conv.py ${test_conv_params} + python3 /work/mxnet/example/image-classification/train_mnist.py ${mnist_params} } # Publishes wheel to PyPI From 57d205d699f3d919b9559e28ed427ec0e7fbb43d Mon Sep 17 00:00:00 2001 From: Manu Seth Date: Mon, 5 Jul 2021 08:02:37 +0000 Subject: [PATCH 13/14] fix cd docker --- cd/python/docker/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cd/python/docker/Dockerfile b/cd/python/docker/Dockerfile index d674363b6a1f..16d20832eb0c 100644 --- a/cd/python/docker/Dockerfile +++ b/cd/python/docker/Dockerfile @@ -37,9 +37,9 @@ RUN apt-get install -y libgomp1 ARG MXNET_VARIANT RUN if [ "$MXNET_VARIANT" = "aarch64_cpu" ] ; then echo "not installing libquadmath0 on aarch64" ; else apt-get install -y libquadmath0 ; fi RUN if [ "$MXNET_VARIANT" = "aarch64_cpu" ] ; then \ - wget https://armkeil.blob.core.windows.net/developer/Files/downloads/hpc/arm-performance-libraries/21-0-0/RHEL7/arm-performance-libraries_21.0_RHEL-7_gcc-8.2.tar && \ - tar -xvf arm-performance-libraries_21.0_RHEL-7_gcc-8.2.tar && \ - arm-performance-libraries_21.0_RHEL-7_gcc-8.2/arm-performance-libraries_21.0_RHEL-7.sh -a; \ + wget https://armkeil.blob.core.windows.net/developer/Files/downloads/hpc/arm-performance-libraries/21-0-0/Ubuntu18.04/arm-performance-libraries_21.0_Ubuntu-18.04_gcc-8.2.tar && \ + tar -xvf arm-performance-libraries_21.0_Ubuntu-18.04_gcc-8.2.tar && \ + arm-performance-libraries_21.0_Ubuntu-18.04_gcc-8.2/arm-performance-libraries_21.0_Ubuntu-18.04.sh -a; \ fi ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/opt/arm/armpl_21.0_gcc-8.2/lib From c4c672b9415c763dbb77825ca562337294774a86 Mon Sep 17 00:00:00 2001 From: Manu Seth Date: Mon, 5 Jul 2021 23:30:48 +0000 Subject: [PATCH 14/14] update ssl for mac --- tools/dependencies/curl.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/dependencies/curl.sh b/tools/dependencies/curl.sh index a3148fa678e7..948d4a2ae088 100755 --- a/tools/dependencies/curl.sh +++ b/tools/dependencies/curl.sh @@ -32,7 +32,7 @@ if [[ ! -f $DEPS_PATH/lib/libcurl.a ]]; then if [[ $PLATFORM == 'linux' ]]; then CONFIG_FLAG="--with-openssl" elif [[ $PLATFORM == 'darwin' ]]; then - CONFIG_FLAG="--with-darwinssl" + CONFIG_FLAG="--with-secure-transport" fi ./configure $CONFIG_FLAG \ --with-zlib \