Krum / Multi-Krum

See also

For stronger two-stage resilience, see Bulyan. For a simple non-parametric baseline, see Median.

API Reference

aggregators.krum.upper_bound(n: int, f: int, d: int) float

Compute the theoretical Multi-Krum robustness bound.

Parameters:
  • n (int) – Number of workers, including honest and Byzantine workers.

  • f (int) – Expected number of Byzantine workers.

  • d (int) – Dimension of the gradient space. This parameter is accepted for the standard GAR metadata contract and is not used by this formula.

  • Returns

  • -------

  • float – Upper bound on the ratio between non-Byzantine standard deviation and gradient norm.

aggregators.krum.influence(honests: list[Tensor], attacks: list[Tensor], f: int, m: int | None = None, **kwargs) float

Compute the ratio of Byzantine gradients selected by Multi-Krum.

Parameters:
  • honests (list of torch.Tensor) – Non-empty list of honest gradients.

  • attacks (list of torch.Tensor) – List of attack, or Byzantine, gradients.

  • f (int) – Number of Byzantine gradients to tolerate.

  • m (int, optional) – Number of gradients to select. Defaults to n - f - 2.

  • **kwargs (object) – Additional keyword arguments forwarded to score computation.

  • Returns

  • -------

  • float – Ratio of selected gradients that come from attacks.