Registry / data / drjax
library0.2.0pypypi✓ verified 84d ago

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 drjax
INSTALL
IMPORT
SIG · DRJAX
D
drjax
datapythonv0.2.0
Install
12.5s avg
Import
Disk
605MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.2.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
build_error
glibc
py 3.103.910 runs
installs and imports cleanly · install 12.5s · import 0.000s · 586MB
605MB installed
● package 605MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

map_fn
from drjax import map_fn
from drjax import map_reduce
reduce_sum
from drjax import reduce_sum
broadcast
from drjax import broadcast

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.

import jax import jax.numpy as jnp from drjax import map_reduce # Define the 'map' function: square an item def mapper_fn(item): return item ** 2 # Define the 'reduce' function: sum two items def reducer_fn(a, b): return a + b # Generate some input data across 'shards' # For a single device, this is just a batch dimension num_shards = 4 num_items_per_shard = 10 data = jnp.arange(num_shards * num_items_per_shard).reshape(num_shards, num_items_per_shard) # Use map_reduce to apply mapper_fn to each item, then reducer_fn across results result = map_reduce( mapper_fn=mapper_fn, reducer_fn=reducer_fn, inputs=data ) print(f"Input data shape: {data.shape}") print(f"Input data (first shard): {data[0]}") print(f"Result: {result}") # Expected result: jnp.sum(jnp.arange(40)**2) == 21090
Debug
Known issues
gotchaDrJAX heavily relies on a correctly configured JAX environment. Issues with JAX installation, especially for specific hardware (GPU/TPU), will manifest as errors in DrJAX.
fix
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`.
affects: All versions
gotchaAs of v0.1.4, `drjax.broadcast` can now accept a `mesh` argument for explicit sharding control. While not strictly a breaking change for existing code, ignoring or misconfiguring sharding in distributed setups can lead to unexpected data placement or performance bottlenecks.
fix
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.
affects: >=0.1.4
gotchaDependency pinning for `absl-py` and `chex` changed from 'compatible release' (`~=`) to 'minimum version' (`>=`) in v0.1.2. Users with strict, older dependency pins might encounter conflicts during installation.
fix
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.
affects: >=0.1.2
Upgrade
Version history
0.2.0latest on PyPI · released Jun 15, 2026
Audit
Dependencies
jaxrequiredCore dependency for numerical computation and automatic differentiation. Specific JAX versions are required for compatibility.
absl-pyrequiredGoogle's Python Common Libraries, used for various utilities.
chexrequiredCollection of utilities for JAX, often used in JAX ecosystem libraries for testing and assertions.
Agent activity
17 hits · last 30 days
node
14
OpenAI (training)
1
Resources
drjax — pip install drjax · libregistry