Automatically initialize distributed PyTorch environments
Project description
torchrunx 🔥
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.2.tar.gz
(36.0 kB
view details)
Built Distribution
torchrunx-0.1.2-py3-none-any.whl
(10.1 kB
view details)
File details
Details for the file torchrunx-0.1.2.tar.gz
.
File metadata
- Download URL: torchrunx-0.1.2.tar.gz
- Upload date:
- Size: 36.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eedd5d6b166603258b373931f9017e584b46ab87676f997e261180389a966202 |
|
MD5 | 9e910f7d725d6551683b29c9ff7e04d5 |
|
BLAKE2b-256 | e28d9aa44a46c5fdff3eb34e8f2acdb3684d883c3c6233e1f6651743c929033f |
File details
Details for the file torchrunx-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: torchrunx-0.1.2-py3-none-any.whl
- Upload date:
- Size: 10.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0db98884c715311a82b39188b309f996d865d6997b435a2a2eff9291e9ddd828 |
|
MD5 | 528b1ee0dc20bbb63452a3165c000994 |
|
BLAKE2b-256 | 417b11994bc0d03bee48201203fa7a52ec88db76e9b8856def569dd6541dc87a |