Metadata-Version: 2.5
Name: dromeus
Version: 0.4.0rc1
Summary: Decentralized federated learning over AXL
Project-URL: Homepage, https://dromeus.mintlify.app
Project-URL: Documentation, https://dromeus.mintlify.app
Project-URL: Repository, https://github.com/devesh1011/dromeus
Project-URL: Issues, https://github.com/devesh1011/dromeus/issues
Project-URL: Changelog, https://github.com/devesh1011/dromeus/blob/main/CHANGELOG.md
Author: Dromeus contributors
License-Expression: MIT
License-File: LICENSE
Keywords: AXL,decentralized training,differential privacy,federated learning,peer-to-peer,pytorch
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: MacOS
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: System :: Distributed Computing
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: dromeus-axl==0.1.0; (sys_platform == 'linux' and (platform_machine == 'x86_64' or platform_machine == 'aarch64')) or (sys_platform == 'darwin' and platform_machine == 'arm64')
Requires-Dist: msgpack<2,>=1.1
Requires-Dist: numpy<3,>=2
Requires-Dist: pydantic<3,>=2.11
Requires-Dist: pyyaml<7,>=6.0
Requires-Dist: safetensors<1,>=0.5
Requires-Dist: torch<3,>=2.7
Provides-Extra: privacy
Requires-Dist: opacus==1.6.0; extra == 'privacy'
Description-Content-Type: text/markdown

# Dromeus

Dromeus is a Python library for **decentralized federated learning**. Each
participant trains on its own local dataset and exchanges model updates with
peers over [Gensyn's AXL network](https://github.com/gensyn-ai/axl), without a
central server aggregating those updates.

You bring the model, per-record loss and optimizer as a `TrainingTask`. Dromeus
coordinates the group, runs local training and applies
[NoLoCo](https://github.com/gensyn-ai/noloco) updates between peers. It is built for developers experimenting with decentralized training on
independently operated machines.

## How training works

Participants agree on a model, training policy, and fixed membership before the
run starts. They then repeat the same loop:

1. Train on local data for the configured number of steps.
2. Exchange outer gradients and slow weights with the scheduled peer.
3. Apply NoLoCo's outer momentum update and save the committed round.

The peer schedule changes each round. Pairs make progress independently, subject
to readiness and timeout limits. One node coordinates group setup; training
updates happen between peers without a global all-reduce.

AXL runs beside each application and handles encrypted network routing. Dromeus
adds chunk acknowledgments, bounded retries, and checks on the sender, round,
and tensor contents. Top-k sparsification and 8-bit quantization reduce update
traffic, while error feedback carries outer-gradient compression error into
later rounds. An identity codec is also available.

Each worker keeps its own model, and final weights can differ. Per-node logs
record evaluation metrics, timing, and transfer behavior.

## Get started

Use Python 3.11 or newer and `uv`. Install from the source checkout:

```bash
git clone https://github.com/devesh1011/dromeus.git
cd dromeus
./scripts/bootstrap
```

Or install the pre-release from PyPI, in a virtual environment or an activated
conda environment:

```bash
pip install --pre dromeus            # add [privacy] for private training
```

To see a run first, the [quickstart](https://github.com/devesh1011/dromeus/blob/main/guides/quickstart.md) trains four nodes on
one machine in a few minutes. The [training guide](https://github.com/devesh1011/dromeus/blob/main/guides/application-training.md)
covers the three steps with a complete regression example:

```python
import dromeus

task = dromeus.TrainingTask(...)  # model, batches, loss, optimizer; same on every node
dromeus.make_draft(task, "draft.yaml", run_id="my-run", participants=4,
                   rounds=20, local_steps=10)
# on each node, with its own records:
await dromeus.Node.from_file("node.yaml").run(task, local=dromeus.LocalData(...))
```

Before launching, start an AXL node on each machine and connect the group's
peers. On Linux (x86_64, aarch64) and Apple-silicon macOS, Dromeus installs a
pinned AXL build: run it with `dromeus-axl -config axl.json`. The
[AXL setup guide](https://github.com/devesh1011/dromeus/blob/main/guides/axl.md) covers keys, bootstrap peers and nodes behind
NAT; the [configuration guide](https://github.com/devesh1011/dromeus/blob/main/guides/configuration.md) covers each node's
`node.yaml`. One participant initiates group formation; share its invitation file
with the other participants. From the command line, each node runs:

```bash
dromeus doctor --config /path/to/node.yaml   # optional: is this machine ready?
dromeus run --config /path/to/node.yaml --task my_training:setup
```

where `my_training.setup()` returns this node's `(task, LocalData)`. The
[command-line guide](https://github.com/devesh1011/dromeus/blob/main/guides/command-line.md) covers every command and exit code.

## Working assumptions

Dromeus supports fixed, even-sized groups of 4 to 16 participants. Nodes must
agree on model structure and parameter meaning; the PyTorch integration exchanges
compatible FP32 model state. Participants may hold different amounts of data,
but each node has equal weight in the outer update.

Membership stays fixed for the run. A peer failure or missed deadline can end
training; automatic distributed restart is not implemented. Checkpoint restore
requires compatible application state.

Keeping datasets local does not make ordinary model updates private. Optional
private training uses Opacus per-example clipping, Gaussian noise and per-node
accounting through an owned trainer. Groups supply compatible optimizer factories;
private execution also requires an admitted model/loss and the documented state
contract. See [private training](https://github.com/devesh1011/dromeus/blob/main/guides/private-training.md) for supported
profiles, secure randomness, privacy scope and fresh-start restrictions.

Divergence monitoring records model disagreement and emits configurable warnings.
Thresholds are workload-specific and require calibration; agreement alone does not
prove model utility. See [monitoring](https://github.com/devesh1011/dromeus/blob/main/guides/divergence-monitoring.md).
Secure aggregation and Byzantine fault tolerance are not implemented.

## Benchmarks

The [technical report](https://github.com/devesh1011/dromeus/releases/download/v0.2.0/M2_Gensyn_Submission_Report.pdf)
compares NoLoCo over AXL with an independent NCCL reference at 4, 8, and 16 GPU
workers using GroupNorm ResNet-18 on IID CIFAR-10 partitions. It includes codec
comparisons, learning curves, communication measurements, and deployment limits.
These results describe that workload; they do not establish convergence for
arbitrary models or data distributions.

See the [accuracy table](https://github.com/devesh1011/dromeus/blob/v0.2.0/benchmarks/results/m2/report/metrics.csv)
and [published M2 evidence index](https://github.com/devesh1011/dromeus/blob/v0.2.0/benchmarks/results/m2/README.md)
for retained metrics, charts and frozen settings. The owner permanently retired
the old local raw-result trees; unique deleted logs and models are no longer
available for re-audit from this checkout.

The [M3 team review](https://github.com/devesh1011/dromeus/blob/v0.3.0/benchmarks/results/m3/README.md)
maps the proposal requirements to numeric results, runtime and privacy checks, and
the validated digit-warning policy. It also includes the completed language-model
study as additional evidence. The folder omits report charts and large training
artifacts. Read the [criteria check](https://github.com/devesh1011/dromeus/blob/v0.3.0/benchmarks/results/m3/milestone-requirements.md)
for verified scope, publication status, and evidence-retention limits.

Each milestone's benchmark code and evidence are verified at its release tag
(`v0.1.0`, `v0.2.0`, `v0.3.0`). `main` carries only the current library and its
tests; the benchmark runners used for those milestones are not maintained here.

## Development

Run `./scripts/verify` before contributing. It checks architecture boundaries,
lint, types, and tests. The [test guide](https://github.com/devesh1011/dromeus/blob/main/tests/README.md) lists focused commands
and the prerequisites for real-AXL integration tests.

## License

[MIT](https://github.com/devesh1011/dromeus/blob/main/LICENSE).
