Skip to content

Commit 93ca5e2

Browse files
committed
[aarch64] patch mkl-dnn to accelerate torch.compile()
1 parent b75ebbd commit 93ca5e2

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

aarch64_linux/aarch64_wheel_ci_build.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ def parse_arguments():
108108
# work around to fix Raspberry pie crash
109109
print("Applying mkl-dnn patch to fix readdir crash")
110110
os.system("cd /pytorch/third_party/ideep/mkl-dnn && patch -p1 < /builder/mkldnn_fix/aarch64-fix-readdir-crash.patch")
111+
# patch acl inner product to accelerate torch.compile() path
112+
print("Applying mkl-dnn patch to acl inner product")
113+
os.system("cd /pytorch/third_party/ideep/mkl-dnn && patch -p1 < /builder/mkldnn_fix/onednn-cpu-aarch64-remove-weight-format-checking.patch")
111114
os.system(f"cd /pytorch; {build_vars} python3 setup.py bdist_wheel")
112115
pytorch_wheel_name = complete_wheel("pytorch")
113116
print(f"Build Compelete. Created {pytorch_wheel_name}..")

aarch64_linux/build_aarch64_wheel.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,7 @@ def start_build(host: RemoteHost, *,
555555
print("build pytorch with mkldnn+acl backend")
556556
build_vars += " USE_MKLDNN=ON USE_MKLDNN_ACL=ON"
557557
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/onednn-cpu-aarch64-remove-weight-format-checking.patch")
558559
host.run_cmd(f"cd $HOME/pytorch && export ACL_ROOT_DIR=$HOME/ComputeLibrary && {build_vars} python3 setup.py bdist_wheel{build_opts}")
559560
print('Repair the wheel')
560561
pytorch_wheel_name = host.list_dir("pytorch/dist")[0]

0 commit comments

Comments
 (0)