Skip to main content

Automatically initialize distributed PyTorch environments

Project description

torchrunx 🔥

PyPI - Python Version PyPI - Version Tests Docs GitHub License

Automatically launch functions and initialize distributed PyTorch environments on multiple machines

Installation

pip install torchrunx

Requirements:

  • Operating System: Linux
  • Python >= 3.8.1
  • PyTorch >= 2.0
  • Shared filesystem & passwordless SSH between hosts

Usage

# Simple example
def distributed_function():
    pass
import torchrunx as trx

trx.launch(
    func=distributed_function,
    func_kwargs={},
    hostnames=["node1", "node2"],  # or just: ["localhost"]
    workers_per_host=2
)

In a SLURM allocation

trx.launch(
    # ...
    hostnames=trx.slurm_hosts(),
    workers_per_host=trx.slurm_workers()
)

Compared to other tools

Contributing

We use the pixi package manager. Simply install pixi and run pixi shell in this repository. We use ruff for linting and formatting, pyright for static type checking, and pytest for testing. We build for PyPI and conda-forge. Our release pipeline is powered by Github Actions.

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

torchrunx-0.1.3.tar.gz (45.6 kB view details)

Uploaded Source

Built Distribution

torchrunx-0.1.3-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file torchrunx-0.1.3.tar.gz.

File metadata

  • Download URL: torchrunx-0.1.3.tar.gz
  • Upload date:
  • Size: 45.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.1

File hashes

Hashes for torchrunx-0.1.3.tar.gz
Algorithm Hash digest
SHA256 8326c7f68908799f19863289c0f8b7e1ece0f0d73acf09fe7c4fd81779edd269
MD5 55c3e29b0ac0a5bb757cc24bdea7c47b
BLAKE2b-256 7db85f3a1bfdcc3b7ebba8e0d1c595b60942954670a8b342bd58fae1d83307df

See more details on using hashes here.

File details

Details for the file torchrunx-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: torchrunx-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.1

File hashes

Hashes for torchrunx-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8c6d138b56ff5a2ac7b5e1d4391534ed8ea1119c3f669ef6da691160b81faf2d
MD5 8374e33986ee111353ee56a5a5f118b2
BLAKE2b-256 4e292e8bb7bf2c588f7debf7a9efe33e56509f312264e16bfadc5ba2bb71113e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page