From 803b81bcefc68eabf6e9cfdfdcd98ba669e6ba9d Mon Sep 17 00:00:00 2001 From: Xiongfei Wei Date: Fri, 21 Jul 2023 18:57:44 +0000 Subject: [PATCH] disable cxx abi --- infra/ansible/config/env.yaml | 1 + .../ansible/roles/build_srcs/tasks/main.yaml | 2 +- .../ansible/roles/fetch_srcs/tasks/main.yaml | 19 +++++++++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/infra/ansible/config/env.yaml b/infra/ansible/config/env.yaml index 3a25c298ae34..a97f1bf0bd8d 100644 --- a/infra/ansible/config/env.yaml +++ b/infra/ansible/config/env.yaml @@ -32,6 +32,7 @@ build_env: XLA_SANDBOX_BUILD: 1 BAZEL_REMOTE_CACHE: 1 SILO_NAME: "cache-silo-{{ arch }}-{{ accelerator }}" + _GLIBCXX_USE_CXX11_ABI: 0 amd64: ARCH: amd64 diff --git a/infra/ansible/roles/build_srcs/tasks/main.yaml b/infra/ansible/roles/build_srcs/tasks/main.yaml index 09e221705ba5..2cd7cff6f1ca 100644 --- a/infra/ansible/roles/build_srcs/tasks/main.yaml +++ b/infra/ansible/roles/build_srcs/tasks/main.yaml @@ -24,7 +24,7 @@ - name: Build XLA computation client library ansible.builtin.command: - cmd: bash build_torch_xla_libs.sh -O -D_GLIBCXX_USE_CXX11_ABI=1 + cmd: bash build_torch_xla_libs.sh chdir: "{{ (src_root, 'pytorch/xla') | path_join }}" environment: "{{ env_vars }}" when: build_torch_xla_libs_result.stat.exists diff --git a/infra/ansible/roles/fetch_srcs/tasks/main.yaml b/infra/ansible/roles/fetch_srcs/tasks/main.yaml index 75f6b1233901..4ec96c6552f3 100644 --- a/infra/ansible/roles/fetch_srcs/tasks/main.yaml +++ b/infra/ansible/roles/fetch_srcs/tasks/main.yaml @@ -20,6 +20,25 @@ dest: "{{ (src_root, 'pytorch/xla') | path_join }}" version: "{{ xla_git_rev }}" +- name: Find *.diff files in pytorch/xla/torch_patches + ansible.builtin.find: + path: "{{ (src_root, 'pytorch/xla/torch_patches') | path_join }}" + pattern: "*.diff" + register: torch_patches + +- name: Apply patches to PyTorch + ansible.posix.patch: + src: "{{ item }}" + # Use source file on the target machine instead of the one where + # the playbook is located. Has no effect when the target machine is + # localhost. + remote_src: true + strip: 1 + ignore_whitespace: true + basedir: "{{ (src_root, 'pytorch/') | path_join }}" + loop: "{{ torch_patches.files | map(attribute='path') }}" + ignore_errors: true + - name: Find *.diff files in pytorch/xla/tf_patches ansible.builtin.find: path: "{{ (src_root, 'pytorch/xla/tf_patches') | path_join }}"