Byzantine-resilient aggregation rules for distributed machine learning.
This project implements various Byzantine-resilient Gradient Aggregation Rules (GARs) for distributed learning. It allows simulating training sessions under different Byzantine attacks to evaluate the robustness of aggregation strategies like Krum and Multi-Krum.
The reference documentation is available at calicarpa.github.io/krum.
This project supports Python 3.10 through 3.14.
pip install krumWith uv (Recommended):
uv pip install krum
# or directly in a uv project
uv add krumFor development or if you want to modify the source, clone the repository and install in editable mode with the development dependencies:
git clone https://github.com/calicarpa/krum.git
cd krum
pip install -e ".[dev]"With uv (Recommended):
git clone https://github.com/calicarpa/krum.git
cd krum
uv sync --extra devThis installs all linting, type-checking, and documentation tools.
This project uses Ruff for unified linting and formatting, and ty for type-checking.
Run the formatter and linter:
ruff format .
ruff check --fix .Run the type checker:
ty checkInstall pre-commit hooks to block non-compliant commits:
pre-commit installBuild the documentation locally:
cd docs
make html #
make watch #
make serve #
make clean # MIT License — see LICENSE.