Skip to content

Commit 583cb7f

Browse files
committed
[aarch64] update acl build script to build for armv8a+multi_isa
1 parent e03990a commit 583cb7f

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
@@ -230,11 +230,12 @@ def build_OpenBLAS(host: RemoteHost, git_clone_flags: str = "") -> None:
230230

231231
def build_ArmComputeLibrary(host: RemoteHost, git_clone_flags: str = "") -> None:
232232
print('Building Arm Compute Library')
233-
acl_install_dir="${HOME}/acl"
234-
acl_build_flags="debug=0 neon=1 opencl=0 os=linux openmp=1 cppthreads=0 arch=armv8.2-a multi_isa=1 build=native"
235-
host.run_cmd(f"mkdir {acl_install_dir}")
233+
acl_build_flags="debug=0 neon=1 opencl=0 os=linux openmp=1 cppthreads=0 arch=armv8a multi_isa=1 build=native"
236234
host.run_cmd(f"git clone https://github.com/ARM-software/ComputeLibrary.git -b v22.11 {git_clone_flags}")
237-
host.run_cmd(f"cd ComputeLibrary && scons Werror=1 -j8 {acl_build_flags} build_dir={acl_install_dir}/build")
235+
# Apply scons patch to allow multi_isa build with armv8-a base architecture
236+
host.run_cmd(f"git clone https://github.com/pytorch/builder.git")
237+
host.run_cmd(f"pushd ComputeLibrary && patch -p1 < $HOME/builder/aarch64_linux/patches/scons-mutli-isa-build-with-armv8-a-baseline.patch && popd")
238+
host.run_cmd(f"cd ComputeLibrary && scons Werror=1 -j8 {acl_build_flags}")
238239

239240

240241
def embed_libgomp(host: RemoteHost, use_conda, wheel_name) -> None:
@@ -553,7 +554,7 @@ def start_build(host: RemoteHost, *,
553554
build_ArmComputeLibrary(host, git_clone_flags)
554555
print("build pytorch with mkldnn+acl backend")
555556
build_vars += " USE_MKLDNN=ON USE_MKLDNN_ACL=ON"
556-
host.run_cmd(f"cd pytorch && export ACL_ROOT_DIR=$HOME/ComputeLibrary:$HOME/acl && {build_vars} python3 setup.py bdist_wheel{build_opts}")
557+
host.run_cmd(f"cd pytorch && export ACL_ROOT_DIR=$HOME/ComputeLibrary && {build_vars} python3 setup.py bdist_wheel{build_opts}")
557558
print('Repair the wheel')
558559
pytorch_wheel_name = host.list_dir("pytorch/dist")[0]
559560
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)