A lightweight wrapper that scaffolds PyTorch's (Distributed Data) Parallel.
Project description
DDPW
Distributed Data Parallel Wrapper (DDPW) is a lightweight Python wrapper relevant for PyTorch users.
DDPW handles basic logistical tasks such as creating threads on GPUs/SLURM nodes, setting up inter-process communication, etc., and provides simple, default utility methods to move modules to devices and get dataset samplers, allowing the user to focus on the main aspects of the task. It is written in Python 3.13. The documentation contains details on how to use this package.
Overview
Installation
uv add ddpw # with uv
pip install ddpw # with pip
Examples
With the decorator wrapper
from ddpw import Platform, wrapper
platform = Platform(device="gpu", n_cpus=32, ram=64, n_gpus=4, verbose=True)
@wrapper(platform)
def run(*args, **kwargs):
# global and local ranks, and the process group in:
# kwargs['global_rank'], # kwargs['local_rank'], kwargs['group']
...
if __name__ == '__main__':
run(...)
As a callable
from ddpw import Platform, Wrapper
# some task
def run(*args, **kwargs):
# global and local ranks, and the process group in:
# kwargs['global_rank'], # kwargs['local_rank'], kwargs['group']
# platform (e.g., 4 GPUs)
platform = Platform(device='gpu', n_gpus=4)
# wrapper
wrapper = Wrapper(platform=platform)
# start
wrapper.start(task, ('example',))
Status
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ddpw-5.4.0.tar.gz.
File metadata
- Download URL: ddpw-5.4.0.tar.gz
- Upload date:
- Size: 10.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
04c6aa292070e983cdfadf25f967becc3d7022a4406b21d335a651fbcdfc3799
|
|
| MD5 |
50014e180f68af95cb73727335629f71
|
|
| BLAKE2b-256 |
8d6300301a216f16cf6159cee963a57639f673954b746f5384ae82f41f84c6e6
|
File details
Details for the file ddpw-5.4.0-py3-none-any.whl.
File metadata
- Download URL: ddpw-5.4.0-py3-none-any.whl
- Upload date:
- Size: 12.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ebe4dcb2a70d27a23fcf7127a0210a1a557b609412760baf7bfd261a3a6f9db7
|
|
| MD5 |
3dd92361169f8383f6f56b23a09a7523
|
|
| BLAKE2b-256 |
09bf3770364d58f4dd40025e00c9d81aa7af8002a5fda8fb87794beb183f7884
|