-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Add Hermetic C++ Toolchains for Linux x86_64 builds. #29672
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
+54
−36
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
b95e587
to
a401a8a
Compare
e1f12fe
to
f60b0e1
Compare
Loading status checks…
Hermetic toolchains provide builds that are isolated from the host system, cutting down on unexpected dependencies and side effects. By default, JAX now builds for Linux x86_64 architectures (both CPU and CUDA-enabled GPU) using hermetic C++ toolchains. For non-hermetic builds, add the flag --config=clang_local. For remote builds with a non-hermetic toolchain, simply append _clang_local to the existing RBE flag. For example, if hermetic RBE build runs with --config=rbe_linux_cpu, the non-hermetic version would be --config=rbe_linux_cpu_clang_local. Example 1: Run CPU tests for Linux x86_64 For hermetic tests run the command for Linux x86_64 build without env variables CC, CXX, etc.: bazel test //tests:cpu_tests \ --config=avx_posix \ --config=clang \ --linkopt=-lrt \ --host_linkopt=-lrt \ --repo_env=HERMETIC_PYTHON_VERSION="3.13" \ --test_tag_filters=-multiaccelerator For non-hermetic tests use commands with the flag "--config=clang_local" and env variables CC, CXX, etc.: bazel test //tests:cpu_tests \ --config=clang_local \ --config=avx_posix \ --config=clang \ --linkopt=-lrt \ --host_linkopt=-lrt \ --repo_env=HERMETIC_PYTHON_VERSION="3.13" \ --test_tag_filters=-multiaccelerator \ --action_env=CLANG_COMPILER_PATH=/usr/lib/llvm-18/bin/clang \ --repo_env=CC=/usr/lib/llvm-18/bin/clang \ --repo_env=CXX=/usr/lib/llvm-18/bin/clang++ \ --repo_env=BAZEL_COMPILER=/usr/lib/llvm-18/bin/clang \ --action_env=CCC_OVERRIDE_OPTIONS="^--gcc-install-dir=/usr/lib/gcc/x86_64-linux-gnu/13" Example 2: Run CUDA GPU tests for Linux x86_64 For hermetic tests, run the command without env variables CC, CXX, etc.: bazel test //tests:gpu_tests \ --config=cuda \ --config=clang \ --config=build_cuda_with_nvcc \ --config=avx_posix \ --linkopt=-lrt \ --host_linkopt=-lrt \ --test_tag_filters=-multiaccelerator \ --repo_env=HERMETIC_PYTHON_VERSION=3.13 For non-hermetic tests use commands with the flag "--config=clang_local" and env variables CC, CXX, etc.: bazel test //tests:gpu_tests \ --config=clang_local \ --config=avx_posix \ --config=build_cuda_with_nvcc \ --config=clang \ --config=cuda \ --linkopt=-lrt \ --host_linkopt=-lrt \ --action_env=CCC_OVERRIDE_OPTIONS="^--gcc-install-dir=/usr/lib/gcc/x86_64-linux-gnu/9" \ --test_tag_filters=-multiaccelerator \ --action_env=CLANG_COMPILER_PATH=/usr/lib/llvm-18/bin/clang \ --repo_env=CC=/usr/lib/llvm-18/bin/clang \ --repo_env=CXX=/usr/lib/llvm-18/bin/clang++ \ --repo_env=BAZEL_COMPILER=/usr/lib/llvm-18/bin/clang \ --repo_env=HERMETIC_PYTHON_VERSION=3.13 Example 3: Run RBE build for Linux x86_64 For hermetic build, run the same command as before modification: bazel build \ --config=ci_linux_x86_64 \ --repo_env=HERMETIC_PYTHON_VERSION=3.13 \ //jaxlib/tools:jaxlib_wheel For non-hermetic builds, add "_clang_local" suffix to RBE configuration: bazel build \ --config=ci_linux_x86_64_clang_local \ --repo_env=HERMETIC_PYTHON_VERSION=3.13 \ //jaxlib/tools:jaxlib_wheel We don't support other "rbe_*_clang_local" configuration flags, and you could construct your own combinations. PiperOrigin-RevId: 786346447
f60b0e1
to
bf25960
Compare
copybara-service bot
pushed a commit
to openxla/xla
that referenced
this pull request
Jul 23, 2025
Loading
Loading status checks…
…SPACE files. Upgrading manylinux compliancy tag in [JAX PR](jax-ml/jax#29672) enabled building targets with linked `nvshmem` libraries. PiperOrigin-RevId: 783942761
copybara-service bot
pushed a commit
to openxla/xla
that referenced
this pull request
Jul 23, 2025
Loading
Loading status checks…
…SPACE files. Upgrading manylinux compliancy tag in [JAX PR](jax-ml/jax#29672) enabled building targets with linked `nvshmem` libraries. PiperOrigin-RevId: 783942761
copybara-service bot
pushed a commit
to openxla/xla
that referenced
this pull request
Jul 23, 2025
Loading
Loading status checks…
…SPACE files. Upgrading manylinux compliancy tag in [JAX PR](jax-ml/jax#29672) enabled building targets with linked `nvshmem` libraries. PiperOrigin-RevId: 783942761
copybara-service bot
pushed a commit
to tensorflow/tensorflow
that referenced
this pull request
Jul 23, 2025
Loading
Loading status checks…
…SPACE files. Upgrading manylinux compliancy tag in [JAX PR](jax-ml/jax#29672) enabled building targets with linked `nvshmem` libraries. PiperOrigin-RevId: 783942761
copybara-service bot
pushed a commit
to openxla/xla
that referenced
this pull request
Jul 24, 2025
Loading
Loading status checks…
…SPACE files. Upgrading manylinux compliancy tag in [JAX PR](jax-ml/jax#29672) enabled building targets with linked `nvshmem` libraries. PiperOrigin-RevId: 783942761
copybara-service bot
pushed a commit
to tensorflow/tensorflow
that referenced
this pull request
Jul 24, 2025
Loading
Loading status checks…
…SPACE files. Upgrading manylinux compliancy tag in [JAX PR](jax-ml/jax#29672) enabled building targets with linked `nvshmem` libraries. PiperOrigin-RevId: 783942761
copybara-service bot
pushed a commit
to openxla/xla
that referenced
this pull request
Jul 24, 2025
Loading
Loading status checks…
…SPACE files. Upgrading manylinux compliancy tag in [JAX PR](jax-ml/jax#29672) enabled building targets with linked `nvshmem` libraries. PiperOrigin-RevId: 786533277
copybara-service bot
pushed a commit
to tensorflow/tensorflow
that referenced
this pull request
Jul 24, 2025
Loading
Loading status checks…
…SPACE files. Upgrading manylinux compliancy tag in [JAX PR](jax-ml/jax#29672) enabled building targets with linked `nvshmem` libraries. PiperOrigin-RevId: 786533277
CodeHotel
pushed a commit
to CodeHotel/tensorflow
that referenced
this pull request
Jul 28, 2025
…SPACE files. Upgrading manylinux compliancy tag in [JAX PR](jax-ml/jax#29672) enabled building targets with linked `nvshmem` libraries. PiperOrigin-RevId: 786533277
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add Hermetic C++ Toolchains for Linux x86_64 builds.
Hermetic toolchains provide builds that are isolated from the host system, cutting down on unexpected dependencies and side effects.
By default, JAX now builds for Linux x86_64 architectures (both CPU and CUDA-enabled GPU) using hermetic C++ toolchains. For non-hermetic builds, add the flag --config=clang_local. For remote builds with a non-hermetic toolchain, simply append _clang_local to the existing RBE flag. For example, if hermetic RBE build runs with --config=rbe_linux_cpu, the non-hermetic version would be --config=rbe_linux_cpu_clang_local.