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 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.2.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.2-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ddpw-6.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 6012d0742300e02ae2e252970d975da8952c8d95c4d726fba3dbe492d6d665d8
MD5 1a1706aa97c82c3957e54afdce525354
BLAKE2b-256 95e7bdea08b582830decb83e346a389b76ebd1aa8eb53199be7b691c43930a07

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ddpw-6.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1157892e2c5a99d469783e5b29d4b1f4c7b10a66a0969b322844adfc551cd67c
MD5 78b050c2d87927ab4fa424f0c1ecc664
BLAKE2b-256 3da201d44edee31064e3da7e35a8ba5c805da8f4dba32148ee29b25c5e78250f

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