Skip to content

Reorganize Collab examples by difficulty - #4960

Merged
holgerroth merged 11 commits into
NVIDIA:mainfrom
holgerroth:feat/reorganize-collab-examples
Jul 28, 2026
Merged

Reorganize Collab examples by difficulty#4960
holgerroth merged 11 commits into
NVIDIA:mainfrom
holgerroth:feat/reorganize-collab-examples

Conversation

@holgerroth

@holgerroth holgerroth commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

What changed

  • Moved the self-contained NumPy Collab introduction to examples/hello-world/hello-collab/.
  • Moved hello_fedavg, simple_split_learning, async aggregation, and swarm to examples/advanced/collab/ while preserving their shared collab package layout.
  • Updated example catalogs, design documentation, run commands, links, and unit-test import paths for the new tiered locations.

Why

NVFlare already tiers examples by difficulty. Putting the minimal Collab workflow beside hello-numpy makes the recommended custom-workflow path visible where new users start, while keeping the more specialized response-callback, split-learning, and decentralized workflows in the advanced tier.

The hello example is already self-contained in one file, so it does not depend on the shared advanced package context.

Validation

  • pytest tests/unit_test/collab/examples_test.py -q — 2 passed
  • Collab example/public-import/runtime targeted suite — 16 passed
  • Relocated simple_split_learning import and recipe finalization — passed
  • ./runtest.sh -s --skip-install — Black, isort, flake8, and agent-skill lint passed
  • ./build_doc.sh --html --skip-api — Sphinx HTML build passed
  • git diff --check

@codecov-commenter

codecov-commenter commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.28%. Comparing base (3244fa3) to head (1b77db7).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4960   +/-   ##
=======================================
  Coverage   64.28%   64.28%           
=======================================
  Files        1030     1030           
  Lines      103739   103739           
=======================================
+ Hits        66686    66693    +7     
+ Misses      37053    37046    -7     
Flag Coverage Δ
unit-tests 64.28% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

nvidianz
nvidianz previously approved these changes Jul 24, 2026

@nvidianz nvidianz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notice the unit test for collab example. I think that's too much, should we remove it?

@holgerroth

Copy link
Copy Markdown
Collaborator Author

@nvidianz Good point — agreed that asserting example behavior is testing documentation. Pushed 3f91cc7:

  • Removed the numpy training-math assertions and the example-level torch-block subprocess test.
  • Kept a deliberately minimal smoke layer: one parametrized test that imports each cataloged example and checks make_recipe().finalize() returns a job. That isn't really testing the examples — it's the cheapest alarm for API drift, since the catalog is the first thing users run against a still-new API (the blob_cb regression in Add simple Collab split learning example #4958 passed all runtime unit tests and only surfaced when an example was actually run).
  • The torch-free base-install constraint the removed test carried now lives fully at the library level: test_collab_public_surface_does_not_require_torch additionally imports CollabRecipe.

If you'd rather have zero pytest coupling to examples, I'd swap the smoke layer for a CI step that runs hello_numpy_collab end-to-end in SimEnv (numpy-only, finishes in seconds) — happy to do that as a follow-up.

Per review feedback, drop assertions on example training behavior:
examples are documentation. Keep one parametrized smoke test that
imports each cataloged example and finalizes its recipe, as a cheap
alarm for API drift. The torch-free base-install constraint moves
fully to the library level: the public-surface torch test now also
imports CollabRecipe, the export the removed example test covered.
@holgerroth
holgerroth force-pushed the feat/reorganize-collab-examples branch from 3f91cc7 to a644012 Compare July 27, 2026 18:26
@holgerroth
holgerroth marked this pull request as ready for review July 27, 2026 18:26
@greptile-apps

greptile-apps Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Reorganizes Collab examples by difficulty.

  • Moves the self-contained NumPy introduction into the hello-world catalog.
  • Relocates specialized Collab workflows under advanced examples.
  • Updates documentation, commands, links, requirements, and smoke-test import paths for the new layout.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
examples/hello-world/hello-collab/job.py Relocates the introductory Collab workflow into a directly runnable hello-world script.
examples/advanced/collab/README.md Updates the advanced Collab catalog, execution commands, and documentation links for its new location.
tests/unit_test/collab/examples_test.py Updates recipe-finalization smoke tests to import examples from their reorganized locations.
tests/unit_test/collab/public_imports_test.py Extends the torch-free public-surface check to import CollabRecipe explicitly.

Reviews (9): Last reviewed commit: "Merge branch 'main' into feat/reorganize..." | Re-trigger Greptile

Comment thread tests/unit_test/collab/examples_test.py
@holgerroth
holgerroth requested a review from nvidianz July 28, 2026 14:41
@holgerroth
holgerroth enabled auto-merge (squash) July 28, 2026 14:41
@holgerroth
holgerroth merged commit f1aa21a into NVIDIA:main Jul 28, 2026
22 checks passed
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.

3 participants