JAX: Difference between revisions

Pigs (talk | contribs)
Remove out of date note, add link to nixpkgs and other wiki pages
Pigs (talk | contribs)
m Example shell.nix with GPU support: syntax highlight code block, additional crosslinking and formatting
 
(One intermediate revision by one other user not shown)
Line 41: Line 41:
You can test that JAX is using the GPU as intended with
You can test that JAX is using the GPU as intended with


  python -c "from jax.lib import xla_bridge; print(xla_bridge.get_backend().platform)"
<syntaxHighlight lang=bash>
# after version 0.8.0
python -c "import jax.extend as ex; print(ex.backend.get_backend().platform)"
   
# before version 0.8.0
python -c "from jax.lib import xla_bridge; print(xla_bridge.get_backend().platform)"
</syntaxHighlight>


It should print either "cpu", "gpu", or "tpu".
It should print either <code>cpu</code>, <code>gpu</code>, or <code>tpu</code>.


Note that hydra may not cache <code>jaxlibWithCuda</code> builds on cache.nixos.org since CUDA is "unfree." @samuela publishes builds on a public cachix [https://app.cachix.org/cache/ploop#pull ploop] cache. These are periodically built and pushed from [https://github.com/samuela/nixpkgs-upkeep/ nixpkgs-upkeep].
{{Note| [[Hydra]] may not cache <code>jaxlibWithCuda</code> builds on cache.nixos.org since CUDA is [[unfree software]]. @samuela publishes builds on a public cachix [https://app.cachix.org/cache/ploop#pull ploop] cache. These are periodically built and pushed from [https://github.com/samuela/nixpkgs-upkeep/ nixpkgs-upkeep].}}


== FAQ ==
== FAQ ==