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 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

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.1.tar.gz (466.0 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.1-py3-none-any.whl (604.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

Hashes for distensor-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1ad36b09c4724113009a2e0009d6ac95b341d63658469bc11472e4bc8e367cfe
MD5 26092bb85ab495f673a9ad526a944e28
BLAKE2b-256 c23d81e4c2f7838639ba79dfc659f1dbd7f2c82bd3dd017d51b432440c8eadab

See more details on using hashes here.

Provenance

The following attestation bundles were made for distensor-0.1.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: distensor-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 94351df5f8f4aaebb8f71a28b5ca54dc739ba27617c0f23703f2947406257bf2
MD5 14f8d5a037a2477876ca49a206c786fa
BLAKE2b-256 1c595a57f0b6fc017e0a7055bbbc9ce23f0adbd5bdc092255e78933d3cf66ecd

See more details on using hashes here.

Provenance

The following attestation bundles were made for distensor-0.1.1-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