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.2.tar.gz (8.3 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.2-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for parajax-0.2.2.tar.gz
Algorithm Hash digest
SHA256 1324202c41d7bd29620ed67e3d83501659c48fb81b7c38be83d9215bdb63cbe5
MD5 af2277c107d92190d2f0fee38f14fa1e
BLAKE2b-256 0e7243fac75e7d497989f0445b130ad4d4f25adb50726b3a88fadbc7bd0fa4ed

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for parajax-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0c297c32706d6aceca8ed96c3fa63b611bb4776e257b9ca6da822207d4a91ad5
MD5 e4d240661a482e739df300454b84bd8d
BLAKE2b-256 bfbe8cc632ab4430472021de3d971f4029b21a9eb341b843b07756f972b29df5

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