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.10. The documentation contains details on how to use this package.
Overview
Installation
conda install ddpw -c tvsujal # with conda
pip install ddpw # with pip from PyPI
Usage
from ddpw import Platform, Wrapper
# some task
def task(global_rank, local_rank, group, args):
print(f'This is GPU {global_rank}(G)/{local_rank}(L); args = {args}')
# 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
File details
Details for the file ddpw-5.3.0.tar.gz
.
File metadata
- Download URL: ddpw-5.3.0.tar.gz
- Upload date:
- Size: 12.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c943736b6d38baf2190b49cde23df22b255a8d3406264c6d934d13a6740e4df |
|
MD5 | a1ae2cf63cd35c73db2fad6a8385ee3e |
|
BLAKE2b-256 | 3588795f33ea50a75e3af9b224ddd971460fed6bcb9e7b5412c353e167d9dd6b |
File details
Details for the file ddpw-5.3.0-py3-none-any.whl
.
File metadata
- Download URL: ddpw-5.3.0-py3-none-any.whl
- Upload date:
- Size: 12.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49ac0dc00811e46cd0296e7fd4e7296ad58f34f755933469f11593531d91d5ce |
|
MD5 | 126a8e2a716a9a384904fa6b9eb26d46 |
|
BLAKE2b-256 | 410fb2641defa42d378fe412002970906682a2cc016119afb053cb0ef3c27d4e |