Skip to content

Commit

Permalink
aarch64: CD: upgrade to manylinux 2_28 and remove conda dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
snadampal committed Apr 9, 2024
1 parent ef4a28a commit ea47b0d
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 28 deletions.
67 changes: 41 additions & 26 deletions aarch64_linux/aarch64_ci_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,50 @@
set -eux -o pipefail

# This script is used to prepare the Docker container for aarch64_ci_wheel_build.py python script
# as we need to install conda and setup the python version for the build.

CONDA_PYTHON_EXE=/opt/conda/bin/python
CONDA_EXE=/opt/conda/bin/conda
CONDA_ENV_NAME=aarch64_env
PATH=/opt/conda/bin:$PATH
LD_LIBRARY_PATH=/opt/conda/envs/${CONDA_ENV_NAME}/lib/:/opt/conda/lib:$LD_LIBRARY_PATH

###############################################################################
# Install conda
# disable SSL_verify due to getting "Could not find a suitable TLS CA certificate bundle, invalid path"
# when using Python version, less than the conda latest
###############################################################################
echo 'Installing conda-forge'
curl -L -o /mambaforge.sh https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-aarch64.sh
chmod +x /mambaforge.sh
/mambaforge.sh -b -p /opt/conda
rm /mambaforge.sh
source /opt/conda/etc/profile.d/conda.sh
conda config --set ssl_verify False
conda create -y -c conda-forge -n "${CONDA_ENV_NAME}" python=${DESIRED_PYTHON}
conda activate "${CONDA_ENV_NAME}"
# as we need to setup the required python version and install few tools.

dnf update
dnf install -y epel-release
dnf install -y gcc openssl-devel bzip2-devel libffi-devel zlib-devel wget make

if [[ "$DESIRED_PYTHON" == "3.8" ]]; then
dnf install -y python38
elif [[ "$DESIRED_PYTHON" == "3.9" ]]; then
dnf install -y python39
elif [[ "$DESIRED_PYTHON" == "3.10" ]]; then
wget https://www.python.org/ftp/python/3.10.14/Python-3.10.14.tgz
tar xzf Python-3.10.14.tgz
cd Python-3.10.14
./configure --with-system-ffi --with-computed-gotos --enable-loadable-sqlite-extensions
make -j 8
make altinstall
cd ..
rm Python-3.10.14.tgz
elif [[ "$DESIRED_PYTHON" == "3.11" ]]; then
wget https://www.python.org/ftp/python/3.11.9/Python-3.11.9.tgz
tar xzf Python-3.11.9.tgz
cd Python-3.11.9
./configure --with-system-ffi --with-computed-gotos --enable-loadable-sqlite-extensions
make -j 8
make altinstall
cd ..
rm Python-3.11.9.tgz
else
echo "unsupported python version passed. use 3.8, 3.9, 3.10 or 3.11"
fi

/usr/local/bin/python$DESIRED_PYTHON -m venv appenv

source appenv/bin/activate

python3 --version

dnf install -y python3-devel python3-pip openblas-openmp

pip3 install dataclasses typing-extensions scons pyyaml pygit2 pyyaml ninja patchelf
pip3 install Cython
if [[ "$DESIRED_PYTHON" == "3.8" ]]; then
pip install -q numpy==1.24.4
else
pip install -q --pre numpy==2.0.0rc1
fi
conda install -y -c conda-forge pyyaml==6.0.1 patchelf==0.17.2 pygit2==1.13.2 openblas==0.3.25=*openmp* ninja==1.11.1 scons==4.5.2

python --version
conda --version
5 changes: 3 additions & 2 deletions aarch64_linux/aarch64_wheel_ci_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def build_ArmComputeLibrary() -> None:
os.makedirs(acl_install_dir)
check_call(["git", "clone", "https://github.com/ARM-software/ComputeLibrary.git", "-b", "v23.08",
"--depth", "1", "--shallow-submodules"])
check_call(["scons", "Werror=1", "-j8", f"build_dir=/{acl_install_dir}/build"] + acl_build_flags,
check_call(["scons", "Werror=0", "-j8", f"build_dir=/{acl_install_dir}/build"] + acl_build_flags,
cwd=acl_checkout_dir)
for d in ["arm_compute", "include", "utils", "support", "src"]:
shutil.copytree(f"{acl_checkout_dir}/{d}", f"{acl_install_dir}/{d}")
Expand Down Expand Up @@ -102,7 +102,8 @@ def parse_arguments():
"ACL_ROOT_DIR=/acl " \
"LD_LIBRARY_PATH=/pytorch/build/lib:/acl/build:$LD_LIBRARY_PATH " \
"ACL_INCLUDE_DIR=/acl/build " \
"ACL_LIBRARY=/acl/build "
"ACL_LIBRARY=/acl/build " \
"BUILD_TEST=0"
else:
print("build pytorch without mkldnn backend")

Expand Down

0 comments on commit ea47b0d

Please sign in to comment.