Skip to content

Commit aa40417

Browse files
authored
[aarch64] acl build script updates for multi isa build with armv8-a base architecture (#1370)
1 parent 3df3313 commit aa40417

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

aarch64_linux/build_aarch64_wheel.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -226,11 +226,12 @@ def build_OpenBLAS(host: RemoteHost, git_clone_flags: str = "") -> None:
226226

227227
def build_ArmComputeLibrary(host: RemoteHost, git_clone_flags: str = "") -> None:
228228
print('Building Arm Compute Library')
229-
acl_install_dir="${HOME}/acl"
230-
acl_build_flags="debug=0 neon=1 opencl=0 os=linux openmp=1 cppthreads=0 arch=armv8.2-a multi_isa=1 build=native"
231-
host.run_cmd(f"mkdir {acl_install_dir}")
229+
acl_build_flags="debug=0 neon=1 opencl=0 os=linux openmp=1 cppthreads=0 arch=armv8a multi_isa=1 build=native"
232230
host.run_cmd(f"git clone https://github.com/ARM-software/ComputeLibrary.git -b v22.11 {git_clone_flags}")
233-
host.run_cmd(f"cd ComputeLibrary && scons Werror=1 -j8 {acl_build_flags} build_dir={acl_install_dir}/build")
231+
host.run_cmd(['sed -i -e \'s/"armv8.2-a"/"armv8-a"/g\' ComputeLibrary/SConscript'])
232+
host.run_cmd(['sed -i -e \'s/-march=armv8.2-a+fp16/-march=armv8-a/g\' ComputeLibrary/SConstruct'])
233+
host.run_cmd(['sed -i -e \'s/"-march=armv8.2-a"/"-march=armv8-a"/g\' ComputeLibrary/filedefs.json'])
234+
host.run_cmd(f"cd ComputeLibrary && scons Werror=1 -j8 {acl_build_flags}")
234235

235236

236237
def embed_libgomp(host: RemoteHost, use_conda, wheel_name) -> None:
@@ -549,7 +550,7 @@ def start_build(host: RemoteHost, *,
549550
build_ArmComputeLibrary(host, git_clone_flags)
550551
print("build pytorch with mkldnn+acl backend")
551552
build_vars += " USE_MKLDNN=ON USE_MKLDNN_ACL=ON"
552-
host.run_cmd(f"cd pytorch && export ACL_ROOT_DIR=$HOME/ComputeLibrary:$HOME/acl && {build_vars} python3 setup.py bdist_wheel{build_opts}")
553+
host.run_cmd(f"cd pytorch && export ACL_ROOT_DIR=$HOME/ComputeLibrary && {build_vars} python3 setup.py bdist_wheel{build_opts}")
553554
print('Repair the wheel')
554555
pytorch_wheel_name = host.list_dir("pytorch/dist")[0]
555556
host.run_cmd(f"export LD_LIBRARY_PATH=$HOME/acl/build:$HOME/pytorch/build/lib && auditwheel repair $HOME/pytorch/dist/{pytorch_wheel_name}")

0 commit comments

Comments
 (0)