Tutorials#

Step-by-step guides to help you get the most out of Krum.

Start with Using Aggregators and Attacks, Working with models and Working with Data Partitioners to learn the basics. Next, Implement a custom aggregator and Implement a custom attack show you how to extend Krum. Then run full simulations with Centralised simulation walkthrough or Decentralised simulation walkthrough. Finally, Structured experiments covers data collection and analysis at scale.

Available Tutorials#

Detailed Tutorials#

Using Aggregators and Attacks

All built-in aggregation rules and attack strategies with a resilience table and a combined example.

See Aggregators and Attacks.

Working with models

The Model wrapper for zero-copy flat tensor views plus the standard models from the literature (Krum NIPS 2017, MONNA ICML 2023).

See Models.

Working with Data Partitioners

The DataPartitioner family: IID shards, Dirichlet label skew, sort-by-label interpolation, and mixing any two partitioners, plus wiring them into a simulation.

See Data partitioners.

Implement a custom aggregator

Subclass Aggregator and implement aggregate, with tests. Build from gradients-only to fully parameterised.

See Aggregators.

Implement a custom attack

Subclass Attack and implement generate, with tests.

See Attacks.

Centralised simulation walkthrough

Parameter-server simulation with KrumSimulation: MultiKrum + SignFlip on MNIST, dataset setup, training loop, baseline comparison.

See Centralised simulations and Decentralised simulations.

Decentralised simulation walkthrough

Peer-to-peer simulations with DecentralisedSimulation and MonnaSimulation: per-worker models, model mixing, Byzantine reach modes, custom data streams.

See Decentralised simulations.

Structured experiments

Collect metrics with Metric and Orchestrator, analyse with filtering and plotting, run N×M benchmarks.

See Orchestration and MetricDataFrame.