diff --git a/.azure-pipelines/azure-pipelines-osx.yml b/.azure-pipelines/azure-pipelines-osx.yml index a6fa459a..7b5eb13f 100755 --- a/.azure-pipelines/azure-pipelines-osx.yml +++ b/.azure-pipelines/azure-pipelines-osx.yml @@ -5,7 +5,7 @@ jobs: - job: osx pool: - vmImage: macOS-13 + vmImage: macOS-15 strategy: matrix: osx_64_python3.11.____cpython: diff --git a/.ci_support/linux_64_cuda_compiler_version12.9python3.11.____cpython.yaml b/.ci_support/linux_64_cuda_compiler_version12.9python3.11.____cpython.yaml index 6092ab4b..dc6cbde1 100644 --- a/.ci_support/linux_64_cuda_compiler_version12.9python3.11.____cpython.yaml +++ b/.ci_support/linux_64_cuda_compiler_version12.9python3.11.____cpython.yaml @@ -49,6 +49,7 @@ target_platform: zip_keys: - - c_compiler_version - cxx_compiler_version + - c_stdlib_version - cuda_compiler_version zlib: - '1' diff --git a/.ci_support/linux_64_cuda_compiler_version12.9python3.12.____cpython.yaml b/.ci_support/linux_64_cuda_compiler_version12.9python3.12.____cpython.yaml index 61af8f7d..eede482b 100644 --- a/.ci_support/linux_64_cuda_compiler_version12.9python3.12.____cpython.yaml +++ b/.ci_support/linux_64_cuda_compiler_version12.9python3.12.____cpython.yaml @@ -49,6 +49,7 @@ target_platform: zip_keys: - - c_compiler_version - cxx_compiler_version + - c_stdlib_version - cuda_compiler_version zlib: - '1' diff --git a/.ci_support/linux_64_cuda_compiler_version12.9python3.13.____cp313.yaml b/.ci_support/linux_64_cuda_compiler_version12.9python3.13.____cp313.yaml index dfe0315c..8f712539 100644 --- a/.ci_support/linux_64_cuda_compiler_version12.9python3.13.____cp313.yaml +++ b/.ci_support/linux_64_cuda_compiler_version12.9python3.13.____cp313.yaml @@ -49,6 +49,7 @@ target_platform: zip_keys: - - c_compiler_version - cxx_compiler_version + - c_stdlib_version - cuda_compiler_version zlib: - '1' diff --git a/.ci_support/linux_64_cuda_compiler_versionNonepython3.11.____cpython.yaml b/.ci_support/linux_64_cuda_compiler_versionNonepython3.11.____cpython.yaml index 6984ec22..5043d645 100644 --- a/.ci_support/linux_64_cuda_compiler_versionNonepython3.11.____cpython.yaml +++ b/.ci_support/linux_64_cuda_compiler_versionNonepython3.11.____cpython.yaml @@ -49,6 +49,7 @@ target_platform: zip_keys: - - c_compiler_version - cxx_compiler_version + - c_stdlib_version - cuda_compiler_version zlib: - '1' diff --git a/.ci_support/linux_64_cuda_compiler_versionNonepython3.12.____cpython.yaml b/.ci_support/linux_64_cuda_compiler_versionNonepython3.12.____cpython.yaml index 680cf95c..cbb4cd22 100644 --- a/.ci_support/linux_64_cuda_compiler_versionNonepython3.12.____cpython.yaml +++ b/.ci_support/linux_64_cuda_compiler_versionNonepython3.12.____cpython.yaml @@ -49,6 +49,7 @@ target_platform: zip_keys: - - c_compiler_version - cxx_compiler_version + - c_stdlib_version - cuda_compiler_version zlib: - '1' diff --git a/.ci_support/linux_64_cuda_compiler_versionNonepython3.13.____cp313.yaml b/.ci_support/linux_64_cuda_compiler_versionNonepython3.13.____cp313.yaml index 1a7d5545..315c9c9f 100644 --- a/.ci_support/linux_64_cuda_compiler_versionNonepython3.13.____cp313.yaml +++ b/.ci_support/linux_64_cuda_compiler_versionNonepython3.13.____cp313.yaml @@ -49,6 +49,7 @@ target_platform: zip_keys: - - c_compiler_version - cxx_compiler_version + - c_stdlib_version - cuda_compiler_version zlib: - '1' diff --git a/.ci_support/linux_aarch64_cuda_compiler_versionNonepython3.11.____cpython.yaml b/.ci_support/linux_aarch64_cuda_compiler_versionNonepython3.11.____cpython.yaml index 610832c5..109d1ab7 100644 --- a/.ci_support/linux_aarch64_cuda_compiler_versionNonepython3.11.____cpython.yaml +++ b/.ci_support/linux_aarch64_cuda_compiler_versionNonepython3.11.____cpython.yaml @@ -49,6 +49,7 @@ target_platform: zip_keys: - - c_compiler_version - cxx_compiler_version + - c_stdlib_version - cuda_compiler_version zlib: - '1' diff --git a/.ci_support/linux_aarch64_cuda_compiler_versionNonepython3.12.____cpython.yaml b/.ci_support/linux_aarch64_cuda_compiler_versionNonepython3.12.____cpython.yaml index c08f6149..f5dc04a5 100644 --- a/.ci_support/linux_aarch64_cuda_compiler_versionNonepython3.12.____cpython.yaml +++ b/.ci_support/linux_aarch64_cuda_compiler_versionNonepython3.12.____cpython.yaml @@ -49,6 +49,7 @@ target_platform: zip_keys: - - c_compiler_version - cxx_compiler_version + - c_stdlib_version - cuda_compiler_version zlib: - '1' diff --git a/.ci_support/linux_aarch64_cuda_compiler_versionNonepython3.13.____cp313.yaml b/.ci_support/linux_aarch64_cuda_compiler_versionNonepython3.13.____cp313.yaml index 6d9f5945..edcd104c 100644 --- a/.ci_support/linux_aarch64_cuda_compiler_versionNonepython3.13.____cp313.yaml +++ b/.ci_support/linux_aarch64_cuda_compiler_versionNonepython3.13.____cp313.yaml @@ -49,6 +49,7 @@ target_platform: zip_keys: - - c_compiler_version - cxx_compiler_version + - c_stdlib_version - cuda_compiler_version zlib: - '1' diff --git a/.ci_support/migrations/python313.yaml b/.ci_support/migrations/python313.yaml deleted file mode 100644 index f9389e3b..00000000 --- a/.ci_support/migrations/python313.yaml +++ /dev/null @@ -1,46 +0,0 @@ -migrator_ts: 1724712607 -__migrator: - commit_message: Rebuild for python 3.13 - migration_number: 1 - operation: key_add - primary_key: python - ordering: - python: - - 3.6.* *_cpython - - 3.7.* *_cpython - - 3.8.* *_cpython - - 3.9.* *_cpython - - 3.10.* *_cpython - - 3.11.* *_cpython - - 3.12.* *_cpython - - 3.13.* *_cp313 # new entry - - 3.6.* *_73_pypy - - 3.7.* *_73_pypy - - 3.8.* *_73_pypy - - 3.9.* *_73_pypy - paused: false - longterm: true - pr_limit: 20 - max_solver_attempts: 3 # this will make the bot retry "not solvable" stuff 12 times - exclude: - # this shouldn't attempt to modify the python feedstocks - - python - - pypy3.6 - - pypy-meta - - cross-python - - python_abi - # see https://github.com/conda-forge/scipy-feedstock/pull/283 - - scipy - exclude_pinned_pkgs: false - additional_zip_keys: - - channel_sources - -python: -- 3.13.* *_cp313 -channel_sources: -- conda-forge/label/python_rc,conda-forge -# additional entries to add for zip_keys -numpy: -- 2 -python_impl: -- cpython diff --git a/recipe/build.sh b/recipe/build.sh index 1b05481a..059a67d8 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -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 diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 986c607a..13523e4d 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,5 +1,5 @@ {% set version = "0.7.0" %} -{% set build = 0 %} +{% set build = 1 %} {% if cuda_compiler_version != "None" %} {% set build = build + 200 %} diff --git a/recipe/patches/0002-Consolidated-build-fixes-for-XLA.patch b/recipe/patches/0002-Consolidated-build-fixes-for-XLA.patch index 54687e50..0104dcb3 100644 --- a/recipe/patches/0002-Consolidated-build-fixes-for-XLA.patch +++ b/recipe/patches/0002-Consolidated-build-fixes-for-XLA.patch @@ -30,6 +30,7 @@ Co-Authored-By: H. Vetinari 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 @@ -117,7 +118,7 @@ index 0000000..392f97f +From e0b110e94788c4514d352e8d050d8cbb9a555032 Mon Sep 17 00:00:00 2001 +From: "Uwe L. Korn" +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 +++++++++++++++++++++ @@ -173,7 +174,7 @@ index 0000000..ff76a1d +From d2d7157bbb60839ee78a5126a6d7a661c799b447 Mon Sep 17 00:00:00 2001 +From: "Uwe L. Korn" +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 +- @@ -280,7 +281,7 @@ index 0000000..b6172a6 +From 1a82f5ea2ad15fb0cf7513eb9296085001d6ca9a Mon Sep 17 00:00:00 2001 +From: "Uwe L. Korn" +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 +++++ @@ -311,7 +312,7 @@ index 0000000..666ba39 +From b4bf17edc72105f47b02a67b52ae1b9943e30248 Mon Sep 17 00:00:00 2001 +From: "Uwe L. Korn" +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 @@ -669,7 +670,7 @@ index 0000000..e5ad440 +From 11d61802de923b2f7452c86b55267d69841ba9eb Mon Sep 17 00:00:00 2001 +From: "Uwe L. Korn" +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 ++++++- @@ -733,7 +734,7 @@ index 0000000..3e3c81a +From d4aeb2446232a84c862b0d5bedbfefc3d09c74b5 Mon Sep 17 00:00:00 2001 +From: "Uwe L. Korn" +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 +------------------------------------ @@ -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)), @@ -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