Skip to main content

Parallelization utilities for JAX

Project description

Parajax

Automagic parallelization of calls to JAX-based functions

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 autopmap

Installation

pip install parajax

Example

import multiprocessing

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

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

@autopmap
def square(x):
    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


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.2.0.tar.gz (8.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.2.0-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: parajax-0.2.0.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.8.22

File hashes

Hashes for parajax-0.2.0.tar.gz
Algorithm Hash digest
SHA256 dcc9d0091d12dab6b93ede41888a5806ed001d7bda3951d6518a4476ce88c477
MD5 888d44e2a87aea143946236a442ebfe7
BLAKE2b-256 96daef9ba568a6dacdb8212581576d1cfdf2afc2a46b3b96efdb64e55da97f54

See more details on using hashes here.

File details

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

File metadata

  • Download URL: parajax-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.8.22

File hashes

Hashes for parajax-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ddd1e2c21a6e13812179acb007674a0af9b3606d7b619974e94e6d043f646e8a
MD5 04cc368417168529aead2af1baf1acb0
BLAKE2b-256 4eef99a563dbe8f75bf2e6f70d7c47a37ca59a02d9ee32d4b14d027bd4c187e1

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