Skip to content

Commit b92da8c

Browse files
authored
[aarch64] ACL, OpenBLAS and mkldnn updates for PyTorch 2.2 (#1627)
Note# ~~This PR has a dependency on updating the oneDNN version to v3.3 (via ideep submodule to v3.3)~~ ideep submodule update is done, so, this PR can be merged anytime now. This PR is for: ACL - build with fixed format kernels OpenBLAS - upgrade the version to 0.3.25 numpy - upgrade version to 1.26.2 and mkldnn - cleanup the patches that are already upstreamed.
1 parent 6ce30be commit b92da8c

File tree

4 files changed

+7
-39
lines changed

4 files changed

+7
-39
lines changed

aarch64_linux/aarch64_ci_setup.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ conda activate "${CONDA_ENV_NAME}"
2828
if [[ "$DESIRED_PYTHON" == "3.8" ]]; then
2929
NUMPY_VERSION="1.24.4"
3030
else
31-
NUMPY_VERSION="1.26.0"
31+
NUMPY_VERSION="1.26.2"
3232
fi
33-
conda install -y -c conda-forge numpy==${NUMPY_VERSION} pyyaml==6.0.1 patchelf==0.17.2 pygit2==1.13.2 openblas==0.3.24 ninja==1.11.1 scons==4.5.2
33+
conda install -y -c conda-forge numpy==${NUMPY_VERSION} pyyaml==6.0.1 patchelf==0.17.2 pygit2==1.13.2 openblas==0.3.25 ninja==1.11.1 scons==4.5.2
3434

3535
python --version
3636
conda --version

aarch64_linux/aarch64_wheel_ci_build.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ def build_ArmComputeLibrary(git_clone_flags: str = "") -> None:
2020
'''
2121
print('Building Arm Compute Library')
2222
os.system("cd / && mkdir /acl")
23-
os.system(f"git clone https://github.com/ARM-software/ComputeLibrary.git -b v23.05.1 {git_clone_flags}")
23+
os.system(f"git clone https://github.com/ARM-software/ComputeLibrary.git -b v23.08 {git_clone_flags}")
2424
os.system("cd ComputeLibrary; export acl_install_dir=/acl; "
25-
"scons Werror=1 -j8 debug=0 neon=1 opencl=0 os=linux openmp=1 cppthreads=0 arch=armv8a multi_isa=1 build=native build_dir=$acl_install_dir/build; "
25+
"scons Werror=1 -j8 debug=0 neon=1 opencl=0 os=linux openmp=1 cppthreads=0 arch=armv8a multi_isa=1 fixed_format_kernels=1 build=native build_dir=$acl_install_dir/build; "
2626
"cp -r arm_compute $acl_install_dir; "
2727
"cp -r include $acl_install_dir; "
2828
"cp -r utils $acl_install_dir; "
@@ -106,8 +106,6 @@ def parse_arguments():
106106
print("build pytorch without mkldnn backend")
107107

108108
# work around to fix Raspberry pie crash
109-
print("Applying mkl-dnn patch to fix Raspberry pie crash")
110-
os.system("cd /pytorch/third_party/ideep/mkl-dnn && patch -p1 < /builder/mkldnn_fix/aarch64-fix-default-build-flags-to-armv8-a.patch")
111109
print("Applying mkl-dnn patch to fix readdir crash")
112110
os.system("cd /pytorch/third_party/ideep/mkl-dnn && patch -p1 < /builder/mkldnn_fix/aarch64-fix-readdir-crash.patch")
113111
os.system(f"cd /pytorch; {build_vars} python3 setup.py bdist_wheel")

aarch64_linux/build_aarch64_wheel.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -219,15 +219,15 @@ def install_condaforge_python(host: RemoteHost, python_version="3.8") -> None:
219219

220220
def build_OpenBLAS(host: RemoteHost, git_clone_flags: str = "") -> None:
221221
print('Building OpenBLAS')
222-
host.run_cmd(f"git clone https://github.com/xianyi/OpenBLAS -b v0.3.20 {git_clone_flags}")
222+
host.run_cmd(f"git clone https://github.com/xianyi/OpenBLAS -b v0.3.25 {git_clone_flags}")
223223
make_flags = "NUM_THREADS=64 USE_OPENMP=1 NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=ARMV8"
224224
host.run_cmd(f"pushd OpenBLAS && make {make_flags} -j8 && sudo make {make_flags} install && popd && rm -rf OpenBLAS")
225225

226226

227227
def build_ArmComputeLibrary(host: RemoteHost, git_clone_flags: str = "") -> None:
228228
print('Building Arm Compute Library')
229-
acl_build_flags="debug=0 neon=1 opencl=0 os=linux openmp=1 cppthreads=0 arch=armv8a multi_isa=1 build=native"
230-
host.run_cmd(f"git clone https://github.com/ARM-software/ComputeLibrary.git -b v23.05.1 {git_clone_flags}")
229+
acl_build_flags="debug=0 neon=1 opencl=0 os=linux openmp=1 cppthreads=0 arch=armv8a multi_isa=1 fixed_format_kernels=1 build=native"
230+
host.run_cmd(f"git clone https://github.com/ARM-software/ComputeLibrary.git -b v23.08 {git_clone_flags}")
231231
host.run_cmd(f"cd ComputeLibrary && scons Werror=1 -j8 {acl_build_flags}")
232232

233233

@@ -555,7 +555,6 @@ def start_build(host: RemoteHost, *,
555555
print("build pytorch with mkldnn+acl backend")
556556
build_vars += " USE_MKLDNN=ON USE_MKLDNN_ACL=ON"
557557
host.run_cmd(f"cd $HOME && git clone https://github.com/pytorch/builder.git")
558-
host.run_cmd(f"cd $HOME/pytorch/third_party/ideep/mkl-dnn && patch -p1 < $HOME/builder/mkldnn_fix/aarch64-fix-default-build-flags-to-armv8-a.patch")
559558
host.run_cmd(f"cd $HOME/pytorch && export ACL_ROOT_DIR=$HOME/ComputeLibrary && {build_vars} python3 setup.py bdist_wheel{build_opts}")
560559
print('Repair the wheel')
561560
pytorch_wheel_name = host.list_dir("pytorch/dist")[0]

mkldnn_fix/aarch64-fix-default-build-flags-to-armv8-a.patch

-29
This file was deleted.

0 commit comments

Comments
 (0)