Skip to content

remove legacy tranformer and modules - #4207

Merged
dimapihtar merged 9 commits into
NVIDIA:mainfrom
dimapihtar:remove_legacy_transformer
May 7, 2026
Merged

remove legacy tranformer and modules#4207
dimapihtar merged 9 commits into
NVIDIA:mainfrom
dimapihtar:remove_legacy_transformer

Conversation

@dimapihtar

Copy link
Copy Markdown
Contributor

What does this PR do ?

Removes legacy tranformer and other legacy modules as a part of MLM code cleanup.

⚠️ For major changes (either in lines of code or in its impact), please make sure to first share a design doc with the team. If you're unsure what's the best way to do so, contact the @mcore-oncall.

Contribution process

Pre-checks

  • I have added relevant unit tests
  • I have added relevant functional tests
  • I have added proper typing to my code Typing guidelines
  • I have added relevant documentation
  • I have run the autoformatter.sh on my PR

Code review

Feel free to message or comment the @mcore-oncall to help accelerate your merge into main. The less complex your PR is, the faster it will be approved and merged!

All PRs start as draft. If you open a non-draft PR, it will be automatically converted to draft.

Step 1: Mark PR as "Ready for Review"

  1. When your PR is ready, click Ready for Review.
  2. An oncall reviewer is auto-assigned and expert reviewers are notified based on your changes.
    • Some PRs may jump straight to step 2. This is determined by .github/CODEOWNERS.

⚠️ Only mark as ready once merge-conflicts are resolved and the CI is passing.
Final Review might get declined if these requirements are not fulfilled.

Step 2: Final Review

For PRs that change megatron/core, once all expert reviewers have approved, the Final Review label is applied automatically and final reviewers are assigned.

For PRs outside megatron/core, this step is skipped.

Step 3: Approved

Once all required reviewers have approved, the Approved label is applied automatically.

Merge

Any member of mcore-engineers will be able to merge your PR.

For MRs into `dev` branch The proposed review process for `dev` branch is under active discussion.

MRs are mergable after one approval by either eharper@nvidia.com or zijiey@nvidia.com.

Signed-off-by: dimapihtar <dpykhtar@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Apr 8, 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.

@dimapihtar dimapihtar added complexity: low Expert Review [deprecated] Apply this label to indicate that your PR is ready for expert review. labels Apr 8, 2026
@dimapihtar

Copy link
Copy Markdown
Contributor Author

/ok to test 53b28f3

@svcnvidia-nemo-ci svcnvidia-nemo-ci added this to the Core 0.16 milestone Apr 8, 2026
@dimapihtar
dimapihtar marked this pull request as ready for review April 8, 2026 14:52
@svcnvidia-nemo-ci
svcnvidia-nemo-ci requested a review from a team April 8, 2026 14:52
Signed-off-by: dimapihtar <dpykhtar@nvidia.com>
@dimapihtar

Copy link
Copy Markdown
Contributor Author

/ok to test 9dc4c7b

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.

all of the model files (gpt_model.py, bert_model.py, t5_model.py, etc.) still point to this file. have these been removed in other PRs, or do they need to be removed in this PR?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, bert & t5 models were already removed

#4203
#4204

gpt model PR is ongoing and will be merged as well: #4322

Comment thread megatron/legacy/model/__init__.py Outdated

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.

removing LayerNorm and RMSNorm also breaks existing model files. We need to either remove the models, or merge in main if they've already been removed.

Comment thread megatron/legacy/model/__init__.py Outdated

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.

a few things that still depend on this module:

  • megatron/training/checkpointing.py
  • tools/checkpoint/loader_legacy.py
  • examples/academic_paper_scripts/detxoify_lm/generate_samples_gpt.py
  • examples/academic_paper_scripts/detxoify_lm/finetune_gpt.py
  • examples/gpt3/gpt_config.yaml

Signed-off-by: dimapihtar <dpykhtar@nvidia.com>
Signed-off-by: dimapihtar <dpykhtar@nvidia.com>
@dimapihtar
dimapihtar requested a review from jaredcasper May 5, 2026 22:21
@dimapihtar

Copy link
Copy Markdown
Contributor Author

/ok to test 56ba238

@dimapihtar
dimapihtar added this pull request to the merge queue May 5, 2026
@svcnvidia-nemo-ci

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started!

You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/25408874973

@svcnvidia-nemo-ci

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started!

You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/25410186567

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 6, 2026
@dimapihtar
dimapihtar added this pull request to the merge queue May 6, 2026
@dimapihtar
dimapihtar removed this pull request from the merge queue due to a manual request May 6, 2026
@dimapihtar
dimapihtar added this pull request to the merge queue May 6, 2026
@dimapihtar
dimapihtar removed this pull request from the merge queue due to a manual request May 6, 2026
@dimapihtar

Copy link
Copy Markdown
Contributor Author

/ok to test 0d4fc55

@dimapihtar
dimapihtar added this pull request to the merge queue May 6, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch May 6, 2026
@dimapihtar

Copy link
Copy Markdown
Contributor Author

/ok to test a1a6b5d

@dimapihtar
dimapihtar enabled auto-merge May 7, 2026 11:30
@dimapihtar
dimapihtar added this pull request to the merge queue May 7, 2026
@svcnvidia-nemo-ci

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started!

You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/25494423909

Merged via the queue into NVIDIA:main with commit 8de8238 May 7, 2026
71 of 73 checks passed
@dimapihtar
dimapihtar deleted the remove_legacy_transformer branch May 7, 2026 12:33
Andron00e pushed a commit to Andron00e/Megatron-LM that referenced this pull request May 28, 2026
…ync-2026-05

Upstream tip: 932d9ee (Add periodic GPU sniff tests, 2026-05-07).

Conflict resolution:
- 13 modify/delete conflicts in .github/* and skills/*: kept deletion
  (matches policy from c037427 removing upstream-NVIDIA CI machinery
  not relevant to this fork).
- AGENTS.md content conflict: kept fork version (skills/contributing
  sections from upstream don't apply since the directories were removed).
- New upstream additions matching the same removal policy were dropped:
  .claude/settings.json, .github/workflows/nightly-sync-main-to-dev.yml,
  skills/{cicd,linting-and-formatting,nightly-sync,run-on-slurm,testing,
  update-golden-values}/SKILL.md.
- SECURITY.md (new from upstream): kept (generic security policy).

Verified post-merge:
- pretrain_gpt.py logging-patch hook intact (lines 405-408).
- megatron/core/optimizer/__init__.py emerging_optimizers + muon logic intact.
- megatron/training/arguments.py custom muon flags intact (lines 2297-2309).

Notable upstream changes pulled in:
- Removed legacy transformer + legacy GPT modules (NVIDIA#4207, NVIDIA#4322).
- Docker base image bump to 26.04-py3 (NVIDIA#4611).
- Inference fixes (vLLM grouped GEMM NVIDIA#4566, FlashInfer sampling NVIDIA#2456,
  EP sync NVIDIA#4607, MoE dispatcher fixes NVIDIA#4576).
- Gradient corruption fix with layerwise param all-gather overlap (NVIDIA#4609).
- Hybrid model + Flextron + GPU sniff tests + named validation sets +
  fault injection + InJob restart.
yhgalaxy pushed a commit to yhgalaxy/Megatron-LM that referenced this pull request Jun 17, 2026
Signed-off-by: dimapihtar <dpykhtar@nvidia.com>
Signed-off-by: yhgalaxy <yhgalaxy@outlook.com>
jon-barker pushed a commit to jon-barker/Megatron-LM that referenced this pull request Jul 10, 2026
Signed-off-by: dimapihtar <dpykhtar@nvidia.com>
Signed-off-by: Jon Barker <jbarker@aws-cmh-slurm-1-vscode-02.cm.cluster>
terminator123 pushed a commit to 021ai/Megatron-LM that referenced this pull request Aug 3, 2026
Signed-off-by: dimapihtar <dpykhtar@nvidia.com>
svcnvidia-nemo-ci pushed a commit to dimapihtar/Megatron-LM that referenced this pull request Aug 4, 2026
Signed-off-by: dimapihtar <dpykhtar@nvidia.com>
Signed-off-by: Dmytro Pykhtar <dpykhtar@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

complexity: high Expert Review [deprecated] Apply this label to indicate that your PR is ready for expert review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants