Expand description
Gradient sparsification and delta encoding for federated learning.
This module provides bandwidth-efficient gradient transmission primitives:
SparsityConfig— policy for top-k selection and threshold filteringSparseGradient— compact index/value representation with residual supportGradientSparsifier— stateful sparsifier with residual accumulationGradientDelta— delta-encoded gradient relative to the previous roundDeltaEncoder— stateful encoder that tracks the previously sent gradient
§Design rationale
In bandwidth-constrained federated learning scenarios, transmitting the full gradient vector each round wastes network capacity. Two complementary techniques address this:
-
Sparsification — keep only the top-k elements (by absolute value) or those exceeding a magnitude threshold, accumulating the dropped portion in a residual buffer so that no information is permanently lost.
-
Delta encoding — transmit the element-wise difference from the previous round instead of the full gradient; the receiver reconstructs the current gradient by adding the delta to its locally cached copy.
Structs§
- Delta
Encoder - Stateful encoder that computes element-wise deltas between successive gradient rounds.
- Delta
Stats - Cumulative statistics for a
DeltaEncoder. - Gradient
Delta - A gradient update that is either a complete gradient or a delta from the previous round.
- Gradient
Sparsifier - Stateful gradient sparsifier with optional residual accumulation.
- Sparse
Gradient - A compact sparse representation of a gradient vector.
- Sparsifier
Stats - Cumulative statistics for a
GradientSparsifier. - Sparsity
Config - Configuration for the
GradientSparsifier.