DrJAX is a Python library built on JAX that provides scalable and differentiable MapReduce primitives. It enables users to express complex computations over distributed data in a functional, JAX-compatible manner, allowing for automatic differentiation and XLA compilation across various hardware accelerators. The current version is 0.1.4, and it sees regular, minor updates focusing on stability and JAX compatibility.
pip install drjaxVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how to use the core `drjax.map_reduce` primitive to apply a `mapper_fn` to each element in a batched input and then combine the results using a `reducer_fn`. This mimics a distributed MapReduce pattern, even when run on a single device, showcasing its functional interface.
Ensure JAX is installed correctly for your target hardware by following the official JAX installation guide. For CUDA, this often involves `pip install jax[cuda11_pip] -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html`.
When using `drjax.broadcast` in a distributed JAX setup (e.g., with `jax.experimental.pjit`), explicitly define and pass a `jax.sharding.Mesh` object if you need fine-grained control over data placement on your devices. Review the documentation for `drjax.broadcast` and JAX sharding.
If experiencing dependency conflicts, ensure your `absl-py` version is `>=1.2.0` and `chex` is `>=0.1.5`. Consider updating your virtual environment and all related JAX ecosystem libraries to their latest compatible versions.