Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .azure-pipelines/azure-pipelines-osx.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ target_platform:
zip_keys:
- - c_compiler_version
- cxx_compiler_version
- c_stdlib_version
- cuda_compiler_version
zlib:
- '1'
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ target_platform:
zip_keys:
- - c_compiler_version
- cxx_compiler_version
- c_stdlib_version
- cuda_compiler_version
zlib:
- '1'
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ target_platform:
zip_keys:
- - c_compiler_version
- cxx_compiler_version
- c_stdlib_version
- cuda_compiler_version
zlib:
- '1'
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ target_platform:
zip_keys:
- - c_compiler_version
- cxx_compiler_version
- c_stdlib_version
- cuda_compiler_version
zlib:
- '1'
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ target_platform:
zip_keys:
- - c_compiler_version
- cxx_compiler_version
- c_stdlib_version
- cuda_compiler_version
zlib:
- '1'
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ target_platform:
zip_keys:
- - c_compiler_version
- cxx_compiler_version
- c_stdlib_version
- cuda_compiler_version
zlib:
- '1'
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ target_platform:
zip_keys:
- - c_compiler_version
- cxx_compiler_version
- c_stdlib_version
- cuda_compiler_version
zlib:
- '1'
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ target_platform:
zip_keys:
- - c_compiler_version
- cxx_compiler_version
- c_stdlib_version
- cuda_compiler_version
zlib:
- '1'
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ target_platform:
zip_keys:
- - c_compiler_version
- cxx_compiler_version
- c_stdlib_version
- cuda_compiler_version
zlib:
- '1'
46 changes: 0 additions & 46 deletions .ci_support/migrations/python313.yaml

This file was deleted.

61 changes: 57 additions & 4 deletions recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,65 @@ bazel clean
popd

pushd $SP_DIR
# pip doesn't want to install cleanly in all cases, so we use the fact that we can unzip it.
unzip $SRC_DIR/dist/jaxlib-*.whl
pip install $SRC_DIR/dist/jaxlib-*.whl

# Add INSTALLER file and remove RECORD, workaround for
# https://github.com/conda-forge/jaxlib-feedstock/issues/293
JAXLIB_DIST_INFO_DIR="${SP_DIR}/jaxlib-${PKG_VERSION}.dist-info"
echo "conda" > "${JAXLIB_DIST_INFO_DIR}/INSTALLER"
rm -f "${JAXLIB_DIST_INFO_DIR}/RECORD"

if [[ "${cuda_compiler_version:-None}" != "None" ]]; then
unzip $SRC_DIR/dist/jax_cuda*_plugin*.whl
unzip $SRC_DIR/dist/jax_cuda*_pjrt*.whl
pip install $SRC_DIR/dist/jax_cuda*_plugin*.whl
pip install $SRC_DIR/dist/jax_cuda*_pjrt*.whl

# Add INSTALLER file and remove RECORD, workaround for
# https://github.com/conda-forge/jaxlib-feedstock/issues/293
JAX_CUDA_PJRT_DIST_INFO_DIR="${SP_DIR}/jax_cuda${CUDA_COMPILER_MAJOR_VERSION}_pjrt-${PKG_VERSION}.dist-info"
echo "conda" > "${JAX_CUDA_PJRT_DIST_INFO_DIR}/INSTALLER"
rm -f "${JAX_CUDA_PJRT_DIST_INFO_DIR}/RECORD"
JAX_CUDA_PLUGIN_DIST_INFO_DIR="${SP_DIR}/jax_cuda${CUDA_COMPILER_MAJOR_VERSION}_plugin-${PKG_VERSION}.dist-info"
echo "conda" > "${JAX_CUDA_PLUGIN_DIST_INFO_DIR}/INSTALLER"
rm -f "${JAX_CUDA_PLUGIN_DIST_INFO_DIR}/RECORD"

# Regression test for https://github.com/conda-forge/jaxlib-feedstock/issues/320
if [[ "${target_platform}" == linux-* ]]; then
# Scan all .so files in both plugin directories and error if any FLAGS_* symbols are present.
declare -a PLUGIN_DIRS=(
"${SP_DIR}/jax_plugins/xla_cuda${CUDA_COMPILER_MAJOR_VERSION}"
"${SP_DIR}/jax_cuda${CUDA_COMPILER_MAJOR_VERSION}_plugin"
)
echo "Scanning CUDA plugin directories for .so files and FLAGS_* symbols:"
for DIR in "${PLUGIN_DIRS[@]}"; do
if [[ -d "${DIR}" ]]; then
echo " - ${DIR}"
mapfile -t SO_FILES < <(find "${DIR}" -type f -name '*.so' -print | sort)
if (( ${#SO_FILES[@]} == 0 )); then
echo " (no .so files found)"
continue
fi
echo " .so files:"
for SO in "${SO_FILES[@]}"; do
echo " * ${SO}"
done
# Prefer nm -s as requested; fall back to plain nm if -s is unsupported to avoid hard failure.
# Fail the build if any symbol starting with FLAGS_ is present.
for SO in "${SO_FILES[@]}"; do
SYMBOLS_OUTPUT=$(nm -s "${SO}" 2>/dev/null || nm "${SO}")
if echo "${SYMBOLS_OUTPUT}" | grep -E '(^|[^A-Za-z0-9_])FLAGS_[A-Za-z0-9_]+' >/dev/null; then
echo "Error: Unexpected FLAGS_* symbols found in ${SO}:" >&2
echo "----------------------------------------" >&2
echo "${SYMBOLS_OUTPUT}" | grep -E '(^|[^A-Za-z0-9_])FLAGS_[A-Za-z0-9_]+' >&2 || true
echo "----------------------------------------" >&2
exit 1
fi
done
else
echo "Warning: ${DIR} not found; skipping" >&2
fi
done
echo "No FLAGS_* symbols found in the CUDA plugin directory, the test was successul"
fi
fi

popd
2 changes: 1 addition & 1 deletion recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% set version = "0.7.0" %}
{% set build = 0 %}
{% set build = 1 %}

{% if cuda_compiler_version != "None" %}
{% set build = build + 200 %}
Expand Down
41 changes: 32 additions & 9 deletions recipe/patches/0002-Consolidated-build-fixes-for-XLA.patch
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Co-Authored-By: H. Vetinari <[email protected]>
create mode 100644 third_party/xla/0004-Re-enable-system-abseil.patch
create mode 100644 third_party/xla/0005-Check-whether-absl-log-is-already-initialized.patch
create mode 100644 third_party/xla/0006-Unbundle-grpc.patch
create mode 100644 third_party/xla/0007-Disable-coordination_agent_recoverable-flag.patch

diff --git a/third_party/grpc_systemlib.BUILD b/third_party/grpc_systemlib.BUILD
new file mode 100644
Expand Down Expand Up @@ -117,7 +118,7 @@ index 0000000..392f97f
+From e0b110e94788c4514d352e8d050d8cbb9a555032 Mon Sep 17 00:00:00 2001
+From: "Uwe L. Korn" <[email protected]>
+Date: Thu, 14 Dec 2023 15:04:51 +0100
+Subject: [PATCH 1/6] Support third-party build of boringssl
+Subject: [PATCH 1/7] Support third-party build of boringssl
+
+---
+ third_party/boringssl.BUILD | 21 +++++++++++++++++++++
Expand Down Expand Up @@ -173,7 +174,7 @@ index 0000000..ff76a1d
+From d2d7157bbb60839ee78a5126a6d7a661c799b447 Mon Sep 17 00:00:00 2001
+From: "Uwe L. Korn" <[email protected]>
+Date: Thu, 23 May 2024 15:45:52 +0200
+Subject: [PATCH 2/6] Fix abseil headers
+Subject: [PATCH 2/7] Fix abseil headers
+
+---
+ xla/backends/cpu/codegen/ir_compiler.cc | 2 +-
Expand Down Expand Up @@ -280,7 +281,7 @@ index 0000000..b6172a6
+From 1a82f5ea2ad15fb0cf7513eb9296085001d6ca9a Mon Sep 17 00:00:00 2001
+From: "Uwe L. Korn" <[email protected]>
+Date: Thu, 4 Jul 2024 10:36:03 +0200
+Subject: [PATCH 3/6] Omit usage of StrFormat
+Subject: [PATCH 3/7] Omit usage of StrFormat
+
+---
+ xla/stream_executor/gpu/gpu_executor.h | 5 +++++
Expand Down Expand Up @@ -311,7 +312,7 @@ index 0000000..666ba39
+From b4bf17edc72105f47b02a67b52ae1b9943e30248 Mon Sep 17 00:00:00 2001
+From: "Uwe L. Korn" <[email protected]>
+Date: Thu, 4 Jul 2024 15:58:32 +0200
+Subject: [PATCH 4/6] Re-enable system abseil
+Subject: [PATCH 4/7] Re-enable system abseil
+
+partially revert https://github.com/openxla/xla/commit/1fc2a846d259d3c896a6177485abcc68d97627a9
+and add missing pieces
Expand Down Expand Up @@ -669,7 +670,7 @@ index 0000000..e5ad440
+From 11d61802de923b2f7452c86b55267d69841ba9eb Mon Sep 17 00:00:00 2001
+From: "Uwe L. Korn" <[email protected]>
+Date: Fri, 22 Nov 2024 10:51:18 +0100
+Subject: [PATCH 5/6] Check whether absl log is already initialized
+Subject: [PATCH 5/7] Check whether absl log is already initialized
+
+---
+ xla/pjrt/c/pjrt_c_api_gpu.cc | 7 ++++++-
Expand Down Expand Up @@ -733,7 +734,7 @@ index 0000000..3e3c81a
+From d4aeb2446232a84c862b0d5bedbfefc3d09c74b5 Mon Sep 17 00:00:00 2001
+From: "Uwe L. Korn" <[email protected]>
+Date: Wed, 23 Jul 2025 13:19:52 +0200
+Subject: [PATCH 6/6] Unbundle grpc
+Subject: [PATCH 6/7] Unbundle grpc
+
+---
+ third_party/zlib.BUILD | 37 +------------------------------------
Expand Down Expand Up @@ -896,11 +897,32 @@ index 0000000..3e3c81a
+ )
+
+ # Load the raw llvm-project. llvm does not have build rules set up by default,
diff --git a/third_party/xla/0007-Disable-coordination_agent_recoverable-flag.patch b/third_party/xla/0007-Disable-coordination_agent_recoverable-flag.patch
new file mode 100644
index 0000000..3e3c81a
--- /dev/null
+++ b/third_party/xla/0007-Disable-coordination_agent_recoverable-flag.patch
@@ -0,0 +1,15 @@
+diff --git a/xla/tsl/distributed_runtime/coordination/coordination_service_agent.cc b/xla/tsl/distributed_runtime/coordination/coordination_service_agent.cc
+index ada9b9a8ebc6e..dbf64b7956a0b 100644
+--- a/xla/tsl/distributed_runtime/coordination/coordination_service_agent.cc
++++ b/xla/tsl/distributed_runtime/coordination/coordination_service_agent.cc
+@@ -57,4 +57,4 @@ limitations under the License.
+ // TODO(b/342448688): Expose via config and API instead of flag.
+-ABSL_FLAG(
+- bool, coordination_agent_recoverable, false,
+- "If true, allow it to silently reconnect to the service after a restart.");
++//ABSL_FLAG(
++// bool, coordination_agent_recoverable, false,
++// "If true, allow it to silently reconnect to the service after a restart.");
+@@ -101,1 +101,1 @@ absl::Status CoordinationServiceAgent::Initialize(
+- if (recoverable || absl::GetFlag(FLAGS_coordination_agent_recoverable)) {
++ if (recoverable) {
diff --git a/third_party/xla/workspace.bzl b/third_party/xla/workspace.bzl
index 286aa16..fe97e89 100644
--- a/third_party/xla/workspace.bzl
+++ b/third_party/xla/workspace.bzl
@@ -22,6 +22,14 @@ def repo():
@@ -22,6 +22,15 @@ def repo():
sha256 = XLA_SHA256,
strip_prefix = "xla-{commit}".format(commit = XLA_COMMIT),
urls = tf_mirror_urls("https://github.com/openxla/xla/archive/{commit}.tar.gz".format(commit = XLA_COMMIT)),
Expand All @@ -910,8 +932,9 @@ index 286aa16..fe97e89 100644
+ "//third_party/xla:0003-Omit-usage-of-StrFormat.patch",
+ "//third_party/xla:0004-Re-enable-system-abseil.patch",
+ "//third_party/xla:0005-Check-whether-absl-log-is-already-initialized.patch",
+ "//third_party/xla:0006-Unbundle-grpc.patch",
+ ],
+ "//third_party/xla:0006-Unbundle-grpc.patch",
+ "//third_party/xla:0007-Disable-coordination_agent_recoverable-flag.patch",
+ ],
)

# For development, one often wants to make changes to the TF repository as well
Expand Down
Loading