Skip to content

Commit 3bc967b

Browse files
authored
workspace: bump xla to version 20250204.0-6789523 (#17)
1 parent b6da124 commit 3bc967b

12 files changed

+198
-10
lines changed

.github/workflows/build.yaml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ permissions:
1919
contents: write
2020

2121
env:
22-
XLA_COMMIT: ${{ inputs.xla_commit || 'cc075beb6148c2777da2b6749c63830856ee6c2a' }}
22+
XLA_COMMIT: ${{ inputs.xla_commit || '6789523d0a42c2cf83309a263f417122c4c63811' }}
2323

2424
jobs:
2525
setup_openxla:
@@ -56,6 +56,7 @@ jobs:
5656
pjrt-artifacts:
5757
runs-on: ${{ matrix.pjrt.runs_on }}
5858
strategy:
59+
fail-fast: false
5960
matrix:
6061
pjrt:
6162
- target: cuda
@@ -83,7 +84,7 @@ jobs:
8384
config: "--config=release_macos_base"
8485
artifact: bazel-bin/xla/pjrt/c/libpjrt_c_api_cpu_plugin.dylib
8586
renamed_artifact: libpjrt_cpu.dylib
86-
runs_on: ["macos-14"]
87+
runs_on: ["self-hosted", "macOS"]
8788
platform: darwin-amd64
8889
bazel_target: //xla/pjrt/c:pjrt_c_api_cpu_plugin
8990
- target: cpu
@@ -159,15 +160,9 @@ jobs:
159160
working-directory: ./xla
160161
run: |
161162
~/bin/bazel \
163+
--output_base=/tmp/bazel_output_base_${{ matrix.pjrt.platform }} \
162164
build \
163-
--bes_results_url=https://app.buildbuddy.io/invocation/ \
164-
--bes_backend=grpcs://remote.buildbuddy.io \
165-
--remote_cache=grpcs://remote.buildbuddy.io \
166-
--experimental_remote_build_event_upload=minimal \
167-
--nolegacy_important_outputs \
168-
--remote_download_toplevel \
169-
--remote_timeout=3600 \
170-
--remote_header=x-buildbuddy-api-key=${{ secrets.BUILDBUDDY_ORG_API_KEY }} \
165+
--spawn_strategy=processwrapper-sandbox \
171166
${{ matrix.pjrt.config }} \
172167
${{ matrix.pjrt.bazel_target }}
173168

openxla/bazelrc/common.bazelrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ build --repo_env=HERMETIC_PYTHON_VERSION=3.11
77

88
test --test_env LD_LIBRARY_PATH
99
test --test_size_filters small,medium
10+

openxla/bazelrc/cpu.bazelrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
common --enable_platform_specific_config
2+
build --incompatible_strict_action_env
3+
build --incompatible_enable_cc_toolchain_resolution
4+
build:linux --strip=always
5+
build:linux --repo_env BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
6+
build:linux --sandbox_add_mount_pair=/tmp

openxla/patches/20240318-001-PJRT-C-API-Ensure-C-compliance-for-Profiler-Extension.patch

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ From: Steeve Morin <steeve.morin@gmail.com>
33
Date: Mon, 18 Mar 2024 17:17:34 +0100
44
Subject: [PATCH] [PJRT C API] Ensure C compliance for Profiler Extension
55

6+
PR: https://github.com/openxla/xla/pull/22082
67
---
78
xla/pjrt/c/pjrt_c_api_profiler_extension.h | 2 ++
89
1 file changed, 2 insertions(+)
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
From c79f202be6fde802b4e5d697a5925d7eccea3d25 Mon Sep 17 00:00:00 2001
2+
From: Hugo Mano <hugo@zml.ai>
3+
Date: Wed, 5 Feb 2025 19:25:03 +0100
4+
Subject: [PATCH] Added FFI handler registration API to the FFI PjRt
5+
6+
PR: https://github.com/openxla/xla/pull/13420
7+
---
8+
xla/pjrt/c/BUILD | 5 ++++
9+
xla/pjrt/c/pjrt_c_api_ffi_extension.h | 16 ++++++++++++
10+
xla/pjrt/c/pjrt_c_api_ffi_internal.cc | 35 +++++++++++++++++++++++++--
11+
3 files changed, 54 insertions(+), 2 deletions(-)
12+
13+
diff --git a/xla/pjrt/c/BUILD b/xla/pjrt/c/BUILD
14+
index ad1b3987fe..0598281ad1 100644
15+
--- a/xla/pjrt/c/BUILD
16+
+++ b/xla/pjrt/c/BUILD
17+
@@ -69,7 +69,12 @@ cc_library(
18+
":pjrt_c_api_wrapper_impl",
19+
"//xla/ffi:execution_context",
20+
"//xla/ffi:type_id_registry",
21+
+ "//xla/ffi:ffi_api",
22+
+ "//xla/ffi/api:c_api",
23+
+ "//xla/ffi/api:ffi",
24+
+ "//xla/service:custom_call_target_registry",
25+
"@com_google_absl//absl/status",
26+
+ "@com_google_absl//absl/strings:str_format",
27+
],
28+
)
29+
30+
diff --git a/xla/pjrt/c/pjrt_c_api_ffi_extension.h b/xla/pjrt/c/pjrt_c_api_ffi_extension.h
31+
index c5766f2a19..3d74e7cbf3 100644
32+
--- a/xla/pjrt/c/pjrt_c_api_ffi_extension.h
33+
+++ b/xla/pjrt/c/pjrt_c_api_ffi_extension.h
34+
@@ -67,12 +67,28 @@ PJRT_DEFINE_STRUCT_TRAITS(PJRT_FFI_UserData_Add_Args, user_data);
35+
// Adds a user data to the execute context.
36+
typedef PJRT_Error* PJRT_FFI_UserData_Add(PJRT_FFI_UserData_Add_Args* args);
37+
38+
+struct PJRT_FFI_Register_Handler_Args {
39+
+ size_t struct_size;
40+
+ const char* target_name;
41+
+ size_t target_name_size;
42+
+ int api_version; // 0 for an untyped call, 1 -- for typed
43+
+ void* handler;
44+
+ const char* platform_name;
45+
+ size_t platform_name_size;
46+
+};
47+
+PJRT_DEFINE_STRUCT_TRAITS(PJRT_FFI_Register_Handler_Args, handler);
48+
+
49+
+// Registers an FFI call handler for a specific platform.
50+
+typedef PJRT_Error* PJRT_FFI_Register_Handler(
51+
+ PJRT_FFI_Register_Handler_Args* args);
52+
+
53+
typedef struct PJRT_FFI_Extension {
54+
size_t struct_size;
55+
PJRT_Extension_Type type;
56+
PJRT_Extension_Base* next;
57+
PJRT_FFI_TypeID_Register* type_id_register;
58+
PJRT_FFI_UserData_Add* user_data_add;
59+
+ PJRT_FFI_Register_Handler* register_handler;
60+
} PJRT_FFI;
61+
PJRT_DEFINE_STRUCT_TRAITS(PJRT_FFI_Extension, user_data_add);
62+
63+
diff --git a/xla/pjrt/c/pjrt_c_api_ffi_internal.cc b/xla/pjrt/c/pjrt_c_api_ffi_internal.cc
64+
index 0375b39d0b..3527a0756e 100644
65+
--- a/xla/pjrt/c/pjrt_c_api_ffi_internal.cc
66+
+++ b/xla/pjrt/c/pjrt_c_api_ffi_internal.cc
67+
@@ -13,15 +13,20 @@ See the License for the specific language governing permissions and
68+
limitations under the License.
69+
==============================================================================*/
70+
71+
-#include "xla/pjrt/c/pjrt_c_api_ffi_internal.h"
72+
+#include <string>
73+
74+
#include "absl/status/status.h"
75+
+#include "absl/strings/str_format.h"
76+
+#include "xla/ffi/api/c_api.h"
77+
+#include "xla/ffi/api/ffi.h"
78+
#include "xla/ffi/execution_context.h"
79+
-#include "xla/ffi/type_id_registry.h"
80+
+ #include "xla/ffi/type_id_registry.h"
81+
+#include "xla/ffi/ffi_api.h"
82+
#include "xla/pjrt/c/pjrt_c_api.h"
83+
#include "xla/pjrt/c/pjrt_c_api_ffi_extension.h"
84+
#include "xla/pjrt/c/pjrt_c_api_helpers.h"
85+
#include "xla/pjrt/c/pjrt_c_api_wrapper_impl.h"
86+
+#include "xla/service/custom_call_target_registry.h"
87+
88+
namespace pjrt {
89+
90+
@@ -55,6 +60,31 @@ static PJRT_Error* PJRT_FFI_UserData_Add(PJRT_FFI_UserData_Add_Args* args) {
91+
return nullptr;
92+
}
93+
94+
+static PJRT_Error* PJRT_FFI_Register_Handler(
95+
+ PJRT_FFI_Register_Handler_Args* args) {
96+
+ PJRT_RETURN_IF_ERROR(ActualStructSizeIsGreaterOrEqual(
97+
+ "PJRT_FFI_Register_Handler_Args",
98+
+ PJRT_FFI_Register_Handler_Args_STRUCT_SIZE, args->struct_size));
99+
+ std::string target_name(args->target_name, args->target_name_size);
100+
+ std::string platform_name(args->platform_name, args->platform_name_size);
101+
+ switch (args->api_version) {
102+
+ case 0:
103+
+ xla::CustomCallTargetRegistry::Global()->Register(
104+
+ target_name, args->handler, platform_name);
105+
+ return nullptr;
106+
+ case 1:
107+
+ xla::ffi::Ffi::RegisterStaticHandler(
108+
+ xla::ffi::GetXlaFfiApi(), target_name, platform_name,
109+
+ reinterpret_cast<XLA_FFI_Handler*>(args->handler));
110+
+ return nullptr;
111+
+ default:
112+
+ return new PJRT_Error{absl::UnimplementedError(
113+
+ absl::StrFormat("API version %d not supported for PJRT GPU plugin. "
114+
+ "Supported versions are 0 and 1.",
115+
+ args->api_version))};
116+
+ }
117+
+}
118+
+
119+
PJRT_FFI_Extension CreateFfiExtension(PJRT_Extension_Base* next) {
120+
return {
121+
/*struct_size=*/PJRT_FFI_Extension_STRUCT_SIZE,
122+
@@ -62,6 +92,7 @@ PJRT_FFI_Extension CreateFfiExtension(PJRT_Extension_Base* next) {
123+
/*next=*/next,
124+
/*type_id_register=*/PJRT_FFI_TypeID_Register,
125+
/*user_data_add=*/PJRT_FFI_UserData_Add,
126+
+ /*register_handler=*/PJRT_FFI_Register_Handler,
127+
};
128+
}
129+
130+
--
131+
2.39.5 (Apple Git-154)

openxla/patches/20240901-001-Do-not-force-DEVELOPER_DIR-on-macOS.patch

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ Subject: [PATCH] Do not force DEVELOPER_DIR on macOS
55

66
It's is autodetected by Bazel and supports building using
77
only the Apple Command Line Tools.
8+
9+
PR: https://github.com/openxla/xla/pull/16696
810
---
911
tensorflow.bazelrc | 1 -
1012
third_party/tsl/.bazelrc | 1 -

openxla/patches/20240901-002-Set-the-macosx-deployment-target-via-the-bazel-command-line.patch

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Date: Sun, 1 Sep 2024 14:53:15 +0200
44
Subject: [PATCH] Set the macosx deployment target via the bazel command line
55

66
Instead of via an action env.
7+
8+
PR: https://github.com/openxla/xla/pull/16696
79
---
810
tensorflow.bazelrc | 4 ++--
911
third_party/tsl/.bazelrc | 4 ++--

openxla/patches/20240901-003-Only-export-GetPjrtApi-symbol-on-macOS.patch

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ Subject: [PATCH] [PjRt] Only export GetPjrtApi symbol on macOS
55

66
Also add missing macOS linkops, remove the .so suffix to the plugin targets
77
and add additional_linker_inputs for the linker script instead of deps.
8+
9+
PR: https://github.com/openxla/xla/pull/16696
810
---
911
xla/pjrt/c/BUILD | 18 ++++++++++--------
1012
1 file changed, 10 insertions(+), 8 deletions(-)

openxla/patches/20250120-001-Enable-nvptxcompiler-with-nvjitlink.patch

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Date: Tue, 21 Jan 2025 14:41:42 +0100
44
Subject: [PATCH] Expose nvptxcompiler to link against in XLA if
55
enable_libnvptxcompiler_support is set
66

7+
Only for ZML, no PR on XLA side.
78
---
89
.../gpus/cuda/hermetic/cuda_nvcc.BUILD.tpl | 8 ++++++++
910
xla/stream_executor/cuda/BUILD | 12 +++++++++++-

openxla/patches/20250128-001-PJRT-Expose-should_stage_host_to_device_transfers.patch

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Subject: [PATCH] [PJRT] Expose should_stage_host_to_device_transfers as
66

77
Expose GPU option `should_stage_host_to_device_transfers `
88
as configuration in PJRT client create func.
9+
10+
PR: https://github.com/openxla/xla/pull/21965
911
---
1012
xla/pjrt/c/pjrt_c_api_gpu_internal.cc | 7 +++++++
1113
1 file changed, 7 insertions(+)

0 commit comments

Comments
 (0)