chore: nightly sync main into dev (06_05_2026)#4659
Closed
svcnvidia-nemo-ci wants to merge 108 commits into
Closed
chore: nightly sync main into dev (06_05_2026)#4659svcnvidia-nemo-ci wants to merge 108 commits into
svcnvidia-nemo-ci wants to merge 108 commits into
Conversation
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: Xin Yao <xiny@nvidia.com>
Co-authored-by: john2 <john2@jrlogin01.jureca>
Signed-off-by: Charlie Truong <chtruong@nvidia.com>
Co-authored-by: root <root@nvl72098-T17.cm.cluster> Co-authored-by: William Dykas <wdykas@oci-hsg-cs-001-vscode-03.cm.cluster> Co-authored-by: root <root@nvl72160-T13.cm.cluster>
…classmethod (#3812) Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Dmytro Pykhtar <37850217+dimapihtar@users.noreply.github.com>
Signed-off-by: oliver könig <okoenig@nvidia.com>
#4403) Co-authored-by: Antoni-Joan Solergibert <asolergibert@nvidia.com>
Co-authored-by: Philip Petrakian <ppetrakian@nvidia.com>
Signed-off-by: Maanu Grover <maanug@nvidia.com> Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Signed-off-by: dimapihtar <dpykhtar@nvidia.com>
Signed-off-by: dimapihtar <dpykhtar@nvidia.com>
Co-authored-by: Siddharth Singh <sidsingh@nvidia.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…nference cuda graph scope for hybrid models (#4440)
…ss curve gaps for latent MoE models (#4433) Signed-off-by: root <jiemingz@nvidia.com>
…4158) Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…4422) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: rprenger <rprenger@nvidia.com>
Signed-off-by: qiyuw <qiyuw@nvidia.com> Co-authored-by: Antoni-Joan Solergibert <asolergibert@nvidia.com>
Signed-off-by: Keshav Santhanam <ksanthanam@nvidia.com>
Author
|
/ok to test 46ee761 |
Author
|
Superseded by today's nightly sync. |
# Conflicts: # megatron/core/distributed/param_and_grad_buffer.py
Member
|
/ok to test 676f3fa |
…but in dev Signed-off-by: Deyu Fu <deyuf@nvidia.com>
Contributor
|
/ok to test 0cb4ec3 |
Member
|
/ok to test 2207908 |
Author
|
Superseded by today's nightly sync. |
Author
|
Superseded by today's nightly sync. |
Phlip79
added a commit
that referenced
this pull request
May 11, 2026
Brings forward six regressions previously fixed manually on PR #4659 (commits 676f3fa, d019432, 2207908) that the new sync of main into dev re-introduced, plus one further dropped import that surfaced as a runtime NameError on gpt_dynamic_inference CI: - transformer_layer.py: add input_ids=None to _forward_mlp_router so the body's input_ids reference (line 2103) resolves; callers already pass input_ids from _forward_mlp. - param_and_grad_buffer.py: replace inline fp8_params else-branch in finish_param_sync with self._post_param_sync() to match the three other call sites and dev's refactor (PR #4563). - moe_layer.py: call _maybe_record_overload_factor() on dispatched_input before the routed-experts conditional, as on dev. - token_dispatcher.py: pass num_sms_preprocessing_api=self.config.moe_hybridep_num_sms_preprocessing to _HybridEPManager constructor. - datasets/readme.md: restore the dev-only "Packing Scheduler" documentation section before main's "Offline cache preparation". - gpt_dynamic_inference_with_coordinator.py: restore `from megatron.training.arguments import parse_and_validate_args` import; the call at line 216 raised NameError on the gpt_dynamic_inference_tp2_pp2_dp2_583m_logitsmatch_zmq CI job. Verified: ast.parse OK on all 5 changed .py files; ruff F821 reports only pre-existing TYPE_CHECKING-guarded names; CODEOWNERS and the pyproject.toml/uv.lock/Dockerfile.ci.dev triple unchanged from origin/dev.
Phlip79
added a commit
that referenced
this pull request
May 11, 2026
Brings forward six regressions previously fixed manually on PR #4659 (commits 676f3fa, d019432, 2207908) that the new sync of main into dev re-introduced, plus one further dropped import that surfaced as a runtime NameError on gpt_dynamic_inference CI: - transformer_layer.py: add input_ids=None to _forward_mlp_router so the body's input_ids reference (line 2103) resolves; callers already pass input_ids from _forward_mlp. - param_and_grad_buffer.py: replace inline fp8_params else-branch in finish_param_sync with self._post_param_sync() to match the three other call sites and dev's refactor (PR #4563). - moe_layer.py: call _maybe_record_overload_factor() on dispatched_input before the routed-experts conditional, as on dev. - token_dispatcher.py: pass num_sms_preprocessing_api=self.config.moe_hybridep_num_sms_preprocessing to _HybridEPManager constructor. - datasets/readme.md: restore the dev-only "Packing Scheduler" documentation section before main's "Offline cache preparation". - gpt_dynamic_inference_with_coordinator.py: restore `from megatron.training.arguments import parse_and_validate_args` import; the call at line 216 raised NameError on the gpt_dynamic_inference_tp2_pp2_dp2_583m_logitsmatch_zmq CI job. Verified: ast.parse OK on all 5 changed .py files; ruff F821 reports only pre-existing TYPE_CHECKING-guarded names; CODEOWNERS and the pyproject.toml/uv.lock/Dockerfile.ci.dev triple unchanged from origin/dev.
Phlip79
added a commit
that referenced
this pull request
May 11, 2026
The Phase 1 merge of #4716 took main's version of training.py per the skill's "Files to Override from Main" rule, which uses the HybridCPDataLoaderWrapper class wrapped once outside train_step. That broke the DCP test (gpt3_mcore_te_tp2_pp1_cp4_dcp) in two ways: 1. RuntimeError: Trying to resize storage that is not resizable - fixed by c3dbea7 (rename args.hybrid_context_parallel -> args.dynamic_context_parallel). 2. AssertionError: data iterator is not wrapped with RerunDataIterator - the outside-train_step wrap converted train_data_iterator from a RerunDataIterator to a plain iterator, but rerun_state_machine's should_run_forward_backward asserts the wrap. PR #4659 resolved this by keeping dev's wrap_data_iterator pattern instead of main's HybridCPDataLoaderWrapper, calling wrap_data_iterator INSIDE train_step (after should_run_forward_backward) and inside the eval loop. That keeps the original RerunDataIterator visible to the assertion and only swaps in the packed iterator for the forward_backward_func call. Port that pattern verbatim from PR #4659's training.py: - Replace HybridCPDataLoaderWrapper import with wrap_data_iterator - Remove the outside-train_step wrap (was at line 3000-3001) - Inside train_step: add the if config.sequence_packing_scheduler is not None block before forward_backward_func, unpacking (data_iterator, num_microbatches, seqlen_sum_this_global_batch, seqlen_squared_sum_this_global_batch); pass num_microbatches= num_microbatches to forward_backward_func - Inside eval loop: add the same wrap with try/except StopIteration, using packed_data_iterator and scheduled_eval_num_microbatches Note: this leaves HybridCPDataLoaderWrapper and its imports (Any, List, BalancedCPScheduler) as dead code in megatron/core/datasets/data_schedule.py. Cleanup of that file (and of the remaining structural diff in training.py / data_samplers.py / utils.py vs PR #4659's tree) is left to follow-up.
Phlip79
added a commit
to Phlip79/Megatron-LM
that referenced
this pull request
May 14, 2026
…y schedule
Two changes to the main-to-dev nightly sync workflow:
1. Add a "Dev-feature preservation audit" to the existing pre-push
invariant checks in the nightly-sync skill
(`.claude/skills/nightly-sync/SKILL.md`). The audit is bash that
the sync bot must run before every push (Phase 1 and every Phase 3
fix-push):
for f in $(git diff --name-only "$BASE"...HEAD ...); do
missing=$(comm -23 \
<(git show "origin/dev:$f" | sort -u) \
<(git show "origin/main:$f" | sort -u) \
| comm -23 - <(sort -u "$f") \
| grep -E '[[:alnum:]_]' )
[ -n "$missing" ] && record_violation
done
Lines present on `origin/dev`, absent from `origin/main`, and absent
from the merged tree are the textbook "main2dev silently reverted a
dev-only feature" pattern that bit NVIDIA#4659 and NVIDIA#4716. The audit
exempts the skill's "Files to Override from Main" list (the bot may
legitimately keep main's version there) and skips the dependency
triple plus CODEOWNERS (already checked separately).
Recent regressions the audit would have caught:
- `transformer_layer.py` `_forward_mlp_router(input_ids=None)`
- `token_dispatcher.py` `num_sms_preprocessing_api=...` kwarg
- `moe_layer.py` `self._maybe_record_overload_factor(...)` call
- `gpt_dynamic_inference_with_coordinator.py`
`parse_and_validate_args` import
- `datasets/readme.md` "Packing Scheduler" section
- `data_samplers.py` / `utils.py` / `training.py`
`args.dynamic_context_parallel` references
2. Schedule change in `.github/workflows/nightly-sync-main-to-dev.yml`:
was `cron: '0 21 * * *'` (daily at 21:00 UTC); now
`cron: '0 15 * * 1,4'` (Mondays and Thursdays at 15:00 UTC, i.e.
8 AM PDT / 7 AM PST since GitHub Actions cron is UTC-only).
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.
Summary
Nightly sync of
mainintodev.maingit merge origin/main -X theirs --no-edit, with manual reconciliation for known conflicts.Files taken from main
megatron/core/optimizer/layer_wise_optimizer.py(no-op; identical between main and dev currently)Files kept on dev (overriding the skill's default of taking main's version)
The skill recommends taking main's version of these files for known semantic conflicts. In this sync the situation is reversed — dev's versions are the more current ones. Main's versions reference
args.hybrid_context_parallel, but dev renamed that flag toargs.dynamic_context_parallel(commitcde56a4"Fix for rope when enabling THD + Dynamic-CP; use the naming Dynamic-CP"). Taking main's versions would cascade intoAttributeErrorat runtime.megatron/training/training.pymegatron/training/utils.pymegatron/training/initialize.pymegatron/training/datasets/data_samplers.pyFiles deleted in main, accepted as deletion
These were legacy GPT loaders removed in main #4322 ("remove legacy GPT code"). Nothing in the merged tree references them.
tools/checkpoint/loader_legacy.pytools/checkpoint/loader_llama_mistral.pyFiles deleted in dev, NOT restored
megatron/core/pipeline_parallel/hybrid_cp_schedule.pywas intentionally removed in dev (commitcde56a4) as part of the dynamic-CP refactor. Not restored, since the merged tree uses dev'swrap_data_iteratormechanism — no caller importsBalancedCPSchedulerorHybridCPDataLoaderWrapper.Dependency triple kept on dev
Per the skill's hard rule:
pyproject.toml,uv.lock,docker/Dockerfile.ci.devwere restored fromorigin/dev. Dev'snvidia-resiliency-extpinned revision (15a8515) was verified to contain all APIs the merged tree imports (get_write_results_queue,CheckpointMetadataCache,CachedMetadataFileSystemReader, etc.). No git-source reconciliation required.API mismatch detection
After taking main's version of files (then later reverting), audited:
multi_latent_attention.pycallsoff_interface.group_offload()andoff_interface.group_commit()— both exist on dev'sFineGrainedActivationOffloadingInterfacegpt_model.pyandhybrid_model.pycallinit_chunk_handler(6 kwargs)— matches dev's signature_resolve_cu_seqlensexists on dev'sGatedDeltaNet_is_distopt_quantized_paramexists on dev'sDistributedOptimizerCudaGraphScopeexists in dev'senums.pyNo active mismatches remain.
Linting
black --config pyproject.toml(24.10.0): no diffisort(5.13.2): no diffpylinton changedmegatron/core/files (84 files): 10.00/10Remerge diff
Remerge diff stat (file-level summary)
Full diff omitted to keep the PR body compact (~10k lines). Reviewers can run
git show --remerge-diff 431ac5df05104bc1d5015f5ac1842285d1c5e6eelocally or browse the merge commit on GitHub.