Skip to content

calicarpa/krum

Repository files navigation

Krum

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.

Documentation

The reference documentation is available at calicarpa.github.io/krum.

Installation

Supported Python versions

This project supports Python 3.10 through 3.14.

From PyPI

pip install krum

With uv (Recommended):

uv pip install krum
# or directly in a uv project
uv add krum

From source

For 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 dev

This installs all linting, type-checking, and documentation tools.

Contributing

Linting, formatting, and type-checking

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 check

Pre-commit hooks

Install pre-commit hooks to block non-compliant commits:

pre-commit install

Documentation

Build the documentation locally:

cd docs
make html  # 
make watch # 
make serve # 
make clean # 

License

MIT License — see LICENSE.

About

Krum, the library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors