Skip to content

Commit 56d9d17

Browse files
author
Mike Schneider
authored
[aarch64][build] Aarch64 lapack fix and ARMCL version update (#1462)
* Fix lapack missing and armcl update * update ARMCL version
1 parent e67e209 commit 56d9d17

File tree

2 files changed

+7
-16
lines changed

2 files changed

+7
-16
lines changed

aarch64_linux/aarch64_ci_build.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ set -eux -o pipefail
77
CONDA_PYTHON_EXE=/opt/conda/bin/python
88
CONDA_EXE=/opt/conda/bin/conda
99
PATH=/opt/conda/bin:$PATH
10+
LD_LIBRARY_PATH=/opt/conda/lib:$LD_LIBRARY_PATH
1011

1112
###############################################################################
1213
# Install OS dependent packages
@@ -25,7 +26,7 @@ chmod +x /mambaforge.sh
2526
/mambaforge.sh -b -p /opt/conda
2627
rm /mambaforge.sh
2728
/opt/conda/bin/conda config --set ssl_verify False
28-
/opt/conda/bin/conda install -y -c conda-forge python=${DESIRED_PYTHON} numpy pyyaml setuptools patchelf pygit2
29+
/opt/conda/bin/conda install -y -c conda-forge python=${DESIRED_PYTHON} numpy pyyaml setuptools patchelf pygit2 openblas
2930
python --version
3031
conda --version
3132

aarch64_linux/aarch64_wheel_ci_build.py

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,16 @@ def list_dir(path: str) -> List[str]:
1313
return subprocess.check_output(["ls", "-1", path]).decode().split("\n")
1414

1515

16-
'''
17-
Using OpenBLAS with PyTorch
18-
'''
19-
def build_OpenBLAS(git_clone_flags: str = "") -> None:
20-
print('Building OpenBLAS')
21-
os.system(f"cd /; git clone https://github.com/xianyi/OpenBLAS -b v0.3.21 {git_clone_flags}")
22-
make_flags = "NUM_THREADS=64 USE_OPENMP=1 NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=ARMV8 "
23-
os.system(f"cd OpenBLAS; make {make_flags} -j8; make {make_flags} install; cd /; rm -rf OpenBLAS")
24-
25-
2616
'''
2717
Using ArmComputeLibrary for aarch64 PyTorch
2818
'''
2919
def build_ArmComputeLibrary(git_clone_flags: str = "") -> None:
3020
print('Building Arm Compute Library')
3121
os.system("cd / && mkdir /acl")
32-
os.system(f"git clone https://github.com/ARM-software/ComputeLibrary.git -b v22.11 {git_clone_flags}")
22+
os.system(f"git clone https://github.com/ARM-software/ComputeLibrary.git -b v23.05.1 {git_clone_flags}")
23+
os.system('sed -i -e \'s/"armv8.2-a"/"armv8-a"/g\' ComputeLibrary/SConscript; '
24+
'sed -i -e \'s/-march=armv8.2-a+fp16/-march=armv8-a/g\' ComputeLibrary/SConstruct; '
25+
'sed -i -e \'s/"-march=armv8.2-a"/"-march=armv8-a"/g\' ComputeLibrary/filedefs.json')
3326
os.system(f"cd ComputeLibrary; export acl_install_dir=/acl; " \
3427
f"scons Werror=1 -j8 debug=0 neon=1 opencl=0 os=linux openmp=1 cppthreads=0 arch=armv8.2-a multi_isa=1 build=native build_dir=$acl_install_dir/build; " \
3528
f"cp -r arm_compute $acl_install_dir; " \
@@ -89,9 +82,6 @@ def parse_arguments():
8982
git_clone_flags = " --depth 1 --shallow-submodules"
9083
os.system(f"conda install -y ninja scons")
9184

92-
print("Build and Install OpenBLAS")
93-
build_OpenBLAS(git_clone_flags)
94-
9585
print('Building PyTorch wheel')
9686
build_vars = "CMAKE_SHARED_LINKER_FLAGS=-Wl,-z,max-page-size=0x10000 "
9787
os.system(f"python setup.py clean")
@@ -107,7 +97,7 @@ def parse_arguments():
10797
print("build pytorch with mkldnn+acl backend")
10898
build_vars += "USE_MKLDNN=ON USE_MKLDNN_ACL=ON " \
10999
"ACL_ROOT_DIR=/acl " \
110-
"LD_LIBRARY_PATH=/pytorch/build/lib:/acl/build " \
100+
"LD_LIBRARY_PATH=/pytorch/build/lib:/acl/build:$LD_LIBRARY_PATH " \
111101
"ACL_INCLUDE_DIR=/acl/build " \
112102
"ACL_LIBRARY=/acl/build "
113103
else:

0 commit comments

Comments
 (0)