perf(distributed): add retrieval tuning knobs#2452
Open
yuhezhang-ai wants to merge 12 commits into
Open
Conversation
Signed-off-by: Yuhe Zhang <yuhez@nvidia.com>
Signed-off-by: Yuhe Zhang <yuhez@nvidia.com>
Signed-off-by: Yuhe Zhang <yuhez@nvidia.com>
Signed-off-by: Yuhe Zhang <yuhez@nvidia.com>
c564193 to
fcfcc72
Compare
Signed-off-by: Yuhe Zhang <yuhez@nvidia.com>
fcfcc72 to
3387071
Compare
Signed-off-by: Yuhe Zhang <yuhez@nvidia.com>
Contributor
Author
|
/ok to test e703720 |
Signed-off-by: Yuhe Zhang <yuhez@nvidia.com>
Contributor
Author
|
/ok to test 3239799 |
Signed-off-by: Yuhe Zhang <yuhez@nvidia.com>
Signed-off-by: Yuhe Zhang <yuhez@nvidia.com>
Contributor
Author
|
/ok to test 4d43a66 |
Signed-off-by: Yuhe Zhang <yuhez@nvidia.com>
Contributor
Author
|
/ok to test 55343c9 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do ?
Adds distributed tuning and retrieval training fixes used for Nemotron VL retrieval fine-tuning benchmarks. The main goals are to make DDP configurable and faster for retrieval, preserve retrieval optimizer parameter groups, and make loss logging easier to compare with nemo-retriever-research.
Changelog
broadcast_buffersfind_unused_parametersstatic_graphbucket_cap_mbgradient_as_bucket_viewtorch.nn.parallel.DistributedDataParallel.reshard_after_forwardso no-reshard variants can be configured from YAML.reshard_after_forwardthrough the FSDP2 manager and recursive sharding helper.build_from_param_groups(...).step_scheduler.loss_average_window_stepswith default50.loss_avg_windowalongside raw per-steploss, so noisy retrieval loss curves can be compared more easily in W&B or local Slurm logs.Notes
loss_avg_windowis intentionally scoped understep_schedulerbecause it controls training-step logging behavior, similar tolog_every_stepsandlog_remote_every_steps.Before your PR is "Ready for review"
Pre checks:
Additional Information
mainbefore the latest update.Validation on current rebased branch:
git diff --check origin/main...HEADpython -m py_compile nemo_automodel/components/optim/optimizer.py nemo_automodel/components/training/step_scheduler.py nemo_automodel/recipes/retrieval/train_bi_encoder.py nemo_automodel/components/distributed/ddp.py nemo_automodel/components/training/utils.pyEarlier validation before the latest rebase:
source work/runs/_shared/env.sh && uv run --no-sync ruff check ...source work/runs/_shared/env.sh && uv run --no-sync ruff format --check ...git diff --checksource work/runs/_shared/env.sh && uv run --no-sync pytest tests/unit_tests/recipes/test_dist_setup.py tests/unit_tests/distributed/test_parallelizer.py tests/unit_tests/distributed/test_ddp_manager.py -q126 passed, 17 warningsExperiment sanity checks:
weight_decay=0.1, 40-minute run reached step 1763 and ended due to Slurm time limit without a Python exception.weight_decay=0.1, 40-minute run reached step 2002 and ended due to Slurm time limit without a Python exception.Latest Update (2026-06-13)
distributed.autocast_dtype; default remains disabled.compile:config into retrieval bi-encoder model instantiation for DDP compile experiments.Additional validation:
uv run pytest tests/unit_tests/recipes/test_retrieval_bi_encoder_recipe.py tests/unit_tests/recipes/test_dist_utils.py -q(77 passed)uv run ruff checkon touched retrieval/distributed files