Skip to content

chore: nightly sync main into dev (28_04_2026) - #4505

Closed
svcnvidia-nemo-ci wants to merge 49 commits into
devfrom
main2dev/28_04_2026
Closed

chore: nightly sync main into dev (28_04_2026)#4505
svcnvidia-nemo-ci wants to merge 49 commits into
devfrom
main2dev/28_04_2026

Conversation

@svcnvidia-nemo-ci

Copy link
Copy Markdown
Contributor

Summary

Nightly sync of main into dev for 2026-04-28. Squashes 42 commits from main into the dev branch.

Python lines: +11647 / -2593 across 129 files

Files where main's version was taken

Per the nightly-sync skill, the following files were overridden with main's version because dev's version referenced args / APIs that main has removed or renamed:

  • megatron/training/training.py — references dev-only args; main has the more recent control-flow
  • megatron/training/utils.py — references dev-only args
  • megatron/training/datasets/data_samplers.py — main's MegatronFullValidationSampler plus
    HybridCPMegatronPretrainingSampler are the canonical implementations

Beyond the explicit override list, megatron/training/initialize.py was kept at dev's version
because main's call passes hybrid_context_parallel= to initialize_model_parallel, which dev's
function signature no longer accepts (renamed/refactored to dynamic_context_parallel +
min_dynamic_context_parallel_size).

Files restored from main

  • megatron/core/pipeline_parallel/hybrid_cp_schedule.py — dev had renamed/removed it during the
    Dynamic CP refactor; main's data_schedule.py::HybridCPDataLoaderWrapper (used by
    training.py for the deprecated hybrid_context_parallel feature) still imports
    BalancedCPScheduler from it.

Special-case merges

  • megatron/core/datasets/data_schedule.py — kept dev's file (Dynamic-CP schedulers) and
    appended main's HybridCPDataLoaderWrapper class verbatim. Imports updated to add
    BalancedCPScheduler and the typing helpers (Any, List).

Files kept at dev's version (dependency-management triple + CODEOWNERS)

  • pyproject.toml (dev-only nvtx~=0.2, fast-hadamard-transform, dev-pinned
    nvidia-resiliency-ext revision)
  • uv.lock (machine-generated; matches pyproject.toml)
  • docker/Dockerfile.ci.dev
  • .github/CODEOWNERS (intentionally divergent from main; sync bot must never touch this)

No new git sources were present in main but missing from dev, so no [tool.uv.sources]
reconciliation was needed.

Formatting

All changed Python files were formatted with black --skip-magic-trailing-comma --skip-string-normalization (24.10) followed by isort (5.13.2).
pylint reports 10.00/10 on the changed megatron/core/ files.

Remerge-diff stat (only shows where conflict resolution differed from a clean three-way merge)
 examples/mimo/train.py                            |   3 -
 megatron/core/transformer/moe/fused_a2a.py        |  13 -
 megatron/core/transformer/moe/token_dispatcher.py |   4 -
 megatron/core/transformer/transformer_config.py   |  27 -
 megatron/training/activation_logging.py           |   7 -
 megatron/training/arguments.py                    | 280 ----------
 megatron/training/checkpointing.py                |  20 -
 megatron/training/training.py                     |  72 ---
 pretrain_bert.py                                  |  13 -
 pretrain_mamba.py                                 | 363 -------------
 pretrain_vlm.py                                   |   5 -
 tests/unit_tests/models/test_hybrid_moe_model.py  |   4 -
 tools/checkpoint/checkpoint_inspector.py          |   5 -
 tools/checkpoint/remap_gpt_dsa_to_mamba.py        |   7 -
 train_rl.py                                       |   7 -
 uv.lock                                           | 635 ----------------------

Test plan

  • linting
  • cicd-container-build (dev + lts)
  • Coverage (unit-test) and unit-test workers
  • Internal GitLab functional tests (H100 + GB200)
  • Nemo_CICD_Test

🤖 Generated with Claude Code

minitu and others added 30 commits April 22, 2026 18:02
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>
…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>
@svcnvidia-nemo-ci svcnvidia-nemo-ci added Run functional tests Run MBridge tests Attach this for testing this PR against MBridge main labels Apr 28, 2026
@svcnvidia-nemo-ci

Copy link
Copy Markdown
Contributor Author

/ok to test cd2001d

The merge took main's version of transformer_config.py for the conflict
regions but kept dev's references (in non-conflicting blocks) to
moe_expert_rank_capacity_factor, moe_hybridep_num_sms_preprocessing, and
moe_mlp_glu_interleave_size. Restore these field declarations from dev
so the dataclass matches what the validation logic and call sites expect.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: svcnvidia-nemo-ci <svcnvidia-nemo-ci@nvidia.com>
@svcnvidia-nemo-ci

Copy link
Copy Markdown
Contributor Author

/ok to test 54cbb38

- Add num_sms_preprocessing_api parameter to init_hybrid_ep_buffer().
  The merge took main's function signature (without this param) but
  kept dev's call site that passes it; restore the parameter so the
  signatures match.
- Add moe_hybridep_num_sms_preprocessing to GOLDEN_CONFIG in
  test_hybrid_moe_model.py to acknowledge the new arg now exposed
  on TransformerConfig.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: svcnvidia-nemo-ci <svcnvidia-nemo-ci@nvidia.com>
@svcnvidia-nemo-ci

Copy link
Copy Markdown
Contributor Author

/ok to test 0e9f938

Forward takes 13 args (including num_sms_preprocessing_api restored
in the previous commit), so backward must return 13 gradients. The
merge dropped the final None that aligned with num_sms_preprocessing_api.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: svcnvidia-nemo-ci <svcnvidia-nemo-ci@nvidia.com>
@svcnvidia-nemo-ci

Copy link
Copy Markdown
Contributor Author

/ok to test 3d25b74

Phlip79 and others added 2 commits April 29, 2026 17:22
The nightly sync took main's data_samplers.py verbatim, which only sets
the no-op collate_fn = lambda x: x when args.hybrid_context_parallel is
true. Dev's pre-merge version had the same override gated on
args.dynamic_context_parallel; that branch was lost in the merge.

Without it, PyTorch's default collate runs on a list of variable-length
packed-sequence dicts and trips the shared-storage stack path with
"RuntimeError: Trying to resize storage that is not resizable", crashing
gpt3_mcore_te_tp2_pp1_cp4_dcp.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The nightly sync took main's training.py verbatim, which lost dev's
calls to wrap_data_iterator at the two sites that drive sequence
packing for Dynamic-CP / DP-balanced THD. Without the wrap, the data
iterator yields a list-of-dicts (one per sample) instead of the single
packed dict containing cu_seqlens / cu_seqlens_padded / max_seqlen /
local_cp_size, so get_batch_on_this_rank_for_sequence_packing trips
"AssertionError: cu_seqlens is missing in current batch" on the first
training step (e.g. gpt3_mcore_te_tp2_pp1_cp4_dcp).

Restored at both sites that dev wraps:
- train_step: rebinds local data_iterator, takes scheduled num_microbatches
- evaluate: uses local packed_data_iterator / scheduled_eval_num_microbatches
  to keep the outer iterator intact across the eval loop, with
  StopIteration handled per dev's pattern

Not restored: dev's seqlen-aware num_floating_point_operations signature
(2-arg -> 4-arg) and the seqlen_sum_this_global_batch /
seqlen_squared_sum_this_global_batch plumbing. That is a larger merge
scope and only affects FLOPs accuracy in tensorboard, not correctness.
The third forward_backward_func call in evaluate (process_non_loss_data
path) is also intentionally not wrapped, matching dev.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Phlip79

Phlip79 commented Apr 29, 2026

Copy link
Copy Markdown
Member

/ok to test 42f1108

@svcnvidia-nemo-ci

Copy link
Copy Markdown
Contributor Author

Superseded by today's nightly sync.

@Phlip79 Phlip79 reopened this Apr 29, 2026
@Phlip79
Phlip79 marked this pull request as ready for review April 29, 2026 23:51
@Phlip79
Phlip79 requested review from a team as code owners April 29, 2026 23:51
@Phlip79
Phlip79 requested a review from yaox12 April 30, 2026 01:35
@yaox12
yaox12 requested a review from FDecaYed April 30, 2026 03:56
@FDecaYed

Copy link
Copy Markdown
Contributor

@xiaoyao0115 to fix the dynamic context parallel related code. I think claude is taking main over dev but in this case main is lagging behind since the mirror PR has not been merged.

@svcnvidia-nemo-ci

Copy link
Copy Markdown
Contributor Author

Superseded by today's nightly sync.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

complexity: high Run functional tests Run MBridge tests Attach this for testing this PR against MBridge main

Projects

None yet

Development

Successfully merging this pull request may close these issues.