Skip to content

Commit e00cf92

Browse files
authored
workspace: fix nightly (#58)
* support linux yq... * update xla * Fix setup.sh * Update @llvm * no force remote * Fix dylib
1 parent 15d494a commit e00cf92

File tree

8 files changed

+64
-109
lines changed

8 files changed

+64
-109
lines changed

.github/workflows/_build.yaml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ on:
1717
type: string
1818

1919
env:
20-
XLA_COMMIT: ${{ inputs.xla_commit || '9caad7b3520548142ccd6a2d528a06be6c474de1' }} # main from 2025-12-23
21-
ROCM_XLA_COMMIT: ${{ inputs.rocm_xla_commit || 'a841f7a22e36f856032eed3f4e9e83903d482198' }} # rocm-jaxlib-v0.8.0 from 2025-12-30
20+
XLA_COMMIT: ${{ inputs.xla_commit || '9e9a0fb13b164c9875349246d1d8616a267c9bf5' }} # main from 2026-03-12
21+
ROCM_XLA_COMMIT: ${{ inputs.rocm_xla_commit || 'c40171e49b63e8a12498fae2b64f90c2406802ec' }} # rocm-jaxlib-v0.8.0 from 2025-12-30
2222
TF_ROCM_AMDGPU_TARGETS: "gfx900,gfx906,gfx908,gfx90a,gfx942,gfx1030,gfx1100"
2323
BUILDBUDDY_API_KEY: ${{ secrets.BUILDBUDDY_API_KEY }}
2424

@@ -45,7 +45,7 @@ jobs:
4545
bazel_target: //xla/pjrt/c:pjrt_c_api_gpu_plugin
4646
- target: cpu
4747
config: "--config=hermetic_macos_arm64 --config=remote --config=bzlmod --remote_header=x-buildbuddy-api-key=$BUILDBUDDY_API_KEY"
48-
artifact: bazel-bin/xla/pjrt/c/libpjrt_c_api_cpu_plugin.so
48+
artifact: bazel-bin/xla/pjrt/c/libpjrt_c_api_cpu_plugin.dylib
4949
runs_on: ["runs-on", "runner=32cpu-linux-x64", "image=ubuntu22-amd64"]
5050
renamed_artifact: libpjrt_cpu.dylib
5151
platform: darwin-arm64
@@ -66,7 +66,7 @@ jobs:
6666
platform: linux-amd64
6767
bazel_target: //xla/pjrt/c:pjrt_c_api_cpu_plugin
6868
- target: cpu
69-
config: "--config=hermetic_linux_arm64 --config=remote --config=bzlmod --remote_header=x-buildbuddy-api-key=$BUILDBUDDY_API_KEY --platforms @toolchains_llvm_bootstrapped//platforms:linux_arm64"
69+
config: "--config=hermetic_linux_arm64 --config=remote --config=bzlmod --remote_header=x-buildbuddy-api-key=$BUILDBUDDY_API_KEY --platforms @llvm//platforms:linux_arm64"
7070
artifact: bazel-bin/xla/pjrt/c/libpjrt_c_api_cpu_plugin.so
7171
renamed_artifact: libpjrt_cpu.so
7272
runs_on: ["runs-on", "runner=32cpu-linux-x64", "image=ubuntu22-amd64"]
@@ -97,17 +97,21 @@ jobs:
9797
xla_commit=$(git rev-parse HEAD)
9898
echo "XLA_COMMIT_ID=$xla_commit" >> $GITHUB_OUTPUT
9999
echo ::notice::Applying patches to openxla $xla_commit
100-
for patch in $(ls ../pjrt-artifacts/openxla/patches/$PATCH_DIRECTORY/*.patch | sort); do
101-
echo "Applying patch $patch"
102-
git apply "$patch"
103-
done
104-
# apply patches from upstream-cpu if target = cpu
105-
if [ "${{ matrix.pjrt.target }}" = "cpu" ]; then
106-
for patch in $(ls ../pjrt-artifacts/openxla/patches/upstream-cpu/*.patch | sort); do
100+
if compgen -G "../pjrt-artifacts/openxla/patches/$PATCH_DIRECTORY/*.patch" > /dev/null; then
101+
for patch in ../pjrt-artifacts/openxla/patches/$PATCH_DIRECTORY/*.patch; do
107102
echo "Applying patch $patch"
108103
git apply "$patch"
109104
done
110105
fi
106+
# apply patches from upstream-cpu if target = cpu
107+
if [ "${{ matrix.pjrt.target }}" = "cpu" ]; then
108+
if compgen -G "../pjrt-artifacts/openxla/patches/upstream-cpu/*.patch" > /dev/null; then
109+
for patch in ../pjrt-artifacts/openxla/patches/upstream-cpu/*.patch; do
110+
echo "Applying patch $patch"
111+
git apply "$patch"
112+
done
113+
fi
114+
fi
111115
112116
- uses: runs-on/snapshot@v1
113117
if: matrix.pjrt.target != 'cpu'

openxla/bazelrc/upstream/.bazelrc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ common:remote --experimental_remote_execution_keepalive
3232
common:remote --grpc_keepalive_time=30s
3333
common:remote --remote_executor=grpcs://remote.buildbuddy.io
3434
common:remote --jobs=800
35-
common:remote --extra_execution_platforms=@toolchains_llvm_bootstrapped//:rbe_platform
36-
common:remote --spawn_strategy=remote
35+
common:remote --extra_execution_platforms=@llvm//:rbe_platform
36+
# common:remote --spawn_strategy=remote
3737

3838
# Additive-only configs for hermetic/custom cc toolchain flows.
3939
common:hermetic_clang --repo_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
@@ -46,11 +46,11 @@ common:hermetic_clang --@rules_python//python/config_settings:bootstrap_impl=scr
4646

4747
common:hermetic_linux_x86 --config=hermetic_clang
4848
common:hermetic_linux_x86 --config=avx_linux
49-
common:hermetic_linux_x86 --platforms @toolchains_llvm_bootstrapped//platforms:linux_x86_64
49+
common:hermetic_linux_x86 --platforms @llvm//platforms:linux_x86_64
5050
common:hermetic_linux_x86 --cpu=k8
5151

5252
common:hermetic_linux_arm64 --config=hermetic_clang
53-
common:hermetic_linux_arm64 --platforms @toolchains_llvm_bootstrapped//platforms:linux_arm64
53+
common:hermetic_linux_arm64 --platforms @llvm//platforms:linux_aarch64
5454
common:hermetic_linux_arm64 --cpu=aarch64
5555

5656
### OSX

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ Subject: [PATCH 1/3] Drop the .so suffix for PjRt plugin targets (.dylib on
99
1 file changed, 2 insertions(+), 2 deletions(-)
1010

1111
diff --git a/xla/pjrt/c/BUILD b/xla/pjrt/c/BUILD
12-
index 39192ab24d..8fb2e34c21 100644
12+
index 37f8cb73ce..ffd95b50c8 100644
1313
--- a/xla/pjrt/c/BUILD
1414
+++ b/xla/pjrt/c/BUILD
15-
@@ -390,7 +390,7 @@ cc_library(
15+
@@ -510,7 +510,7 @@ cc_library(
1616

1717
# PJRT CPU plugin.
1818
xla_cc_binary(
@@ -21,7 +21,7 @@ index 39192ab24d..8fb2e34c21 100644
2121
additional_linker_inputs = [
2222
":pjrt_c_api_cpu_version_script.lds",
2323
],
24-
@@ -486,7 +486,7 @@ cc_library(
24+
@@ -613,7 +613,7 @@ cc_library(
2525

2626
# PJRT GPU plugin. Can be configured to be built for CUDA or ROCM.
2727
xla_cc_binary(
@@ -32,4 +32,3 @@ index 39192ab24d..8fb2e34c21 100644
3232
],
3333
--
3434
2.50.1 (Apple Git-155)
35-
Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
1+
From 174a8d1f0a596227db6ac281499c57133d1557cb Mon Sep 17 00:00:00 2001
2+
From: Corentin Kerisit <corentin.kerisit@gmail.com>
3+
Date: Thu, 12 Mar 2026 11:00:00 +0000
4+
Subject: [PATCH 2/3] Custom install name
5+
6+
---
7+
xla/pjrt/c/BUILD | 2 +-
8+
1 file changed, 1 insertion(+), 1 deletion(-)
9+
110
diff --git a/xla/pjrt/c/BUILD b/xla/pjrt/c/BUILD
2-
index aece9b02cb..28aa1d182e 100644
11+
index ea48989303..525b8c8f93 100644
312
--- a/xla/pjrt/c/BUILD
413
+++ b/xla/pjrt/c/BUILD
5-
@@ -410,7 +410,7 @@ xla_cc_binary(
14+
@@ -519,7 +519,7 @@ xla_cc_binary(
615
linkopts = if_macos(
716
[
817
"-Wl,-exported_symbol,_GetPjrtApi",
@@ -11,4 +20,5 @@ index aece9b02cb..28aa1d182e 100644
1120
"-Wl,-undefined,error",
1221
],
1322
[
14-
---
23+
--
24+
2.48.1

openxla/patches/upstream/0002-Hermetic-cc-toolchain.patch

Lines changed: 0 additions & 40 deletions
This file was deleted.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
diff --git a/MODULE.bazel b/MODULE.bazel
2+
index d6866a2..7d82e18 100644
3+
--- a/MODULE.bazel
4+
+++ b/MODULE.bazel
5+
@@ -6,6 +6,7 @@ module(name = "xla")
6+
# go/keep-sorted start
7+
bazel_dep(name = "abseil-cpp", version = "20250814.1", repo_name = "com_google_absl")
8+
bazel_dep(name = "abseil-py", version = "2.1.0", repo_name = "absl_py")
9+
+bazel_dep(name = "apple_support", version = "1.24.4", repo_name = "build_bazel_apple_support")
10+
bazel_dep(name = "bazel_features", version = "1.36.0")
11+
bazel_dep(name = "bazel_skylib", version = "1.8.2")
12+
bazel_dep(name = "boringssl", version = "0.20250818.0")
13+
@@ -28,10 +29,15 @@ bazel_dep(name = "rules_license", version = "1.0.0")
14+
bazel_dep(name = "rules_python", version = "1.8.4")
15+
bazel_dep(name = "rules_shell", version = "0.6.1")
16+
bazel_dep(name = "snappy", version = "1.2.1")
17+
+bazel_dep(name = "llvm", version = "0.6.7")
18+
bazel_dep(name = "xxd", version = "9.1.0917")
19+
bazel_dep(name = "zlib", version = "1.3.1.bcr.5")
20+
# go/keep-sorted end
21+
22+
+register_toolchains(
23+
+ "@llvm//toolchain:all",
24+
+)
25+
+
26+
# Only for compatibility, not directly used, change repo_name to None after upgrading Bazel to latest 7.x
27+
bazel_dep(name = "eigen", version = "4.0.0-20241125.bcr.3", repo_name = "DO_NOT_USE_eigen")
28+
bazel_dep(name = "grpc-java", version = "1.75.0", repo_name = "DO_NOT_USE_grpc_java")

openxla/patches/uptream-cpu/0001-build-xxd-from-source.patch

Lines changed: 0 additions & 46 deletions
This file was deleted.

setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ fi
201201
echo ""
202202
echo "=== Build commands (from $WORKFLOW_FILE) ==="
203203

204-
matrix_entries=$(yq_read '.jobs["pjrt-artifacts"].strategy.matrix.pjrt[] | [.target,.platform,.config,.bazel_target] | @tsv')
204+
matrix_entries=$(yq_read '.jobs["pjrt-artifacts"].strategy.matrix.pjrt[] | [.target,.platform,.bazel_opts,.config,.bazel_target] | @tsv')
205205

206206
while IFS=$'\t' read -r target platform config bazel_target; do
207207
if [[ -z "$target" ]]; then

0 commit comments

Comments
 (0)