Skip to main content

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

Reason this release was yanked:

Constructs use Python 3.13

Project description

DDPW

Distributed Data Parallel Wrapper (DDPW) is a lightweight Python wrapper 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.12. 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.1.1.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.1.1-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ddpw-6.1.1.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","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.1.1.tar.gz
Algorithm Hash digest
SHA256 871f4c00a33ae5761e489c9387869d61779d5525488a636f9d591cdf2025183a
MD5 e05b7ef8d729ff6584e405f0ce84b211
BLAKE2b-256 10994a3d71c19ee850257f3a704df4054c4a28cf6cc91432ca44851aa2239606

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ddpw-6.1.1-py3-none-any.whl
  • Upload date:
  • Size: 13.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","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.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 64af01dfc75e26de4a0335217fc704b6e43022bc0deda1c2fea6dff77b01ad1c
MD5 3d002ce13eee4cd9487bdf48b976a800
BLAKE2b-256 357cbb9f714d59b72606f9edbcb3dfe2252ce5a35b3799e8dd7a2d0dc1950ded

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