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.4.tar.gz (48.3 kB view details)

Uploaded Source

Built Distribution

torchrunx-0.1.4-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: torchrunx-0.1.4.tar.gz
  • Upload date:
  • Size: 48.3 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.4.tar.gz
Algorithm Hash digest
SHA256 5793bf3a1963f50f6449661f581a67d8ac565569dd0dc313ad6bc92c639bb702
MD5 22f02657ccb8ab0ed61a8fd76c6c0bb2
BLAKE2b-256 07fd61d9e4f62c9b8fbcf97f4024586abe8605722094642e0c88c4213d63853a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: torchrunx-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 13.4 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7b26cd5f25e4736b345751e9fd4327cc844ee62e87b74e142a98f1c30ec4ec6c
MD5 70d195e2c835a63438f96ac3ff17d8b7
BLAKE2b-256 0240a0533c5cb39d8ebc1cb56be9c8e51b949ffe8f6fe64d5b538681924c78ad

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