Skip to content

refactor(recipe)!: flatten Nemotron example directories - #6371

Merged
cuichenx merged 9 commits into
mainfrom
chcui/leo/flatten-nemotron-examples
Oct 9, 2026
Merged

cuichenx merged 9 commits into
mainfrom
chcui/leo/flatten-nemotron-examples

Conversation

@cuichenx

@cuichenx cuichenx commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do ?

Flatten Nemotron example directories so each model has a direct, importable path under examples/models/nemotron/.

Changelog

  • Use Nano, Nano Omni, Super, Ultra, Lightning, Super VL order consistently in example tables, model indexes, navigation, and generated catalog listings.

  • Move Nano, Nano Omni, Super, Ultra, Lightning, and Super VL into their model-specific directories. Lightning and Super VL use nemotron_3_5_* names.

  • Remove the deprecated Nano v2 VL example script and two YAML overrides. Current docs point to the verified v0.6.0 guide for those historical examples; public model and recipe APIs are unchanged.

  • Move the family index up one level and document the intentional example-path break. Public recipes and model conversion entry points are unchanged; all 35 examples for the six requested model families are retained.

  • Update current documentation, commands, test discovery, the verification card/catalog, and the skill card. Preserve verified historical branch links and correct archived 0.4.2 commands against that release's actual tree.

  • Add package-discovery and repository/link regression checks.

GitHub Actions CI

Primary area: area:recipe.

  • 269 targeted Nemotron example, recipe, and model unit tests passed in an existing NeMo container using this checkout's pinned Megatron-Core.
  • 15 lightweight layout, import-discovery, source-link, and Ultra packing checks passed; independently rerun by the reviewer.
  • Repository-wide pre-commit passed; strict mypy passed for the new test.
  • Generated verification catalog freshness check and git diff --check passed.
  • Move integrity check: all 35 retained example files accounted for, with unchanged executable Python syntax trees; only the three requested deprecated files were removed.
  • Full Sphinx HTML build passed without warnings; final-page rendering reuses the generated API sources.
  • Rendered link checks cover all Nemotron pages and the landing page. The unrelated landing-page examples/conversion/compare_models.py link is already broken on the base revision and is outside this refactor.
  • Fresh independent review of the complete final diff completed before publication with no actionable findings.

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you add or update any necessary documentation?
  • Does the PR affect components that are optional to install? (Ex: Numba, Pynini, Apex etc)
    • Reviewer: Does the PR have correct import guards for all optional libraries?

Additional Information

Breaking path change: saved commands and examples.models.nemotron.* imports must use the new model directories. No compatibility aliases were added. Historical release checkouts retain their own layouts.

Signed-off-by: Chen Cui <chcui@nvidia.com>
@cuichenx cuichenx added feature New capabilities, enhancements, or enablement work breaking-change Public behavior or API compatibility changes area:recipe Training recipes and launch configs needs-review PR is ready for code review and waiting on a reviewer labels Oct 9, 2026
@svcnvidia-nemo-ci

Copy link
Copy Markdown
Contributor

/nvskills-ci

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Automatic Claude reviews have been retired. To request a pull-request review, post a comment containing:

/review

Add model=claude to use a Claude reviewer (the default is model=codex). mode=light|strict selects the review depth; for example, /review model=claude mode=strict. Comment /review help for all options.

@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Signed-off-by: nvskills-svc-account <svc-nvskills-signing@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Oct 9, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Signed-off-by: Chen Cui <chcui@nvidia.com>
@svcnvidia-nemo-ci

Copy link
Copy Markdown
Contributor

/nvskills-ci

Signed-off-by: nvskills-svc-account <svc-nvskills-signing@nvidia.com>
@cuichenx

cuichenx commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test ad4b24f

Signed-off-by: Chen Cui <chcui@nvidia.com>
@cuichenx

cuichenx commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 5dd4bb0

@svcnvidia-nemo-ci

Copy link
Copy Markdown
Contributor

/nvskills-ci

Signed-off-by: nvskills-svc-account <svc-nvskills-signing@nvidia.com>
@kamran-nvidia
kamran-nvidia self-requested a review October 9, 2026 17:54

@kamran-nvidia kamran-nvidia 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.

One blocking issue outside the diff, plus an inline note on the new layout test.

tests/unit_tests/doc_consistency/test_readme_consistency.py still points at the old Nano layout:

MODEL_EXAMPLES / "nemotron" / "nemotron_3" / "nano" / "slurm_sft.sh": (
"${MODEL_NAME}_sft_config",
"nemotron_3_nano_finetune_config",
),
MODEL_EXAMPLES / "nemotron" / "nemotron_3" / "nano" / "slurm_peft.sh": (
"${MODEL_NAME}_peft_config",
"nemotron_3_nano_finetune_config",
),

test_nemotron_and_qwen2_audio_finetune_launchers_use_exported_recipes raises FileNotFoundError for nemotron_3/nano/slurm_sft.sh on this branch. It passes on the base commit, and it runs in Launch_Unit_Tests_Core (passing on main here), so this will fail the L0 unit tests and Nemo_CICD_Test. The new reference scanner can't catch it because the path is assembled from separate Path components rather than a contiguous examples/models/nemotron/... string.

Fix:

-        MODEL_EXAMPLES / "nemotron" / "nemotron_3" / "nano" / "slurm_sft.sh": (
+        MODEL_EXAMPLES / "nemotron" / "nemotron_3_nano" / "slurm_sft.sh": (
 ...
-        MODEL_EXAMPLES / "nemotron" / "nemotron_3" / "nano" / "slurm_peft.sh": (
+        MODEL_EXAMPLES / "nemotron" / "nemotron_3_nano" / "slurm_peft.sh": (

With that change all 23 tests in the file pass.

# See the License for the specific language governing permissions and
# limitations under the License.

"""Check example discovery and links without importing GPU dependencies."""

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.

This file won't run in CI. pyproject.toml lists "examples" in norecursedirs, and pytest matches those patterns against directory names at any depth. So pytest tests/unit_tests (Launch_Unit_Tests_Core.sh) never enters tests/unit_tests/examples/. None of the three unit-test shards for this PR's base commit on main (run 37890877242) collected anything from that folder. It only passes when invoked by explicit path.

Could you move it to tests/unit_tests/doc_consistency/, next to test_readme_consistency.py? It's the same depth, so parents[3] still resolves to the repo root. I tried the move locally: it gets collected from tests/unit_tests and passes there.

The two existing tests this PR updates in tests/unit_tests/examples/ have the same problem, but that's pre-existing and probably needs its own fix.

Signed-off-by: Chen Cui <chcui@nvidia.com>
@cuichenx

cuichenx commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test e289c9f

@svcnvidia-nemo-ci

Copy link
Copy Markdown
Contributor

/nvskills-ci

Signed-off-by: nvskills-svc-account <svc-nvskills-signing@nvidia.com>
kamran-nvidia
kamran-nvidia previously approved these changes Oct 9, 2026
@cuichenx

cuichenx commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 03303a7

@cuichenx cuichenx added ready-to-merge PR is approved, current, and only waiting for CI to pass before merge and removed needs-review PR is ready for code review and waiting on a reviewer labels Oct 9, 2026
Signed-off-by: Chen Cui <chcui@nvidia.com>
@svcnvidia-nemo-ci

Copy link
Copy Markdown
Contributor

/nvskills-ci

@cuichenx

cuichenx commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 7c09d64

@cuichenx
cuichenx merged commit ae22c0d into main Oct 9, 2026
24 of 26 checks passed
@cuichenx
cuichenx deleted the chcui/leo/flatten-nemotron-examples branch October 9, 2026 21:46

This branch was successfully deployed

1 active deployment
test — 7c09d648 Deployed Oct 9, 2026 by copy-pr-bot[bot] via cicd-wait-in-queue #22700
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:recipe Training recipes and launch configs breaking-change Public behavior or API compatibility changes feature New capabilities, enhancements, or enablement work ready-to-merge PR is approved, current, and only waiting for CI to pass before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants