Skip to main content

A lightweight wrapper that scaffolds PyTorch's Distributed (Data) Parallel.

Project description

DDPW

Distributed Data Parallel Wrapper (DDPW) is a lightweight Python wrapper relevant to 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

PyPI

# with uv

# to instal and add to pyroject.toml
uv add [--active] ddpw
# or to simply instal
uv pip install ddpw

# with pip
pip install ddpw

Examples

With the decorator wrapper

from ddpw import Platform, wrapper

platform = Platform(device="gpu", n_cpus_per_node=32, mem_per_node=64, n_gpus_per_node=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']
    pass

if __name__ == '__main__':
    run(*args, **kwargs)

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']
    pass

if __name__ == '__main__':
    # platform (e.g., 4 GPUs)
    platform = Platform(device='gpu', n_gpus_per_node=4)

    # wrapper
    wrapper = Wrapper(platform=platform)

    # start
    wrapper.start(task, *args, **kwargs)

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

ddpw-6.0.0.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ddpw-6.0.0-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

Details for the file ddpw-6.0.0.tar.gz.

File metadata

  • Download URL: ddpw-6.0.0.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for ddpw-6.0.0.tar.gz
Algorithm Hash digest
SHA256 f7fd0c79fe458b489cab83874e737e9b542bfe72ad6909c5cb66a1949b2861d1
MD5 1eb76ff13c864921e4135119cbf630b2
BLAKE2b-256 3a5a48dc180ef0456f5d4b7a63b981fbc8c37f28a93852bd39141af7f6813de9

See more details on using hashes here.

File details

Details for the file ddpw-6.0.0-py3-none-any.whl.

File metadata

  • Download URL: ddpw-6.0.0-py3-none-any.whl
  • Upload date:
  • Size: 13.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for ddpw-6.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 518b6f2f0e9e9013ffdf60f8772407e93b23ac50e45aaf08972e3b007fd9f359
MD5 01ed96482d7195c1beac595c6b3f40a6
BLAKE2b-256 83a66d1592248cb4e41165b2b6a017316e2d851813291d2f56e217fd94362c08

See more details on using hashes here.

Supported by

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