Add tutorials to user documentation - #55
Merged
Merged
Conversation
pevab
approved these changes
Jul 30, 2026
Replaced the detailed "Key Concepts" section with a minimal sanity check example. Point users to tutorials for comprehensive guides on aggregators, attacks, and models.
Krum now requires pandas as a runtime dependency. Update install instructions to include the experiments extra which adds matplotlib, numpy, and seaborn.
New tutorial covering MetricDataFrame filtering, merging, pivoting, CSV/JSON export, seed aggregation, and plotting. Added to tutorial index and todo.md marked complete.
New tutorial showing how to run N aggregators × M attacks with Orchestrator, build a comparison table, and export for papers. Added to tutorial index and todo.md marked complete.
Conceptual tutorial covering the Byzantine threat model, the three regimes of the Byzantine budget (f < n/2, 2f+2 < n, 4f+2 < n), a strategy-based panorama of all five built-in attacks, and the fundamental limits of robustness. Added to tutorial index and todo.md marked complete.
Complete the tutorial series with a decision guide for using any PyTorch Dataset with Krum simulations (TensorDataset, torchvision, disk loading, model matching).
Fix RST title underlines that were one character too long across centralised_simulation, decentralised_simulation, results_analysis, systematic_benchmark, and working_with_orchestrator tutorials.
Improve the minimal example and add new sections on data partitioning and evaluating worker models. The data loading pattern now uses an infinite cycle helper to avoid StopIteration when streams are exhausted.
Improve cross-linking between tutorials by adding links to implement_aggregator and implement_attack, reordering sections for better learning flow, and standardizing formatting across all tutorial pages.
Documents the Metric, Orchestrator, and MetricDataFrame API for running reproducible experiments with multiple configurations and collecting comparable metrics across seeds.
- Move implement_aggregator and implement_attack to Available Tutorials - Consolidate advanced orchestration tutorials into structured_experiments - Update introduction paragraph with revised learning path
Added a code example demonstrating how custom kwargs passed to `aggregator_kwargs` are accessible via `specialized.get()`. Updated the testing section to show the specific command.
The tutorial now demonstrates how MultiKrum handles SignFlip attacks by comparing against a simple Average baseline, with an explanation of why their gradient norms differ.
Added "Setup" and "Running the grid" subsections to improve tutorial structure and readability.
- Document that aggregator uses aggregate() and attack uses generate() methods - Add rounds=50 parameter to simulation examples - Document stop_attack_at and weight_decay parameters
ArthurDanjou
force-pushed
the
54-add-tutorials-to-user-documentation
branch
from
July 30, 2026 15:19
75ca0d7 to
4c1beac
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a complete tutorial section to the Krum documentation, restructures the quickstart, and fixes several documentation issues.**
New tutorials (14
.rstfiles)The
docs/tutorials/directory now contains a full walkthrough series:using_aggregators_attacksworking_with_modelsModelwrapper, zero-copy flat tensor views, standard models (Krum NIPS 2017, MONNA ICML 2023)centralised_simulation_walkthroughKrumSimulationandHiddenVulnerabilitySimulationlifecycle, baseline comparisondecentralised_simulation_walkthroughMonnaSimulation, per-worker models, Byzantine reach modes, custom data streamscustom_datasetDatasetwith Krum:TensorDataset,torchvision, disk loadingworking_with_orchestratorMetricandOrchestratorresults_analysisMetricDataFramesystematic_benchmarkend_to_endtroubleshootingimplement_simulationimplement_aggregatorimplement_attackOther changes
matplotlib,numpy, andseabornmoved to a new[experiments]extra; runtime deps reduced topandas,torch,torchvisiononly; dev deps bumpedkrum[experiments]install instructionsautomodulepaths fixed from bareaggregators.xxxtokrum.primitives.aggregators.xxx(same for attacks)uv.lockregenerated to match new dependency tree