d9d - d[istribute]d - distributed training framework based on PyTorch that tries to be efficient yet hackable
Project description
title: Home
The d9d Project
d9d is a distributed training framework built on top of PyTorch 2.0. It aims to be hackable, modular, and efficient, designed to scale from single-GPU debugging to massive clusters running 6D-Parallelism.
Installation
Just use your favourite package manager:
pip install d9d
poetry add d9d
uv add d9d
Extras
d9d[aim]: Aim experiment tracker integration.d9d[visualization]: Plotting libraries required to some advanced visualization functionality.d9d[moe]: Efficient Mixture of Experts GPU kernels. You should build and install some dependencies manually before installation: DeepEP, grouped-gemm.d9d[cce]: Efficient Fused Cross-Entropy kernels. You should build and install some dependencies manually before installation: Cut Cross Entropy.
Why another framework?
Distributed training frameworks such as Megatron-LM are monolithic in the way you run a script from the command line to train any of a set of predefined models, using predefined regimes. While powerful, these systems can be difficult to hack and integrate into novel research workflows. Their focus is often on providing a complete, end-to-end solution, which can limit flexibility for experimentally-driven research.
Conversely, creating your own distributed training solution from scratch is tricky. You have to implement many low-level components (like distributed checkpoints and synchronization) that are identical across setups, and manually tackle common performance bottlenecks.
d9d was designed to fill the gap between monolithic frameworks and homebrew setups, providing a modular yet effective solution for distributed training.
What d9d is and isn't
In terms of core concept:
- IS a pluggable framework for implementing distributed training regimes for your deep learning models.
- IS built on clear interfaces and building blocks that may be composed and implemented in your own way.
- IS NOT an all-in-one CLI platform for setting up pre-training and post-training like torchtitan, Megatron-LM, or torchforge.
In terms of codebase & engineering:
- IS built on a strong engineering foundation: We enforce strict type-checking and rigorous linting to catch errors before execution.
- IS reliable: The framework is backed by a suite of over 450 tests, covering unit logic, integration flows, and End-to-End distributed scenarios.
- IS eager to use performance hacks (like DeepEp or custom kernels) if they improve MFU, even if they aren't PyTorch-native.
- IS NOT for legacy setups: We do not maintain backward compatibility with older PyTorch versions or hardware. We prioritize simplicity and modern APIs (like
DTensor).
Key Philosophies
To achieve the balance between hackability and performance, d9d adheres to specific design principles:
- Composition over Monoliths: We avoid "God Classes" like
DistributedDataParallelorParallelDimsthat assume ownership of the entire execution loop. Instead, we provide composable and extendable APIs. For instance, specific horizontal parallelism strategies for specific layers (parallelize_replicate,parallelize_expert_parallel, ...). - White-Box Modelling: We encourage standard PyTorch code. Models are not wrapped in obscure metadata specifications; they are standard
nn.Modules that implement lightweight protocols. - Pragmatic Efficiency: While we prefer native PyTorch, we are eager to integrate non-native solutions if they improve MFU. For example, we implement MoE using DeepEp communications, reindexing kernels from Megatron-LM, and efficient grouped-GEMM implementations.
- Graph-Based State Management: Our IO system treats model checkpoints as directed acyclic graphs. This allows you to transform architectures (e.g., merging
q,k,vintoqkv) on-the-fly while streaming from disk, without massive memory overhead. - DTensors: We mandate that distributed parameters be represented as
torch.distributed.tensor.DTensor. This simplifies checkpointing by making them topology-aware automatically. We leverage modern PyTorch 2.0 APIs (DeviceMesh) as much as possible.
Examples
Qwen3-MoE Pretraining
An example showing causal LM pretraing for the Qwen3-MoE model.
WIP: MoE load balancing is currently work in progress.
Link.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file d9d-0.2.1.tar.gz.
File metadata
- Download URL: d9d-0.2.1.tar.gz
- Upload date:
- Size: 151.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
94f177ce607c5ed15e363bd8d56cc89d9f90957d9fb8ba59ed1faf151d4676de
|
|
| MD5 |
4ee6ac9946970a88dab5a434539a1fdd
|
|
| BLAKE2b-256 |
bb7d6b82ef12efd48e35ced10015f6943065ec2698306f4c2607528b58e91b8c
|
Provenance
The following attestation bundles were made for d9d-0.2.1.tar.gz:
Publisher:
release.yml on d9d-project/d9d
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
d9d-0.2.1.tar.gz -
Subject digest:
94f177ce607c5ed15e363bd8d56cc89d9f90957d9fb8ba59ed1faf151d4676de - Sigstore transparency entry: 916471067
- Sigstore integration time:
-
Permalink:
d9d-project/d9d@7a63fb615a539f2ad3135d6a307be35aadd2c222 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/d9d-project
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7a63fb615a539f2ad3135d6a307be35aadd2c222 -
Trigger Event:
push
-
Statement type:
File details
Details for the file d9d-0.2.1-py3-none-any.whl.
File metadata
- Download URL: d9d-0.2.1-py3-none-any.whl
- Upload date:
- Size: 240.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
76a6ca2e6eda6f883bba1ced276094a927719fb5057a49e0f77fe2c5d968da8c
|
|
| MD5 |
1effd5f756da8ed9956f15dd787a80fb
|
|
| BLAKE2b-256 |
0a33ed98c0149339a6a799594f82f992c16ed78341887495ae92dd5c5df98f2d
|
Provenance
The following attestation bundles were made for d9d-0.2.1-py3-none-any.whl:
Publisher:
release.yml on d9d-project/d9d
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
d9d-0.2.1-py3-none-any.whl -
Subject digest:
76a6ca2e6eda6f883bba1ced276094a927719fb5057a49e0f77fe2c5d968da8c - Sigstore transparency entry: 916471189
- Sigstore integration time:
-
Permalink:
d9d-project/d9d@7a63fb615a539f2ad3135d6a307be35aadd2c222 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/d9d-project
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7a63fb615a539f2ad3135d6a307be35aadd2c222 -
Trigger Event:
push
-
Statement type: