Skip to main content

Decentralized distributed training with explicit 4D parallelism control

Project description

disTensor

Python 3.10+ License Version

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 distensor.com/docs.

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

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

distensor-0.1.4.tar.gz (466.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

distensor-0.1.4-py3-none-any.whl (604.0 kB view details)

Uploaded Python 3

File details

Details for the file distensor-0.1.4.tar.gz.

File metadata

  • Download URL: distensor-0.1.4.tar.gz
  • Upload date:
  • Size: 466.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for distensor-0.1.4.tar.gz
Algorithm Hash digest
SHA256 61711b6cd358e4804d470c195ae3ee2d6fa55d3acef9f5c9e4e12894e6d87bc7
MD5 65a2e2d519b743dc57e0d60d7082c16e
BLAKE2b-256 969da49194b8673f7998dd4568c3c9484d6a9ce2844cd32ae2af62d10e80ce1a

See more details on using hashes here.

Provenance

The following attestation bundles were made for distensor-0.1.4.tar.gz:

Publisher: ci.yml on don-arash/distensor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file distensor-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: distensor-0.1.4-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

Hashes for distensor-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 d9ce311c23489025189776b829120eb512686bc228b6b4ec723f3e8367e734b2
MD5 e7f7173c4e7ad3348a0a49b7a9b0ce53
BLAKE2b-256 3260540bcb6c0ae64f64f0668745d76582d97340e3b60b32cb6c27f046dc217e

See more details on using hashes here.

Provenance

The following attestation bundles were made for distensor-0.1.4-py3-none-any.whl:

Publisher: ci.yml on don-arash/distensor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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