dEngine

dEngine: A Decentralized Learning Framework for Python

Collaborative learning across devices with siloed data.

01

Connected, not centralized

Devices exchange information only with their neighbors in a communication graph.

02

Private by design

Local data never leaves the device. Each node learns from its own distribution.

03

Train locally, improve globally

Every participant strengthens the shared model while keeping their data right where it belongs.

Under the hood

Local learning.
Global progress.

We try to solve a shared optimization problem across a network of devices without a central view of their data.

Shared objective
\[ \min_{W \in \mathbb{R}^d} \; f(W) = \frac{1}{n} \sum_{i=1}^{n} F_i(W; D_i) \]
  1. 01

    A network of devices

    \(n\) devices, indexed by \(i \in \{1, \dots, n\}\), form a communication graph \(G = (V, E)\). Each device exchanges information only with its neighbors \(N_i = \{ j : (i, j) \in E \}\).

  2. 02

    The model parameters

    \(W \in \mathbb{R}^d\) represents the model parameters.

  3. 03

    Private, heterogeneous data

    \(D_i\) is the local data distribution at device \(i\). It is private and never leaves the device. Different devices can have different distributions (non-IID data).

  4. 04

    A local objective

    \[ F_i(W; D_i) = \mathbb{E}_{\xi \sim D_i} \big[ \ell(W; \xi) \big] \]

    The local objective at device \(i\), where \(\ell(W; \xi)\) is the loss of model \(W\) on sample \(\xi\).

  5. 05

    The global objective

    \(f(W)\) is the average of the local objectives. Device \(i\) can evaluate (stochastic) gradients of \(F_i\) only, never of \(f\).

Test it now

Run your first simulation.

Install dEngine, grab a ready-made MNIST experiment and train it across a network of simulated devices, all from your terminal.

Terminal
# 1. Install dEngine (requires Python 3.13+)
pip install git+https://github.com/DecentralizedLearning/dEngine.git

# 2. Download the MNIST experiment configuration
curl -O https://decentralizedlearning.github.io/builtins/mnist.yaml

# 3. Run the simulation
dengine-simulate --config mnist.yaml --seed 123 scenario.arguments.num_parallel_clients=50

Results are written to logs/ and the MNIST dataset is downloaded to ./datasets. Run dengine-simulate --help for all options.

Better, together

Start experimenting with dEngine.

Explore the project, follow the research, and contribute on GitHub.

Explore on GitHub

Get in touch

Contacts

Want more info about dEngine, have an idea to share, or interested in collaborating? Drop us an email.