Skip to main content

Dmlcloud Logo

PyPI Status Documentation Status Test Status

A torch library for easy distributed deep learning on HPC clusters. Supports both slurm and MPI. No unnecessary abstractions and overhead. Simple, yet powerful, API.

Highlights

  • Simple, yet powerful, API
  • Easy initialization of torch.distributed
  • Distributed metrics
  • Extensive logging and diagnostics
  • Wandb support
  • Tensorboard support
  • A wealth of useful utility functions

Installation

dmlcloud can be installed directly from PyPI:

pip install dmlcloud

Alternatively, you can install the latest development version directly from Github:

pip install git+https://github.com/sehoffmann/dmlcloud.git

Documentation

You can find the official documentation at Read the Docs

Minimal Example

See examples/mnist.py for a minimal example on how to train MNIST with multiple GPUS. To run it with 4 GPUs, use

dmlrun -n 4 python examples/mnist.py

dmlrun is a thin wrapper around torchrun that makes it easier to prototype on a single node.

Slurm Support

dmlcloud automatically looks for slurm environment variables to initialize torch.distributed. On a slurm cluster, you can hence simply use srun from within an sbatch script to train on multiple nodes:

#!/bin/bash
#SBATCH --nodes=2
#SBATCH --ntasks-per-node=4
#SBATCH --gpus-per-node=4
#SBATCH --cpus-per-task=8
#SBATCH --gpu-bind=none

srun python examples/mnist.py

FAQ

How is dmlcloud different from similar libraries like pytorch lightning or fastai?

dmlcloud was designed foremost with one underlying principle:

No unnecessary abstractions, just help with distributed training

As a consequence, dmlcloud code is almost identical to a regular pytorch training loop and only requires a few adjustments here and there. In contrast, other libraries often introduce extensive API's that can quickly feel overwhelming due to their sheer amount of options.

For instance, the constructor of ligthning.Trainer has 51 arguments! dml.Pipeline only has 2.

Metadata

Release files for dmlcloud 0.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dmlcloud 0.5.1
File Size Uploaded
dmlcloud-0.5.1.tar.gz 193.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dmlcloud 0.5.1
File Interpreter ABI Platform
dmlcloud-0.5.1-py3-none-any.whl Python 3 none any Details

Total release size: 239.4 kB

Release files / dmlcloud-0.5.1.tar.gz

Download URL dmlcloud-0.5.1.tar.gz
Size 193.1 kB
Tags Source
SHA-256 checksum
How to use checksums
26ad61e2ce636c68188099780866cc042f188666f2fa1b6eae3c12f5bb69814b
BLAKE2b-256 checksum
How to use checksums
f05b03d6b9ab370c7c432cdb3f07d43ea7d4f4f1d97974d727643f924bc99e4f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.5

Release files / dmlcloud-0.5.1-py3-none-any.whl

Download URL dmlcloud-0.5.1-py3-none-any.whl
Size 46.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9be5a8026bd8f55ade019daa9178352306270e7eddfa1673e70529f2144f0b3e
BLAKE2b-256 checksum
How to use checksums
426695cebd90852aa73ce137912676fe043d1b7730f7c14d654c4ce5f87124b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.5

Release history Release notifications | RSS feed

This release

0.5.1 This release

2 release files

0.5

2 release files

0.4

1 release file

0.3.3

1 release file

0.3.2

1 release file

0.3.1

1 release file

0.3.0

1 release file

0.1.1

1 release file

0.1

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page