Skip to main content

PMIx bootstrap method for modern AI/ML applications

Project description

Rixa

Rixa (Runtime Initialization by pmiX Adoption) is a high-performance library that provides a unified and efficient way to bootstrap distributed PyTorch jobs. It leverages PMIx 5.0 to seamlessly launch PyTorch workloads on large-scale HPC clusters, eliminating the need to manually specify the master IP address and port.

Why Rixa?

Standard PyTorch bootstrapping (TCP/File-store) is built for cloud portability but often struggles with scale and reliability on bare-metal HPC clusters. rixa bypasses these overheads by using PMIx as a native high-performance key-value store, providing

  1. Zero-config Launching: No master IP/Port orchestration required.

  2. HPC Native: Leverages existing Slurm, Flux, or OpenMPI environments.

  3. ABI Compatibility: Built on PMIx 5.0+ (ABI stable), ensuring portability across different MPI/PMIx versions.

Instalation

In order to install one needs to specify the version of the library. Currently two versions are supported, pytorch and nvshmem. They can be easily installed with

# Install for PyTorch support
pip install "rixa[pytorch]"

# Install for NVSHMEM support
pip install "rixa[nvshmem]"

Usage (PyTorch)

One can use rixa to start pytorch distributed job with one simple line

import rixa
rixa.pytorch.init_process_group(pytorch_argument1, pytorch_argument2, keyword2=pytorch_parameter)

Jobs can be launched with any PMIx 5.0-compatible plugin, starting with prrte, some MPI implementations (OpenMPI 5.0), native job launcher plugins to SLURM or Flux. Example:

prterun -n 16 python3 -c "import rixa; rixa.pytorch.init_process_group(); import torch; print(torch.distributed.get_rank())"

Remember to manually finalize the backend!

torch.distributed.destroy_process_group()

Usage (NVSHMEM)

Nvshmem usage is very simillar to the pytorch usage, one needs to use a thin wrapper around the native nvshmem init. Example:

import rixa
from cuda.core import Device

store = rixa.PMIxStore(30) #manualy specify the PMIx backend with manual timeout, can become handy to set the device
dev = Device(0) #first device or just set based on the use case
rixa.nvshmem.init(dev, store) #device, store

Remember to manually finalize the backend!

nvshmem.finalize()

Development

Library can be compiled from source with standard setuptools and requires PMIx library supporting version >5.0. Development of the package is managed with pixi that can be used to also bring all necessary libraries for testing and development. It can be locally tested using prrte and more recently with OpenMPI provided by pixi. To build and test the library one can use commands provided in pixi.toml.

pixi run build  #downloads everything and builds
pixi run test   #launches pytest and uses openmpi>5.0 to launch the test
pixi run ci     #does both at the same time

Alternatively, one can use pixi build to compile a conda package.

Roadmap

  • Support for NVSHMEM (pytorch, cupy)
  • Support for JAX

PMIx

One of the most common ways to bootstrap massive distributed programs is to use Process Management Interface (exascale), PMIx for short. It was designed to launch massive MPI jobs accross enourmous HPC clusters, some achieving exascale performance. It is integrated with the SLURM job scheduler and can selected to be a default launching mechanism. Moreover, the 5th version it is ABI compatible. Hence, it avoids various problems related to the MPI-based programs (for example, mpi4py needs to be compiled against specific MPI version). This makes this particular approach promising to achieve a platform-independent launching mechanism for PyTorch distributed jobs on modern HPC clusters.

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

rixa-0.0.2.dev0.tar.gz (46.0 kB view details)

Uploaded Source

Built Distributions

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

rixa-0.0.2.dev0-cp314-cp314-musllinux_1_2_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.14musllinux: musl 1.2+ x86-64

rixa-0.0.2.dev0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

rixa-0.0.2.dev0-cp313-cp313-musllinux_1_2_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

rixa-0.0.2.dev0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

rixa-0.0.2.dev0-cp312-cp312-musllinux_1_2_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

rixa-0.0.2.dev0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

rixa-0.0.2.dev0-cp311-cp311-musllinux_1_2_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

rixa-0.0.2.dev0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

rixa-0.0.2.dev0-cp310-cp310-musllinux_1_2_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

rixa-0.0.2.dev0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

File details

Details for the file rixa-0.0.2.dev0.tar.gz.

File metadata

  • Download URL: rixa-0.0.2.dev0.tar.gz
  • Upload date:
  • Size: 46.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for rixa-0.0.2.dev0.tar.gz
Algorithm Hash digest
SHA256 63d353780c4e7f5b04cadfabe97beb3ebfd16d3bbeaea6c1088dd76c9607d928
MD5 e84c1f7b41e9f3c3cc484a4a019a8b0f
BLAKE2b-256 9edcfb87e51d56b4e5089adb3962e111dda776152e2307fdfda596280bcf276c

See more details on using hashes here.

File details

Details for the file rixa-0.0.2.dev0-cp314-cp314-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for rixa-0.0.2.dev0-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 93a603f32028421c90d075b753744d890f21810c3b0a2a01cea5be74c696c56f
MD5 84878a0337698c331b66faaf70cc4e1a
BLAKE2b-256 44012258d1351cd8e5162603ac3d2e3db605c7b9e88373ba72158090a21f3811

See more details on using hashes here.

File details

Details for the file rixa-0.0.2.dev0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for rixa-0.0.2.dev0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ce376299e996ea6ad1b3dd63cc112fa4bc311a249ba9ac688f3c778ecf74f35e
MD5 af96d6c58e0fa1b0838560fd36764715
BLAKE2b-256 da4f081925714c0d4b020e8762a37a434761d97b846ca76c954bca33ef5e9d28

See more details on using hashes here.

File details

Details for the file rixa-0.0.2.dev0-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for rixa-0.0.2.dev0-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 f943f4d2df33d4ed39cf1f8dff45f0f1837bd2b86dbb3706959e8f280fbf3551
MD5 ffd047006e8e88db93e9fa656323443c
BLAKE2b-256 6459ea8ab661cf534f226634b78fa98f98a271990a6e41973a40ce13311681c6

See more details on using hashes here.

File details

Details for the file rixa-0.0.2.dev0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for rixa-0.0.2.dev0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ce2c9df116bf6e8da8b47c85e74f75fb732f81d1bc6d71d3d7e55a1a647b6a72
MD5 1ab5e121c6a4e0a42122a9b94f98c2fb
BLAKE2b-256 8c4843a7e7bf86465a0d60534249af851a6eb0bad9b6216f52253ad835667062

See more details on using hashes here.

File details

Details for the file rixa-0.0.2.dev0-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for rixa-0.0.2.dev0-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 6deffec3c84ee667eb07280e0b26ce7d7668e1fa84ae81e1def627e4e6d19af5
MD5 5e6c545a30e9407803b351482da197a8
BLAKE2b-256 27e5591e565366ef9bcf2656e3b25f2a922ad5fff628e34b45d04d77cbd984c7

See more details on using hashes here.

File details

Details for the file rixa-0.0.2.dev0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for rixa-0.0.2.dev0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 19f69e21d19aa52881350029b1e42582a9df83daa56dc8faf0a9435c55e4dd1b
MD5 68279edc52c5d397347fb5d5e4b42640
BLAKE2b-256 a7449fcb4922d9c91744466026aae5bde52921a1945642c30db81298776dff86

See more details on using hashes here.

File details

Details for the file rixa-0.0.2.dev0-cp311-cp311-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for rixa-0.0.2.dev0-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 4397f83390d43971eca894fc353b1d6d93178225ede76313b3e1dc63d360f27d
MD5 7cb8c993067bb3103ca7921bfd7a0555
BLAKE2b-256 7bec68bc9fbc09c1b49498b92018adf850d80f0794f814748ab2c0e4607e5e45

See more details on using hashes here.

File details

Details for the file rixa-0.0.2.dev0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for rixa-0.0.2.dev0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a6dcce3a885c086a33d488cb7d5da5d0d8e4b261b0a6970ec694de287bf59b5a
MD5 c4fe84a9ce4a58e98c96d045a483a6bb
BLAKE2b-256 87662f5cdbd303ee3d1c39d1ce015d5816a87130d07f4ccfb1ed11cbfd1d8099

See more details on using hashes here.

File details

Details for the file rixa-0.0.2.dev0-cp310-cp310-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for rixa-0.0.2.dev0-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 1cb44a12319a5ebb862745e1ceeb8b05e48180d0ee0f4532fc1f17adf47bacc9
MD5 eb36dc13f65b73c2fc4094e4ac570ce1
BLAKE2b-256 2eca88673960d9bddf154968b493919bc4d6494a38fed4f6fb30447fd9e1fba8

See more details on using hashes here.

File details

Details for the file rixa-0.0.2.dev0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for rixa-0.0.2.dev0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1a2e8426a06fabe550205f32c1f912573cf53f19ceed05f82e5b987d45e101e9
MD5 ccd44c71e7b2f95d7f6d06957b0e17fa
BLAKE2b-256 0787e36b58b26a93d5808e55e29a41125f30d4565abc52c3e9b8b958b61ce518

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