Skip to main content

Parallelization utilities for JAX

Project description

Parajax

Automagic parallelization of calls to JAX-based functions

Documentation CI Codecov Ruff ty uv Publish PyPI PyPI - Python Version

Features

  • 🚀 Device-parallel execution: run across multiple CPUs, GPUs or TPUs automatically
  • 🧩 Fully composable with jax.jit, jax.vmap, and other JAX transformations
  • 🪄 Automatic handling of input shapes not divisible by the number of devices
  • 🎯 Simple interface: just decorate your function with @parallelize

Installation

pip install parajax

Example

import multiprocessing

import jax
import jax.numpy as jnp
from parajax import parallelize

jax.config.update("jax_num_cpu_devices", multiprocessing.cpu_count())
# ^ Only needed on CPU: allow JAX to use all CPU cores

@parallelize
def square(xs):
    return xs**2

xs = jnp.arange(12_345)
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


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.3.1.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

parajax-0.3.1-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file parajax-0.3.1.tar.gz.

File metadata

  • Download URL: parajax-0.3.1.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for parajax-0.3.1.tar.gz
Algorithm Hash digest
SHA256 894e83188b2f390b13abdacd1745588ca38807b978f68c94237c9a5baceaa342
MD5 e4ff3c14ef788bc267a8adf1f19893a9
BLAKE2b-256 5b8565b1676f92042157f739af5d918f608cb7b75d9db2db296573531b78bf4a

See more details on using hashes here.

File details

Details for the file parajax-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: parajax-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for parajax-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0f6a35b12be30a956d0203fe25cd49e54f4d01ee5b07ab1005061c10b84d6d6f
MD5 4a7fbc7d441a467a1416aaa24ad23d64
BLAKE2b-256 c928c79636d7d1706371f590b410112d87547ab16563e607204bdaebf1af19bc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page