Aggregators

Krum provides several Byzantine-resilient gradient aggregation rules (GARs). Each rule follows a keyword-only contract and includes parameter validation and optional theoretical bounds.

Overview

Aggregators

Aggregator

Complexity

Min. Workers

Byzantine Res.

Average

\(\mathcal{O}(nd)\)

\(1\)

None (baseline)

Median

\(\mathcal{O}(nd)\)

\(1\)

Basic

Krum

\(\mathcal{O}(n^2 d)\)

\(2f + 3\)

Moderate

Bulyan

\(\mathcal{O}(n^2 d)\)

\(4f + 3\)

Strong

Brute

\(\mathcal{O}(\binom{n}{n-f}d)\)

\(2f + 1\)

Optimal

where:

  • \(n\) = total number of workers

  • \(f\) = number of Byzantine workers

  • \(d\) = gradient dimension

  • \(\binom{n}{k}\) = binomial coefficient

Available Aggregators

Robust Aggregation Rules:

API Reference

Gradient aggregation rules (GARs) for Byzantine-resilient distributed learning.

Each rule combines a keyword-only aggregation function with a validation function and optional metadata used by the training and experiment scripts.

Contract

Each aggregation rule MUST:

  1. Accept keyword-only arguments

  2. Accept the reserved parameter gradients (non-empty list of gradients)

  3. Accept the reserved parameter f (number of Byzantine gradients to tolerate)

  4. Accept the reserved parameter model (model with configured defaults)

  5. NOT return a tensor that aliases any input tensor

Each rule MUST provide a check function that validates parameters and returns None when valid, or a user-facing error message otherwise.

The module exposes three variants for each rule:

  • rule: The default version (checked in debug mode, unchecked in release)

  • rule.checked: Always validates parameters

  • rule.unchecked: Skips validation (faster in production)

Additional metadata available on each rule:

  • rule.check: The validation function

  • rule.upper_bound: Theoretical bound on stddev/norm ratio (if available)

  • rule.influence: Attack acceptance ratio (if available)