Skip to content

Commit 0050cf1

Browse files
authored
xla: bump to 22ea002 (#37)
1 parent 0987027 commit 0050cf1

9 files changed

+155
-148
lines changed

.github/workflows/build.yaml

Lines changed: 1 addition & 1 deletion
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 || '6e48cbb8d33d771c964697e39bfaf678bcc6de31' }}
22+
XLA_COMMIT: ${{ inputs.xla_commit || '22ea002baf40702b90a0b431485d07b63e3fe2fa' }}
2323

2424
jobs:
2525
setup_openxla:

openxla/bazelrc/cuda.bazelrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ build --action_env CLANG_CUDA_COMPILER_PATH=/usr/lib/llvm-18/bin/clang
1010
build:cuda --repo_env HERMETIC_CUDA_COMPUTE_CAPABILITIES="5.0,5.2,5.3,6.0,6.1,6.2,7.0,7.2,7.5,8.0,8.6,8.7,8.9,9.0,10.0,10.1,12.0"
1111
build:cuda --repo_env=HERMETIC_CUDA_VERSION="12.8.0"
1212
build:cuda --repo_env=HERMETIC_CUDNN_VERSION="9.8.0"
13+
build:cuda --repo_env=HERMETIC_NVSHMEM_VERSION="3.2.5"
1314
build:cuda --@//xla/stream_executor/cuda:enable_libnvjitlink_support=True
1415
build:cuda --@//xla/stream_executor/cuda:enable_libnvptxcompiler_support=True
1516

openxla/patches/0001-Added-FFI-handler-registration-API-to-the-FFI-PjRt.patch

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
From a33cf614d0e351a9123c0bc4435f53231675f5a0 Mon Sep 17 00:00:00 2001
1+
From 50621f9cde6abe56bd3a63d1d3acf6513657ff4a Mon Sep 17 00:00:00 2001
22
From: Hugo Mano <hugo@zml.ai>
33
Date: Tue, 27 May 2025 11:48:17 +0200
4-
Subject: [PATCH 1/6] Added FFI handler registration API to the FFI PjRt
4+
Subject: [PATCH 1/7] Added FFI handler registration API to the FFI PjRt
55

66
PR: https://github.com/openxla/xla/pull/13420
77
---
88
xla/pjrt/c/BUILD | 5 +++++
9-
xla/pjrt/c/pjrt_c_api_ffi_extension.h | 21 ++++++++++++++++++
9+
xla/pjrt/c/pjrt_c_api_ffi_extension.h | 23 ++++++++++++++++++-
1010
xla/pjrt/c/pjrt_c_api_ffi_internal.cc | 32 ++++++++++++++++++++++++++-
11-
3 files changed, 57 insertions(+), 1 deletion(-)
11+
3 files changed, 58 insertions(+), 2 deletions(-)
1212

1313
diff --git a/xla/pjrt/c/BUILD b/xla/pjrt/c/BUILD
14-
index 054d966f47..7b78ca8241 100644
14+
index f60f939edb..3943d172aa 100644
1515
--- a/xla/pjrt/c/BUILD
1616
+++ b/xla/pjrt/c/BUILD
1717
@@ -69,8 +69,13 @@ cc_library(
@@ -29,10 +29,10 @@ index 054d966f47..7b78ca8241 100644
2929
)
3030

3131
diff --git a/xla/pjrt/c/pjrt_c_api_ffi_extension.h b/xla/pjrt/c/pjrt_c_api_ffi_extension.h
32-
index 995a2c7e50..b8f10bc2f7 100644
32+
index 995a2c7e50..7c83ca9fbc 100644
3333
--- a/xla/pjrt/c/pjrt_c_api_ffi_extension.h
3434
+++ b/xla/pjrt/c/pjrt_c_api_ffi_extension.h
35-
@@ -69,10 +69,31 @@ PJRT_DEFINE_STRUCT_TRAITS(PJRT_FFI_UserData_Add_Args, user_data);
35+
@@ -69,12 +69,33 @@ PJRT_DEFINE_STRUCT_TRAITS(PJRT_FFI_UserData_Add_Args, user_data);
3636
// Adds a user data to the execute context.
3737
typedef PJRT_Error* PJRT_FFI_UserData_Add(PJRT_FFI_UserData_Add_Args* args);
3838

@@ -62,8 +62,11 @@ index 995a2c7e50..b8f10bc2f7 100644
6262
PJRT_FFI_UserData_Add* user_data_add;
6363
+ PJRT_FFI_Register_Handler* register_handler;
6464
} PJRT_FFI;
65-
PJRT_DEFINE_STRUCT_TRAITS(PJRT_FFI_Extension, user_data_add);
65+
-PJRT_DEFINE_STRUCT_TRAITS(PJRT_FFI_Extension, user_data_add);
66+
+PJRT_DEFINE_STRUCT_TRAITS(PJRT_FFI_Extension, register_handler);
6667

68+
#ifdef __cplusplus
69+
}
6770
diff --git a/xla/pjrt/c/pjrt_c_api_ffi_internal.cc b/xla/pjrt/c/pjrt_c_api_ffi_internal.cc
6871
index 5fa88eab33..63ad65bc69 100644
6972
--- a/xla/pjrt/c/pjrt_c_api_ffi_internal.cc

openxla/patches/0002-Drop-the-.so-suffix-for-PjRt-plugin-targets-.dylib-o.patch

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
From 6479728ad9b2534776d4224c6d58fcc6b2a667ee Mon Sep 17 00:00:00 2001
1+
From 9494c46866ff2d00e6208aabf9316b3ea4544ceb Mon Sep 17 00:00:00 2001
22
From: Hugo Mano <hugo@zml.ai>
33
Date: Tue, 27 May 2025 11:49:51 +0200
4-
Subject: [PATCH 2/6] Drop the .so suffix for PjRt plugin targets (.dylib on
4+
Subject: [PATCH 2/7] Drop the .so suffix for PjRt plugin targets (.dylib on
55
macOS)
66

77
PR: https://github.com/openxla/xla/pull/16696
88
---
9-
xla/pjrt/c/BUILD | 5 +++--
10-
1 file changed, 3 insertions(+), 2 deletions(-)
9+
xla/pjrt/c/BUILD | 4 ++--
10+
1 file changed, 2 insertions(+), 2 deletions(-)
1111

1212
diff --git a/xla/pjrt/c/BUILD b/xla/pjrt/c/BUILD
13-
index 7b78ca8241..207e991972 100644
13+
index 3943d172aa..3047c382d4 100644
1414
--- a/xla/pjrt/c/BUILD
1515
+++ b/xla/pjrt/c/BUILD
16-
@@ -332,13 +332,14 @@ cc_library(
16+
@@ -359,7 +359,7 @@ cc_library(
1717

1818
# PJRT CPU plugin.
1919
xla_cc_binary(
@@ -22,14 +22,7 @@ index 7b78ca8241..207e991972 100644
2222
additional_linker_inputs = [
2323
":pjrt_c_api_cpu_version_script.lds",
2424
],
25-
linkopts = if_macos(
26-
[
27-
"-Wl,-exported_symbol,_GetPjrtApi",
28-
+ "-Wl,-install_name,@rpath/pjrt_c_api_cpu_plugin.dylib",
29-
"-Wl,-undefined,error",
30-
],
31-
[
32-
@@ -425,7 +426,7 @@ cc_library(
25+
@@ -453,7 +453,7 @@ cc_library(
3326

3427
# PJRT GPU plugin. Can be configured to be built for CUDA or ROCM.
3528
xla_cc_binary(

openxla/patches/0003-Expose-nvptxcompiler-to-link-against-in-XLA-if-enabl.patch

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,58 @@
1-
From 08f8bb1431e1536b07118e0fe85826d7958b56a7 Mon Sep 17 00:00:00 2001
1+
From ff930c6b192a4c72aec42fe9fe1c2d51661db95b Mon Sep 17 00:00:00 2001
22
From: Hugo Mano <hugo@zml.ai>
33
Date: Tue, 27 May 2025 11:50:40 +0200
4-
Subject: [PATCH 3/6] Expose nvptxcompiler to link against in XLA if
4+
Subject: [PATCH 3/7] Expose nvptxcompiler to link against in XLA if
55
enable_libnvptxcompiler_support is set
66

77
Only for ZML, no PR on XLA side.
88
---
9-
third_party/gpus/cuda/hermetic/cuda_nvcc.BUILD.tpl | 8 ++++++++
10-
xla/stream_executor/cuda/BUILD | 12 +++++++++++-
11-
2 files changed, 19 insertions(+), 1 deletion(-)
9+
third_party/gpus/cuda/hermetic/BUILD.tpl | 1 +
10+
workspace0.bzl | 6 +++---
11+
xla/stream_executor/cuda/BUILD | 7 ++++++-
12+
3 files changed, 10 insertions(+), 4 deletions(-)
1213

13-
diff --git a/third_party/gpus/cuda/hermetic/cuda_nvcc.BUILD.tpl b/third_party/gpus/cuda/hermetic/cuda_nvcc.BUILD.tpl
14-
index 733d95d371..f6c1c5ab53 100644
15-
--- a/third_party/gpus/cuda/hermetic/cuda_nvcc.BUILD.tpl
16-
+++ b/third_party/gpus/cuda/hermetic/cuda_nvcc.BUILD.tpl
17-
@@ -52,6 +52,14 @@ filegroup(
18-
visibility = ["//visibility:public"],
14+
diff --git a/third_party/gpus/cuda/hermetic/BUILD.tpl b/third_party/gpus/cuda/hermetic/BUILD.tpl
15+
index 41a273ebbe..d789e71883 100644
16+
--- a/third_party/gpus/cuda/hermetic/BUILD.tpl
17+
+++ b/third_party/gpus/cuda/hermetic/BUILD.tpl
18+
@@ -307,6 +307,7 @@ cc_library(
19+
# This is not yet fully supported, but we need the rule
20+
# to make bazel query happy.
21+
name = "nvptxcompiler",
22+
+ actual = "@cuda_nvcc//:libnvptxcompiler",
1923
)
2024

21-
+filegroup(
22-
+ name = "libnvptxcompiler",
23-
+ srcs = [
24-
+ "lib/libnvptxcompiler_static.a",
25-
+ ],
26-
+ visibility = ["//visibility:public"],
27-
+)
28-
+
29-
filegroup(
30-
name = "bin",
31-
srcs = glob([
25+
alias(
26+
diff --git a/workspace0.bzl b/workspace0.bzl
27+
index 25db007e51..e6ccc318f0 100644
28+
--- a/workspace0.bzl
29+
+++ b/workspace0.bzl
30+
@@ -138,10 +138,10 @@ def workspace():
31+
# Details: https://github.com/google-ml-infra/rules_ml_toolchain
32+
http_archive(
33+
name = "rules_ml_toolchain",
34+
- sha256 = "de3b14418657eeacd8afc2aa89608be6ec8d66cd6a5de81c4f693e77bc41bee1",
35+
- strip_prefix = "rules_ml_toolchain-5653e5a0ca87c1272069b4b24864e55ce7f129a1",
36+
+ sha256 = "fb78d09234528aef2be856820b69b76486829f65e4eb3c7ffaa5803b667fa441",
37+
+ strip_prefix = "rules_ml_toolchain-f4ad89fa906be2c1374785a79335c8a7dcd49df7",
38+
urls = [
39+
- "https://github.com/google-ml-infra/rules_ml_toolchain/archive/5653e5a0ca87c1272069b4b24864e55ce7f129a1.tar.gz",
40+
+ "https://github.com/zml/rules_ml_toolchain/archive/f4ad89fa906be2c1374785a79335c8a7dcd49df7.tar.gz",
41+
],
42+
)
43+
3244
diff --git a/xla/stream_executor/cuda/BUILD b/xla/stream_executor/cuda/BUILD
33-
index 4a62a44357..d5f723fd62 100644
45+
index 08abf6197f..ac06e394bc 100644
3446
--- a/xla/stream_executor/cuda/BUILD
3547
+++ b/xla/stream_executor/cuda/BUILD
36-
@@ -84,6 +84,11 @@ config_setting(
37-
},
38-
)
39-
40-
+cc_import(
41-
+ name = "nvptxcompiler",
42-
+ static_library = "@cuda_nvcc//:libnvptxcompiler",
43-
+)
44-
+
45-
cc_library(
46-
name = "cuda_platform_id",
47-
srcs = ["cuda_platform_id.cc"],
48-
@@ -128,7 +133,12 @@ cc_library(
48+
@@ -124,7 +124,12 @@ cc_library(
4949
"@tsl//tsl/platform:errors",
5050
"@tsl//tsl/platform:status",
5151
"@tsl//tsl/platform:statusor",
5252
- ] + tf_additional_cuda_platform_deps(),
5353
+ ] + tf_additional_cuda_platform_deps() + select({
5454
+ ":libnvptxcompiler_support_enabled": [
55-
+ ":nvptxcompiler",
55+
+ "@local_config_cuda//cuda:nvptxcompiler",
5656
+ ],
5757
+ "//conditions:default": [],
5858
+ }),

openxla/patches/0004-build-use-hermetic-cc-toolchain-for-Linux-CPU-use-gl.patch

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
1-
From fed224a7f56daabfe127fce715090c44966cdcc5 Mon Sep 17 00:00:00 2001
1+
From cc37221ecd006b6685ab788820b07c8c1180a03f Mon Sep 17 00:00:00 2001
22
From: Hugo Mano <hugo@zml.ai>
33
Date: Tue, 27 May 2025 11:51:17 +0200
4-
Subject: [PATCH 4/6] build: use hermetic cc toolchain for Linux CPU (use glibc
4+
Subject: [PATCH 4/7] build: use hermetic cc toolchain for Linux CPU (use glibc
55
2.31)
66

77
Only for ZML, no PR on XLA side.
88
---
9-
WORKSPACE | 24 ++++++++++++++++++++++++
10-
1 file changed, 24 insertions(+)
9+
WORKSPACE | 23 +++++++++++++++++++++++
10+
1 file changed, 23 insertions(+)
1111

1212
diff --git a/WORKSPACE b/WORKSPACE
13-
index d8f4ae6e60..50701a23d6 100644
13+
index 67d505addc..e67c73e3f5 100644
1414
--- a/WORKSPACE
1515
+++ b/WORKSPACE
16-
@@ -126,3 +126,27 @@ load(
17-
)
16+
@@ -137,3 +137,26 @@ cc_toolchain_deps()
17+
register_toolchains("@rules_ml_toolchain//cc_toolchain:lx64_lx64")
1818

19-
nvshmem_configure(name = "local_config_nvshmem")
20-
+
19+
register_toolchains("@rules_ml_toolchain//cc_toolchain:lx64_lx64_cuda")
2120
+load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
2221
+
2322
+HERMETIC_CC_TOOLCHAIN_VERSION = "v3.1.1"
@@ -41,7 +40,6 @@ index d8f4ae6e60..50701a23d6 100644
4140
+register_toolchains(
4241
+ "@zig_sdk//toolchain:linux_amd64_gnu.2.31",
4342
+)
44-
\ No newline at end of file
4543
--
4644
2.39.5 (Apple Git-154)
4745

0 commit comments

Comments
 (0)