Decentralized distributed training with explicit 4D parallelism control
Project description
disTensor
Decentralized distributed training with explicit 4D parallelism control.
What is disTensor?
disTensor is a distributed training platform that lets you train large models across heterogeneous consumer compute. You define parallelism strategy explicitly — data, tensor, pipeline, and context parallel dimensions — and disTensor handles orchestration, synchronization, and fault tolerance while preserving familiar PyTorch semantics.
The system uses a driver-mediated architecture: your process owns the training loop and data pipeline, the hub coordinates topology, and workers execute computation and sync directly via P2P. The control plane (gRPC) handles orchestration; the data plane (P2P) handles tensor transfers on the critical path.
Installation
# Trainer SDK
pip install distensor
# Compute provider — macOS Apple Silicon
DISTENSOR_API_KEY=dt_p_... curl -fsSL https://api.distensor.com/install/macos.sh | bash
# Development (editable, from source)
make dev
Quick Start
import distensor as ds
# Local mode — no hub, no GPUs, simulated mesh
ds.init(mode="local")
mesh = ds.query_mesh()
print(f"Available workers: {mesh.available_workers}")
# Cloud mode — requires API key
ds.reset()
ds.init(mode="cloud", api_key="dt_u_...")
Architecture
disTensor uses a hub-and-spoke model where the hub coordinates topology but stays off the critical training path. Workers sync directly via P2P for low-latency tensor transfers. The cloud API layer adds persistence, auth, billing, and a web console on top.
| Component | Package | Description |
|---|---|---|
| Hub | distensor.hub |
Central control plane — node/job/topology registries, gRPC services (mesh, job, training, checkpoint, sync) |
| Cloud API | distensor.cloud |
Production HTTP layer — FastAPI, PostgreSQL, Redis, Prometheus. Auth, billing, worker registry, telemetry |
| Node | distensor.node |
Compute worker daemon — model shard execution, P2P data plane, CUDA/MPS/CPU backends |
| Trainer | distensor.training |
Orchestration — Trainer.fit(), pipeline scheduling (GPipe, 1F1B), shard loading, execution plans |
| Sync | distensor.sync |
4D parallel coordination — TP AllReduce, PP transfers, DP gradient sync, worker topology |
| Optimizer | distensor.optim |
Distributed optimizer — ZeRO-3, gradient sync with bucketing, LR schedulers, state dict support |
| Console | ui/ |
React web UI for trainers, providers, and admins |
| Node App | distributions/ |
Provider surface — distensor-server supervisor + distensor TUI dashboard |
See Architecture.md for diagrams, execution flows, and design principles. Full documentation at docs.distensor.com.
Parallelism
| Mode | Abbreviation | Strategy |
|---|---|---|
| Data Parallel | DP | Replicate model across workers, split data batches |
| Tensor Parallel | TP | Shard individual layers across workers |
| Pipeline Parallel | PP | Split model into sequential stages across workers |
| Context Parallel | CP | Split sequence dimension across workers (coming soon) |
Development
make dev # Full bootstrap (uv sync + proto generation)
make test # Run full test suite
make lint # Ruff linting
make format # Auto-format
make cloud-up # Start Postgres, Redis, MinIO, Prometheus
make cloud-api # Run HTTP API server (:8000)
make cloud-hub # Run gRPC hub server (:50051)
make console-dev # Vite dev server (:5173, proxies /api to :8000)
make sandbox-up # Docker sandbox (coordinator + 8 workers)
make sandbox-cloud-up # Full cloud stack in Docker
make help # All available targets
Links
- Documentation
- Architecture
- Contributing
- License — Apache 2.0
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 distensor-0.1.0.tar.gz.
File metadata
- Download URL: distensor-0.1.0.tar.gz
- Upload date:
- Size: 466.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26668f578da69ee9b09b85df6ecc6d9c32ec98d50a45775db4c2445424b7fa49
|
|
| MD5 |
906a72dda21c8ff350e4094b793779ce
|
|
| BLAKE2b-256 |
3a9649e45f931dd758cc80598cd259e87a7f7c1ea0589cf9548a01418f58eb4e
|
Provenance
The following attestation bundles were made for distensor-0.1.0.tar.gz:
Publisher:
ci.yml on don-arash/distensor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
distensor-0.1.0.tar.gz -
Subject digest:
26668f578da69ee9b09b85df6ecc6d9c32ec98d50a45775db4c2445424b7fa49 - Sigstore transparency entry: 1341273535
- Sigstore integration time:
-
Permalink:
don-arash/distensor@e1f9893ff9f2b2e44723bf3e23496aff78f577f8 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/don-arash
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@e1f9893ff9f2b2e44723bf3e23496aff78f577f8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file distensor-0.1.0-py3-none-any.whl.
File metadata
- Download URL: distensor-0.1.0-py3-none-any.whl
- Upload date:
- Size: 604.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba85d51a19ee58b6548fda03a5f0c4caa3cac9993c119a2471ba2979bcf40841
|
|
| MD5 |
71bd0b4e2b222de37c0ef77e052a6456
|
|
| BLAKE2b-256 |
abe9f67ba1f0ce7d26524250c72ca2c97297adceac15ec0ca4289d0494401855
|
Provenance
The following attestation bundles were made for distensor-0.1.0-py3-none-any.whl:
Publisher:
ci.yml on don-arash/distensor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
distensor-0.1.0-py3-none-any.whl -
Subject digest:
ba85d51a19ee58b6548fda03a5f0c4caa3cac9993c119a2471ba2979bcf40841 - Sigstore transparency entry: 1341273578
- Sigstore integration time:
-
Permalink:
don-arash/distensor@e1f9893ff9f2b2e44723bf3e23496aff78f577f8 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/don-arash
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@e1f9893ff9f2b2e44723bf3e23496aff78f577f8 -
Trigger Event:
push
-
Statement type: