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.2.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.2-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: parajax-0.3.2.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","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.2.tar.gz
Algorithm Hash digest
SHA256 e2275e59d2c82c385a81edb3b684629f16386aa96b414bc22cf5f82ac3d3cb40
MD5 4a6c5523f6690293e35b91442db512a5
BLAKE2b-256 b84fa5c101ede5b84bedf2f792f1be1f1c05fadcff5c97bea81f6fd9964a634e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: parajax-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6fdf74294f5d7f3ac0b0c33d450642adac8140d77135f3badd50f4557e71b071
MD5 b8de108028d671ad9ab5e2175ef2856e
BLAKE2b-256 99527e91adfc96895e256bd1ffe5099621511789a337f466bb9b51392f318196

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