Skip to content

Finish concrete Recipe entrypoint and documentation cleanup - #4983

Open
nvkevlu wants to merge 7 commits into
NVIDIA:mainfrom
nvkevlu:codex/recipe-api-entrypoints-docs
Open

Finish concrete Recipe entrypoint and documentation cleanup#4983
nvkevlu wants to merge 7 commits into
NVIDIA:mainfrom
nvkevlu:codex/recipe-api-entrypoints-docs

Conversation

@nvkevlu

@nvkevlu nvkevlu commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Finishs concrete Recipe entrypoint and documentation cleanup.

Description

Recipe-facing application code should work through documented concrete recipe constructors without depending on the generated backing job. This keeps internal FedJob assembly encapsulated while preserving the lower-level Job API for advanced use cases.

  • Removed the optional backing CCWFJob parameter from BaseSwarmLearningRecipe and exposed min_clients directly for job scheduling.
  • Added dedicated KaplanMeierRecipe and FedBPTRecipe implementations.
  • Simplified the Kaplan–Meier and FedBPT job.py entrypoints to instantiate concrete recipes without exposing Recipe or FedJob.
  • Removed stale Recipe API technical-preview wording.
  • Reinforced concrete recipes such as FedAvgRecipe and CyclicRecipe as the primary public entrypoints.
  • Clarified that the lower-level FedJob API remains intentionally documented separately for advanced component placement and custom job construction.

Validation

  • Python syntax compilation passed for the changed Python files.
  • Black, isort, flake8, license-header, and whitespace checks passed for the changed files.
  • Confirmed that Recipe-facing documentation and entrypoints no longer access recipe.job or instantiate the base Recipe.

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • Breaking change (fix or new feature that would cause existing functionality to change).
  • New tests added to cover the changes.
  • Quick tests passed locally by running ./runtest.sh.
  • In-line docstrings updated.
  • Documentation updated.

Copilot AI review requested due to automatic review settings July 28, 2026 23:32
Comment thread nvflare/app_opt/pt/recipes/swarm.py Outdated
@greptile-apps

greptile-apps Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR promotes concrete Recipe entrypoints while keeping lower-level job assembly encapsulated.

  • Adds dedicated Kaplan–Meier and FedBPT recipe implementations and updates their entrypoints.
  • Exposes swarm job-scheduling quorum through min_clients.
  • Corrects nested relative swarm checkpoint export by adding the file after the server app exists and configuring the persistor with the exported basename.
  • Updates Recipe and FedJob documentation to clarify their respective public use cases.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
nvflare/app_opt/pt/recipes/swarm.py Reworks backing-job creation and aligns relative checkpoint registration with its flattened exported basename.
tests/unit_test/recipe/swarm_recipe_test.py Adds regression coverage confirming nested relative checkpoints export and resolve as custom/checkpoint.pt.
examples/advanced/kaplan-meier-he/km_recipe.py Introduces a concrete Kaplan–Meier recipe encapsulating standard and homomorphically encrypted job assembly.
research/fed-bpt/fedbpt_recipe.py Introduces a concrete FedBPT recipe encapsulating argument construction, component placement, and execution-path setup.
research/fed-bpt/job.py Replaces inline low-level job construction with the dedicated FedBPT recipe entrypoint.

Reviews (3): Last reviewed commit: "address PR comments" | Re-trigger Greptile

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR finishes the shift toward concrete, named Recipe entrypoints (vs. instantiating Recipe directly or depending on exposing/generated FedJob objects), and updates docs/examples to reflect the intended separation between the high-level Recipe API and the lower-level FedJob API.

Changes:

  • Introduces concrete recipe implementations for FedBPT and Kaplan–Meier examples, updating the job.py entrypoints to instantiate those recipes directly.
  • Refactors Swarm recipe construction to expose min_clients directly (instead of optionally accepting a pre-created backing job).
  • Updates user/programming guide docs to remove “technical preview” wording and clarify when to use Recipes vs FedJob.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
research/fed-bpt/README.md Updates FedBPT example narrative to describe the new concrete recipe entrypoint.
research/fed-bpt/job.py Simplifies entrypoint to instantiate FedBPTRecipe directly.
research/fed-bpt/fedbpt_recipe.py Adds a dedicated FedBPTRecipe encapsulating FedJob assembly and execution/export behavior.
nvflare/app_opt/pt/recipes/swarm.py Refactors Swarm recipe construction to use min_clients directly and adjusts checkpoint bundling flow.
examples/advanced/kaplan-meier-he/README.md Updates documentation to reflect use of a concrete KaplanMeierRecipe.
examples/advanced/kaplan-meier-he/km_recipe.py Adds dedicated KaplanMeierRecipe encapsulating Kaplan–Meier FedJob assembly.
examples/advanced/kaplan-meier-he/job.py Simplifies entrypoint to instantiate KaplanMeierRecipe directly.
docs/user_guide/data_scientist_guide/recipe_api.rst Clarifies concrete recipes as the intended public constructor surface and separates Recipe vs FedJob guidance.
docs/user_guide/data_scientist_guide/job_recipe.rst Updates note to remove technical-preview wording and point to FedJob docs for advanced workflows.
docs/programming_guide/fed_job_api.rst Adds note clarifying FedJob docs are intentionally separate from Recipe docs.
docs/programming_guide/controllers/client_controlled_workflows.rst Updates Swarm recipe examples/docs to include and explain min_clients.
docs/migration_guide.rst Removes “technical preview” label from Job Recipe API migration note.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread examples/advanced/kaplan-meier-he/km_recipe.py
Comment thread docs/user_guide/data_scientist_guide/job_recipe.rst Outdated
Comment thread nvflare/app_opt/pt/recipes/swarm.py
@codecov-commenter

codecov-commenter commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.26%. Comparing base (8b9541c) to head (6118c2b).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4983   +/-   ##
=======================================
  Coverage   64.26%   64.26%           
=======================================
  Files        1030     1030           
  Lines      103578   103577    -1     
=======================================
+ Hits        66560    66561    +1     
+ Misses      37018    37016    -2     
Flag Coverage Δ
unit-tests 64.26% <100.00%> (+<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.

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