@@ -230,11 +230,12 @@ def build_OpenBLAS(host: RemoteHost, git_clone_flags: str = "") -> None:
230
230
231
231
def build_ArmComputeLibrary (host : RemoteHost , git_clone_flags : str = "" ) -> None :
232
232
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"
236
234
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 } " )
238
239
239
240
240
241
def embed_libgomp (host : RemoteHost , use_conda , wheel_name ) -> None :
@@ -553,7 +554,7 @@ def start_build(host: RemoteHost, *,
553
554
build_ArmComputeLibrary (host , git_clone_flags )
554
555
print ("build pytorch with mkldnn+acl backend" )
555
556
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 } " )
557
558
print ('Repair the wheel' )
558
559
pytorch_wheel_name = host .list_dir ("pytorch/dist" )[0 ]
559
560
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