Skip to content

Commit 6021651

Browse files
authored
[aarch64] patch pytorch 2.1 for mkl-dnn fix (#1555)
1 parent d0fc085 commit 6021651

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

aarch64_linux/build_aarch64_wheel.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,9 @@ def start_build(host: RemoteHost, *,
554554
build_ArmComputeLibrary(host, git_clone_flags)
555555
print("build pytorch with mkldnn+acl backend")
556556
build_vars += " USE_MKLDNN=ON USE_MKLDNN_ACL=ON"
557-
host.run_cmd(f"cd pytorch && export ACL_ROOT_DIR=$HOME/ComputeLibrary && {build_vars} python3 setup.py bdist_wheel{build_opts}")
557+
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")
559+
host.run_cmd(f"cd $HOME/pytorch && export ACL_ROOT_DIR=$HOME/ComputeLibrary && {build_vars} python3 setup.py bdist_wheel{build_opts}")
558560
print('Repair the wheel')
559561
pytorch_wheel_name = host.list_dir("pytorch/dist")[0]
560562
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)