Skip to content

docs: add the first two task-oriented tutorials - #58

Merged
wenh06 merged 1 commit into
masterfrom
docs-tutorials-b
Oct 27, 2026
Merged

wenh06 merged 1 commit into
masterfrom
docs-tutorials-b

Conversation

@wenh06

@wenh06 wenh06 commented Oct 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • tutorial-first-experiment: compare FedAvg / FedProx / SCAFFOLD at two sampling ratios on synthetic data (six runs into a pandas table), then dissect what num_communications counts — messages, not rounds, with the discriminating check (3 rounds full sampling = 6 rounds half sampling = 180) and the per-direction decomposition. A closing section runs FedPD next to FedAvg and shows the saved budget comes from skipped uplinks only; it explains the expected RuntimeWarnings on both server and client side and the 0 < p < 1 constraint. All shown code is embedded via literalinclude from the runnable test-files/tutorial_first_experiment.py.
  • tutorial-cli-matrix: run an experiment matrix from one YAML file; the new example-configs/fedsynthetic-demo.yml expands into four synthetic-data runs. The page documents the interpolation syntax and the per-arm tag that keeps same-minute runs from overwriting each other's logs (the demo initially hit exactly that — only the last run's json survived until the tags were added).
  • index.rst: new Tutorials toctree section; quickstart next-steps now point at the tutorials.
  • test/test_tutorial_scripts.py: behavioral smoke tests extended — the comparison-table communications invariants (90 / 180), the FedPD coda (fewer communications than FedAvg with at least one real uplink, guarding the degenerate never-uploads case), and the CLI matrix expansion (distinct combinations, interpolated values, one json+txt pair per arm, budget asserted from each run's config.json).
  • zh_CN translations for the new and updated pages via the gettext pipeline.

Validation

  • pytest test/test_tutorial_scripts.py test/test_hook_contract.py test/test_messages.py: 19 passed (~19 s for the five behavioral smoke tests, real runs included).
  • English docs build: zero warnings. zh_CN docs build: zero new warnings vs master.
  • The T1 script's FedAvg ratio-0.5 run reproduces the CLI matrix's ratio-0.5 run bit-for-bit in final accuracy (0.8114), confirming the tutorial narrative about the fixed aggregation order.

- tutorial-first-experiment.rst: compare FedAvg/FedProx/SCAFFOLD at two
  sampling ratios on synthetic data, then dissect what
  num_communications counts (messages, not rounds, with the
  discriminating check and the per-direction decomposition) and how
  communication-skipping algorithms (FedPD) change the picture; the
  shown code is embedded via literalinclude from the runnable script
  test-files/tutorial_first_experiment.py
- tutorial-cli-matrix.rst: run an experiment matrix from a single YAML
  file; the demo config example-configs/fedsynthetic-demo.yml expands
  into four synthetic-data runs, and the page documents the per-arm tag
  that keeps same-minute runs from overwriting each other's logs
- index.rst: new Tutorials toctree section; quickstart next steps now
  point at the tutorials
- test/test_tutorial_scripts.py: behavioral smoke tests extended to both
  tutorials — the comparison-table invariants (90/180 communications),
  the FedPD coda (fewer communications than FedAvg with at least one
  real uplink), and the CLI matrix expansion (distinct tags, one log
  pair per arm, budget asserted from config.json)
- zh_CN translations for the new and updated pages
@codecov

codecov Bot commented Oct 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.70%. Comparing base (11c19de) to head (787ed71).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #58      +/-   ##
==========================================
+ Coverage   82.32%   83.70%   +1.38%     
==========================================
  Files          55       55              
  Lines        5640     5640              
==========================================
+ Hits         4643     4721      +78     
+ Misses        997      919      -78     

see 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@wenh06
wenh06 merged commit b31a5db into master Oct 27, 2026
28 checks passed
@wenh06
wenh06 deleted the docs-tutorials-b branch October 27, 2026 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant