Summary
Hi Astral team, thanks for the amazing work on uv!
Motivation
uv’s PyTorch integration supports automatic backend selection via --torch-backend=auto and UV_TORCH_BACKEND, which transparently installs the appropriate wheels (CPU / CUDA / ROCm / XPU) and switches to the correct PyTorch index. This has been a game-changer for reproducible installs across heterogeneous machines.
The JAX community is growing quickly, and many projects need to “do the right thing” depending on user hardware (CPU vs NVIDIA CUDA). Today this requires manually choosing extras like jax[cuda12] or jax[cuda12-local], which is error-prone for non-experts and complicates distribution.
Proposal
Provide an auto backend selection for JAX, analogous to PyTorch:
-
CLI
uv pip install "jax" --jax-backend=auto
uv add jax --jax-backend=auto
-
Config
[tool.uv.pip]
jax-backend = "auto" # cpu | cuda12 | cuda12-local | auto
-
Env var
Expected behavior
- Inspect the environment (e.g., presence of NVIDIA drivers /
libcuda, compatible CUDA runtime) and select the appropriate JAX variant.
- If compatible CUDA is available → install
jax[cuda12] (or jax[cuda12-local]) according to JAX’s release mapping; otherwise fall back to CPU.
- Ensure reproducibility: the resolved variant should be captured in
uv.lock with index/marker annotations similar to PyTorch.
Notes
- JAX release notes indicate current CUDA baseline (e.g., CUDA 12.8) and extras naming conventions (recently
cuda12_local → cuda12-local). This variability reinforces the need for an “auto” path that stays aligned with upstream.
Thanks for considering JAX parity with the fantastic PyTorch integration!
Example
No response
Summary
Hi Astral team, thanks for the amazing work on uv!
Motivation
uv’s PyTorch integration supports automatic backend selection via
--torch-backend=autoandUV_TORCH_BACKEND, which transparently installs the appropriate wheels (CPU / CUDA / ROCm / XPU) and switches to the correct PyTorch index. This has been a game-changer for reproducible installs across heterogeneous machines.--torch-backendUV_TORCH_BACKENDThe JAX community is growing quickly, and many projects need to “do the right thing” depending on user hardware (CPU vs NVIDIA CUDA). Today this requires manually choosing extras like
jax[cuda12]orjax[cuda12-local], which is error-prone for non-experts and complicates distribution.Proposal
Provide an auto backend selection for JAX, analogous to PyTorch:
CLI
uv pip install "jax" --jax-backend=auto uv add jax --jax-backend=autoConfig
Env var
Expected behavior
libcuda, compatible CUDA runtime) and select the appropriate JAX variant.jax[cuda12](orjax[cuda12-local]) according to JAX’s release mapping; otherwise fall back to CPU.uv.lockwith index/marker annotations similar to PyTorch.Notes
cuda12_local→cuda12-local). This variability reinforces the need for an “auto” path that stays aligned with upstream.Thanks for considering JAX parity with the fantastic PyTorch integration!
Example
No response