Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

distai

Package for the book Distributed AI Systems: A practical guide to building scalable training, inference, and serving systems for production AI.

Distributed AI Systems cover

Distributed PyTorch helpers for process setup, synchronized logging, and small model utilities.

Install

Install from PyPI:

pip install distai

Quick Usage

torchrun --nproc_per_node=4 your_script.py
from distai import init_distributed, sync_print

rank, world_size, device, local_rank = init_distributed(use_cpu=False)
sync_print(f"Rank {rank} says hello", rank=rank, world_size=world_size)

Without torchrun

from distai import run_distributed


def my_worker(rank, world_size, device, local_rank):
    print(f"Rank {rank} running on {device}")


run_distributed(my_worker, world_size=4, use_cpu=False)

See example_no_torchrun.py for a complete runnable example.

Public API

  • init_distributed
  • sync_print
  • run_distributed
  • get_node_info
  • setup_distributed
  • cleanup_distributed
  • get_resnet18_fashionmnist
  • get_resnet18_cifar10

Metadata

Release files for distai 0.0.1.dev1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for distai 0.0.1.dev1
File Interpreter ABI Platform
distai-0.0.1.dev1-py3-none-any.whl Python 3 none any Details

Release files / distai-0.0.1.dev1-py3-none-any.whl

Download URL distai-0.0.1.dev1-py3-none-any.whl
Size 11.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f2099997a6244793a441f7ba772482d8d4df1c990705bbb91e930b702011470a
BLAKE2b-256 checksum
How to use checksums
a2f9f2e6c5737a2ec476961efe8156c63f02502fa7f3f8cc7a9a854121a7a2c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Security for distai 0.0.1.dev1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page