Installation¶
Base install¶
jaxrens targets Python 3.11+ and requires JAX with CUDA 12 for GPU execution. On CPU it runs fine but large atomistic runs will be slow.
conda create -n jaxrens python=3.11 -y
conda activate jaxrens
cd /path/to/jaxrens
pip install -e ".[dev]"
This pulls jax[cuda12], jaxlib, numpy, h5py, ASE, pydantic,
pyyaml, and the dev tooling (pytest, pytest-xdist, pre-commit, …).
pip install -e is additive — installing another extra afterwards
doesn’t remove what [dev] already put in the environment, so the
snippets below only add the extra they need. Drop dev from any of
them if you just want to run jaxrens rather than test or contribute
to it.
Optional backends¶
You can either directly install all supported backends via
pip install -e ".[all]"
or install them individually as shown below.
MACE-JAX¶
The [mace] extra installs the runtime MACE backend — everything
needed to load and evaluate a converted JAX model:
pip install -e ".[mace]"
To also convert a Torch MACE checkpoint (or download + convert a
foundation model) into a JAX model, add the [mace-convert] extra,
which pulls the Torch-side mace-torch package the converter imports:
pip install -e ".[mace-convert]"
See the Using MACE models guide for the full download → convert → run workflow.
NeuralIL¶
pip install -e ".[neuralil]"
Pulls a jaxrens-compatible fork (nunglert/neuralil-jaxrens@jaxrens).
Nequix¶
pip install -e ".[nequix]"
Pulls upstream atomicarchitects/nequix@main. Optional backend
that exposes the same EnergyBackend protocol as MACE/NeuralIL;
nequix tests sit behind the nequix pytest marker (off by
default, opt-in via pytest -m nequix).
Docs¶
pip install -e ".[docs]"
Adds Sphinx, Furo, MyST, nbsphinx, jupytext, sphinx-design,
sphinx-copybutton, and autodoc-pydantic. See
Tutorials for the executable tutorials and the
docs README for build instructions.
GPU sanity check¶
python -c "import jax; print(jax.devices())"
Should list one or more CudaDevice(...) entries. If it prints
CpuDevice(...) only, JAX fell back to CPU — check
nvidia-smi, $LD_LIBRARY_PATH, and that jaxlib installed
the CUDA build (pip show jaxlib should show a +cuda12... tag
on the version).
Scratch / temp paths on SLURM¶
Some GPU nodes deny writes to /tmp, which breaks XLA’s PTX
compile cache. SLURM submit scripts can redirect
temp I/O into the job directory via TMPDIR:
export TMPDIR="${PWD}/tmp/${SLURM_JOB_ID:-local}"
export XDG_CACHE_HOME="$TMPDIR/xdg-cache"
export JAX_COMPILATION_CACHE_DIR="${PWD}/.jax_cache"
mkdir -p "$TMPDIR" "$XDG_CACHE_HOME" "$JAX_COMPILATION_CACHE_DIR"
trap 'rm -rf "$TMPDIR"' EXIT
Copy that block into any new submit script before launching JAXRENS.