Parallelization utilities for JAX
Project description
Parajax
Automagic parallelization of calls to JAX-based functions
Features
- 🚀 Device-parallel execution: run across multiple CPUs, GPUs or TPUs automatically
- 🔄 Drop-in replacement for
jax.vmap - ⚡ JIT-compatible: works with
jax.jitand variants - 🪄 Transparent padding when batch sizes aren’t divisible by number of devices
- 🎯 Simple interface: just decorate your function with
pvmap
Installation
pip install parajax
Example
import multiprocessing
import jax
import jax.numpy as jnp
from parajax import pvmap
jax.config.update("jax_num_cpu_devices", multiprocessing.cpu_count())
# ^ Only needed on CPU: allow JAX to use all CPU cores
@pvmap
def square(x: float) -> float:
return x**2
xs = jnp.arange(97)
ys = square(xs)
That's it! Invocations of square will now be automatically parallelized across all available devices.
Documentation
For more details, check out the documentation.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
parajax-0.1.2.tar.gz
(7.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file parajax-0.1.2.tar.gz.
File metadata
- Download URL: parajax-0.1.2.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.8.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
44b397b262445e63d55c606c1d4999768e60154c5ce168e0871e595c19009005
|
|
| MD5 |
6a72da2b9e1b1f5dc23e49c81ac21511
|
|
| BLAKE2b-256 |
7884d6ff95821a7d7f309877e2750f4227e5858fc5260f48c47bded95c70a68d
|
File details
Details for the file parajax-0.1.2-py3-none-any.whl.
File metadata
- Download URL: parajax-0.1.2-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.8.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3be41703bec98d7744f88df44cb425af9a8c3dff8b8738d441706564944a4378
|
|
| MD5 |
c9066501d1fee7e775e7cacc89e0cdbd
|
|
| BLAKE2b-256 |
df58a325b05afd71f9c1bf53d6ab3486f26f3a8c9cb6e689961b641bf404bc17
|