512 Commits

Author SHA1 Message Date
Vadym Matsishevskyi
a75d94622c Reverts 72f9a493589a1046e6927a5f16d7dc71df530743
PiperOrigin-RevId: 691843537
2024-10-31 10:05:22 -07:00
Nitin Srinivasan
da994d3552 Move utility functions in build.py to utils.py
This commit is the first step towards re-working the build CLI. It moves all the auxiliary functions used by the CLI into a separate script for easier maintenance and readability.

PiperOrigin-RevId: 691458051
2024-10-30 10:00:32 -07:00
Peter Hawkins
72f9a49358 Reverts 6d8950c04f23ad15a0443006f1e5bd21bfa84156
PiperOrigin-RevId: 691222756
2024-10-29 17:46:55 -07:00
Vadym Matsishevskyi
6d8950c04f Cleanup requirements.in and test-requirements.txt
PiperOrigin-RevId: 691208596
2024-10-29 16:50:54 -07:00
Ruturaj4
bfd7075c39 [ROCm] ci build fixes 2024-10-25 05:01:44 -05:00
jax authors
3bdc57dd29 Merge pull request #24300 from ROCm:ci_rocm_readme
PiperOrigin-RevId: 686872994
2024-10-17 05:21:13 -07:00
Ruturaj4
3c3b08dfd6 [ROCm] Fix README.md to update AMD JAX installation instructions 2024-10-16 17:15:32 -05:00
Ruturaj4
a2824862f5 [ROCm] build script fix 2024-10-15 13:43:08 -05:00
Ruturaj4
937d79e3f2 [ROCm] apt update 2024-10-11 18:33:12 -05:00
jax authors
e4629f6a4c Merge pull request #24232 from ROCm:ci_rv_clang_clean
PiperOrigin-RevId: 684891301
2024-10-11 11:00:55 -07:00
David Dunleavy
ee312afe86 Corresponding build.py updates after 5132a188f7
PiperOrigin-RevId: 684805296
2024-10-11 05:41:28 -07:00
Ruturaj4
33bcd0cb7a [ROCm] Bring up clang support for JAX+XLA
* Add clang path

* bazelrc env fixes

* Fix wheelhouse installation and preserve wheels

* dockerfile changes

* Add target.lst

* Change target architectures

* Install bzip2 and sqlite packages
2024-10-10 16:31:26 -05:00
jax authors
53668b88eb Update rules_python.patch to support Python 3.13.0 and update python 3.13 packages in JAX.
The downloaded Python `tar.gz` files should have suffix `install_only`.

PiperOrigin-RevId: 684113192
2024-10-09 11:36:33 -07:00
jax authors
e212c77336 Merge pull request #23891 from ROCm:build-fixes-rollup
PiperOrigin-RevId: 681448694
2024-10-02 07:43:13 -07:00
Mathew Odden
9ff891dfa1 [ROCm] Remove broken legacy env vars
These env vars are no longer used or need and were
being set incorrectly.

[ROCm] Use specific amdgpu version for EL8 systems

We were always installing the latest driver versions
but this had some side effects when yum would try
to download index files from a URL with changing content.

[ROCm] Fix formatting on python files

Reformatted with black
2024-09-30 12:39:51 -05:00
jax authors
f1b3251bf9 Change CLANG_CUDA_COMPILER_PATH set order. Add --config=cuda_clang to build.py
Set `--action_env=CLANG_CUDA_COMPILER_PATH` after cuda_nvcc configuration
Add `--config=cuda_clang` when `--nouse_cuda_nvcc` flag set

PiperOrigin-RevId: 678873849
2024-09-25 15:39:44 -07:00
8bitmp3
60a06fd4c9
Update pillow version in JAX build test-requirements.txt 2024-09-25 14:55:46 +00:00
jax authors
6e116491c1 Add --use_cuda_nvcc flag to enable or disable compilation of CUDA code using NVCC.
If `--use_cuda_nvcc` flag is set the NVCC compiler driver will be used to build the CUDA code (default behavior). Otherwise, if the flag `--nouse_cuda_nvcc` is set, only the clang compiler will be used to build the CUDA code (effectively disabling NVCC).

Mark `--use_clang` flag as deprecated.

Refactor `.bazelrc` configs to match the new flag and to cleanup all previous confusing names.

PiperOrigin-RevId: 678332548
2024-09-24 11:37:00 -07:00
jax authors
0c7c71e640 Update python version from 3.12 to 3.13.0rc2 in Github presubmit jobs.
PiperOrigin-RevId: 676140293
2024-09-18 14:49:42 -07:00
jax authors
8bcdb12852 Add CI jobs for python 3.13.0rc2.
PiperOrigin-RevId: 675758096
2024-09-17 16:51:35 -07:00
Vadym Matsishevskyi
8804be0229 Add Python 3.130rc2 support to the build.
This PR depends on https://github.com/openxla/xla/pull/17169. The change does not fail existing builds, but to be able to use python 3.13 functionality in jax the corresponding XLA pr needs to land first and get integrated with JAX (happens automatically).

PiperOrigin-RevId: 675243989
2024-09-16 12:14:32 -07:00
Mathew Odden
a9e54b3e0a Add docker builds for ubu22 and 24 2024-08-27 16:40:37 -05:00
jax authors
140955dce0 Merge pull request #23224 from ROCm:ci_build_script
PiperOrigin-RevId: 668061975
2024-08-27 11:12:05 -07:00
Ayaka
859eacb5a1 Fix mypy error 2024-08-27 16:57:53 +01:00
Ruturaj4
9ce8de5fb0 [ROCm] add build file. 2024-08-23 18:11:48 -05:00
Mathew Odden
5c2ffa893f * Add conditional docker interactive mode
Interactive causes bazel to output more
useful info when running locally.

* Fix issue with rocm el8 repo urls

Work around quirk with rocm version
when it ends with 0

* Fix package name conflict

Ubu22 and higher have a package name conflict
between the debian versions and the AMD provided
versions.

* [ROCm] Use clang env
2024-08-22 10:08:41 -05:00
Ruturaj4
e06be544d4 [ROCm] improve gpu script 2024-08-19 15:13:58 -05:00
jax authors
3a6ff86df9 Merge pull request #23088 from vfdev-5:update-build-build-py
PiperOrigin-RevId: 663876121
2024-08-16 14:50:57 -07:00
jax authors
3d942ef22e Merge pull request #23086 from ROCm:ci_build_fix
PiperOrigin-RevId: 663769517
2024-08-16 10:17:04 -07:00
vfdev-5
12e8bf4525 Pass bazel options to requirements_update and requirements_nightly_update commands 2024-08-16 11:47:21 +02:00
Ruturaj4
fd7c52d213 [ROCm] Fix python in rocm ci_build script. 2024-08-15 21:33:51 -05:00
jax authors
a498c1e668 Set Clang as the default compiler in the build script.
PiperOrigin-RevId: 663433112
2024-08-15 13:36:15 -07:00
jax authors
599c13aa09 Introduce hermetic CUDA in Google ML projects.
1) Hermetic CUDA rules allow building wheels with GPU support on a machine without GPUs, as well as running Bazel GPU tests on a machine with only GPUs and NVIDIA driver installed. When `--config=cuda` is provided in Bazel options, Bazel will download CUDA, CUDNN and NCCL redistributions in the cache, and use them during build and test phases.

    [Default location of CUNN redistributions](https://developer.download.nvidia.com/compute/cudnn/redist/)

    [Default location of CUDA redistributions](https://developer.download.nvidia.com/compute/cuda/redist/)

    [Default location of NCCL redistributions](https://pypi.org/project/nvidia-nccl-cu12/#history)

2) To include hermetic CUDA rules in your project, add the following in the WORKSPACE of the downstream project dependent on XLA.

   Note: use `@local_tsl` instead of `@tsl` in Tensorflow project.

   ```
   load(
      "@tsl//third_party/gpus/cuda/hermetic:cuda_json_init_repository.bzl",
      "cuda_json_init_repository",
   )

   cuda_json_init_repository()

   load(
      "@cuda_redist_json//:distributions.bzl",
      "CUDA_REDISTRIBUTIONS",
      "CUDNN_REDISTRIBUTIONS",
   )
   load(
      "@tsl//third_party/gpus/cuda/hermetic:cuda_redist_init_repositories.bzl",
      "cuda_redist_init_repositories",
      "cudnn_redist_init_repository",
   )

   cuda_redist_init_repositories(
      cuda_redistributions = CUDA_REDISTRIBUTIONS,
   )

   cudnn_redist_init_repository(
      cudnn_redistributions = CUDNN_REDISTRIBUTIONS,
   )

   load(
      "@tsl//third_party/gpus/cuda/hermetic:cuda_configure.bzl",
      "cuda_configure",
   )

   cuda_configure(name = "local_config_cuda")

   load(
      "@tsl//third_party/nccl/hermetic:nccl_redist_init_repository.bzl",
      "nccl_redist_init_repository",
   )

   nccl_redist_init_repository()

   load(
      "@tsl//third_party/nccl/hermetic:nccl_configure.bzl",
      "nccl_configure",
   )

   nccl_configure(name = "local_config_nccl")
   ```

PiperOrigin-RevId: 662981325
2024-08-14 10:58:43 -07:00
Mathew Odden
fafa03c60f Add missing CPython build deps for pyenv 2024-08-12 15:01:34 -05:00
Mathew Odden
701cda8ebd Fix not finding wheels in bazel output 2024-08-12 15:01:34 -05:00
Mathew Odden
df2d140f51 Fix jenkins notty issue 2024-08-12 15:01:34 -05:00
Mathew Odden
319ebf81c1 Add defaults for ROCm build vars 2024-08-12 15:01:34 -05:00
Mathew Odden
abe44f6d9e Add copyright and license headers to new files 2024-08-12 15:01:34 -05:00
Mathew Odden
a1a0a4ecdd Add support for ROCm development builds
Use get_rocm.py changes in ci_build to pull in
development builds for ROCm.

Specify ROCM_BUILD_JOB and ROCM_BUILD_NUM for
activating the development build path.
2024-08-12 15:01:34 -05:00
Mathew Odden
3175f13c59 Add internal release support to get_rocm.py 2024-08-12 15:01:34 -05:00
Mathew Odden
1e58d76772 [ROCm] Change ROCm builds to manylinux wheels 2024-08-12 15:01:34 -05:00
Jieying Luo
9c2caedab1 Add subdirectories to the output path when building editable wheels for jaxlib and GPU plugin.
When `build_gpu_plugin` is true, three wheels will be produced (jaxlib, jax-cuda-pjrt and jax-cuda-plugin). If they are editable, they need to be placed in subdirectories to avoid overwrite.

Tested on GPU. After the editable wheels are built, they can be installed with `pip install -e /jax/dist/jax_gpu_pjrt /jax/dist/jaxlib /jax/dist/jax_gpu_plugin`.

PiperOrigin-RevId: 660984311
2024-08-08 14:34:55 -07:00
Jieying Luo
abe7982d65 Remove enable_gpu and xla_python_enable_gpu from jax .bazelrc.
The plugin is released and the flag is no longer needed.

Also set default value of enable_gpu to False. enable_gpu will be removed in the next change.

PiperOrigin-RevId: 660059432
2024-08-06 12:39:45 -07:00
Yue Sheng
eb571c984a Fix lint in run_single_gpu.py
PiperOrigin-RevId: 658933291
2024-08-02 16:03:03 -07:00
Rahul Batra
7d6fa3c05b [ROCm]: Add support to continue on fail, fix script paths and update Dockerfile to add necessary packages 2024-08-01 17:55:15 -05:00
Peter Hawkins
7f4ef63cd8 Run pyupgrade --py310-plus.
Also apply manual fixes to import sorting and unused imports.
2024-06-26 16:10:18 -04:00
Peter Hawkins
945fde41e4 Update minimum Python version to 3.10. 2024-06-26 13:47:14 -04:00
Dan Foreman-Mackey
1c640b25cb Fix pre-commit formatting errors
It looks like #21916 introduced some whitespace issues that are causing
our pre-commits to fail.
2024-06-26 06:38:51 -04:00
jax authors
96cf5d53c8 Merge pull request #21916 from ROCm:ci_pjrt
PiperOrigin-RevId: 646793145
2024-06-26 02:43:21 -07:00
Ruturaj Vaidya
385283c50b
Update build.py 2024-06-25 11:31:18 -05:00