Skip to content

refactor(performance): remove legacy perf configs - #4623

Merged
yaoyu-33 merged 20 commits into
mainfrom
yuya/remove-legacy-perf-configs
Jul 9, 2026
Merged

yaoyu-33 merged 20 commits into
mainfrom
yuya/remove-legacy-perf-configs

Conversation

@yaoyu-33

@yaoyu-33 yaoyu-33 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Remove the legacy scripts/performance/configs preset tree and dump_perf_configs.py.
  • Resolve performance launcher workload defaults from flat megatron.bridge.perf_recipes recipes with v2 as the canonical suffix-less variant.
  • Update perf env plugin/default config variant handling, training-mode inference for legacy lora recipe names, and perf integration/unit tests.

Split

This is the legacy performance config cleanup split out of #4622. #4622 is now recipes-only.

Validation

  • python3 -m compileall -q scripts/performance scripts/training/run_recipe.py tests/functional_tests/test_groups/recipes/test_perf_config_integration.py tests/unit_tests/scripts/performance tests/unit_tests/recipes/test_override_precedence.py
  • git diff --check
  • uvx pre-commit run --all-files

Note: uv run pre-commit run --all-files is blocked on macOS by nvidia-resiliency-ext==0.6.0 Linux-only wheels.

@yaoyu-33
yaoyu-33 requested review from a team, erhoo82 and malay-nagda as code owners July 2, 2026 05:07
@copy-pr-bot

copy-pr-bot Bot commented Jul 2, 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.

Comment thread scripts/performance/utils/utils.py
Comment thread tests/functional_tests/test_groups/recipes/test_perf_config_integration.py Outdated
@claude

claude Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Review: refactor(performance): remove legacy perf configs

Solid cleanup. Two blocking issues found; both are guaranteed runtime failures on the paths they touch.

High: _apply_kimi_k2_optimizer does not exist
scripts/performance/utils/utils.py line 533 imports _apply_kimi_k2_optimizer from megatron.bridge.recipes.kimi.kimi_k2, but that module only defines _get_kimi_k2_pipeline_layout and kimi_k2_pretrain_config(optimizer_type=...). Calling get_perf_optimized_recipe with model_recipe_name=kimi_k2 and optimizer_type=adam raises ImportError. This is the exact adam+kimi_k2 override path the block was added for.

High: kimi test imports a symbol the package does not re-export
tests/functional_tests/test_groups/recipes/test_perf_config_integration.py line 192 (test_kimi_flat_perf_recipes_are_parameterless) imports kimi_k2_pretrain_1024gpu_h100_bf16_config from the kimi.h100 package, but perf_recipes/kimi/h100/init.py is header-only and does not re-export it (the function lives in the kimi.h100.kimi_k2 submodule; the family kimi/init.py does re-export it). This test ImportErrors under L0_Launch_recipes_perf_config.sh. Import from kimi.h100.kimi_k2 or perf_recipes.kimi.

Notes

  • Docs still reference the removed tree: README.md line 16, skills/nemo-mbridge-recipe-recommender/SKILL.md (86, 433), skills/nemo-mbridge-perf-cuda-graphs/SKILL.md (235-237) all point at scripts/performance/configs. Per CONTRIBUTING refactoring rules these stale references should be updated.
  • _LEGACY_DEFAULT_GPU_COUNTS hardcodes preserved GPU defaults; good that test_get_perf_optimized_recipe_uses_legacy_default_gpu_count locks the DeepSeek H100 case.

Suggested test cases

  • test_kimi_flat_perf_recipes_are_parameterless (broken import today; must pass once fixed)
  • test_get_perf_optimized_recipe_uses_legacy_default_gpu_count (add a kimi_k2 optimizer_type=adam case to cover the _apply_kimi_k2_optimizer path)
  • test_llama3_8b_flat_perf_config_instantiation
  • test_deepseek_v3_flat_perf_config_instantiation
  • test_qwen3_30b_flat_perf_config_instantiation
  • test_precision_config_variations
  • test_workload_base_config_falls_back_for_gpu_scaling
  • test_unsupported_legacy_config_variant_errors
  • test_list_available_config_variants_accepts_legacy_signature
  • test_get_library_recipe_llama_sets_paths
  • test_get_library_recipe_deepseek_sets_paths
  • test_config_overrides_after_precision
  • test_qwen35_vl_122b_h100_pipeline_layout
  • test_perf_env_plugin_num_gpus_is_optional
  • test_set_determinism_env_vars_writes_three_keys

No model_gpu_precision_perf recipe-config functions were modified (only the legacy preset tree was deleted), so no perf launcher cases are impacted beyond L0_Launch_recipes_perf_config.sh.

Comment thread scripts/performance/utils/utils.py
Comment thread tests/functional_tests/test_groups/recipes/test_perf_config_integration.py Outdated
@yaoyu-33 yaoyu-33 added area:perf Performance optimizations and benchmarking breaking-change Public behavior or API compatibility changes feature New capabilities, enhancements, or enablement work full-test-suite needs-more-tests Requires additional L0 and L1 test coverage before merge waiting-on-customer Waiting on the original author to respond labels Jul 2, 2026
@malay-nagda

Copy link
Copy Markdown
Contributor

@yaoyu-33 with all the changes, do we now need megatron.core and src (other than perf recipes) on login node to launch jobs?

Before the refactor, we only needed nemo_run on login node to launch jobs which avoided dependency issues on login node.

cc: @gautham-kollu

@malay-nagda
malay-nagda requested a review from dingqingy-nv July 2, 2026 09:25
@yaoyu-33
yaoyu-33 force-pushed the yuya/remove-legacy-perf-configs branch from e2497a7 to faf6633 Compare July 3, 2026 00:18
@yaoyu-33
yaoyu-33 changed the base branch from main to yuya/remove-perf-configs-h100-recipes July 3, 2026 00:18
@svcnvidia-nemo-ci

Copy link
Copy Markdown
Contributor

/nvskills-ci

@yaoyu-33

yaoyu-33 commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor Author

@malay-nagda thanks for reminding me, I will double check, this pr not fully ready yet. I will do some proper guarding.

@svcnvidia-nemo-ci

Copy link
Copy Markdown
Contributor

/nvskills-ci

@yaoyu-33
yaoyu-33 force-pushed the yuya/remove-legacy-perf-configs branch from ddde1f0 to 2bf66ec Compare July 3, 2026 16:25
@svcnvidia-nemo-ci

Copy link
Copy Markdown
Contributor

/nvskills-ci

@yaoyu-33

yaoyu-33 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 2bf66ecc2a43501e60caeceb42b703f9837eaf94

@copy-pr-bot

copy-pr-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown

/ok to test 2bf66ecc2a43501e60caeceb42b703f9837eaf94

@yaoyu-33, there was an error processing your request: E2

See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/2/

@yaoyu-33

yaoyu-33 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 2bf66ec

yaoyu-33 and others added 9 commits July 8, 2026 15:16
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Signed-off-by: nvskills-svc-account <svc-nvskills-signing@nvidia.com>
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Signed-off-by: nvskills-svc-account <svc-nvskills-signing@nvidia.com>
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
@yaoyu-33
yaoyu-33 force-pushed the yuya/remove-legacy-perf-configs branch from b5a4de8 to b69936c Compare July 8, 2026 22:16
@svcnvidia-nemo-ci

Copy link
Copy Markdown
Contributor

/nvskills-ci

yaoyu-33 added 3 commits July 8, 2026 15:19
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
@yaoyu-33

yaoyu-33 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test c3556cf

@yaoyu-33
yaoyu-33 force-pushed the yuya/remove-legacy-perf-configs branch from b69936c to c3556cf Compare July 8, 2026 22:23
@svcnvidia-nemo-ci

Copy link
Copy Markdown
Contributor

/nvskills-ci

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

yaoyu-33 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 0f14f15

This branch was previously deployed

2 inactive deployments
public — 0f14f159 Deployed Jul 9, 2026 by copy-pr-bot[bot] via release / finalize / publish-docs #2465
test — 0f14f159 Deployed Jul 8, 2026 by copy-pr-bot[bot] via cicd-wait-in-queue #17629
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:perf Performance optimizations and benchmarking breaking-change Public behavior or API compatibility changes feature New capabilities, enhancements, or enablement work full-test-suite needs-more-tests Requires additional L0 and L1 test coverage before merge waiting-on-customer Waiting on the original author to respond

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants