Skip to content

Upgrade base image to pytorch:26.03-py3 and remove Apex/TE/Megatron#15611

Closed
pzelasko wants to merge 15 commits into
mainfrom
container-cleanup
Closed

Upgrade base image to pytorch:26.03-py3 and remove Apex/TE/Megatron#15611
pzelasko wants to merge 15 commits into
mainfrom
container-cleanup

Conversation

@pzelasko
Copy link
Copy Markdown
Collaborator

@pzelasko pzelasko commented Apr 15, 2026

The CI container had torchao 0.14.0 which is incompatible with recent peft (requires >=0.16.0), causing test_salm_lora to fail. Upgrade the base NGC PyTorch image to 26.03 (torchao 0.17, PyTorch 2.11) and drop all build/install machinery for Apex, TransformerEngine, Megatron-LM, and TensorRT-LLM since NeMo is now Speech AI only.

Important

The Update branch button must only be pressed in very rare occassions.
An outdated branch is never blocking the merge of a PR.
Please reach out to the automation team before pressing that button.

What does this PR do ?

Upgrade base image to pytorch:26.03-py3 and remove Apex/TE/Megatron/TRT-LLM.

The CI container had torchao 0.14.0 which is incompatible with recent peft (requires >=0.16.0), causing test_salm_lora to fail. Upgrade the base NGC PyTorch image to 26.03 (torchao 0.17, PyTorch 2.11) and drop all build/install machinery for Apex, TransformerEngine, Megatron-LM, and TensorRT-LLM since NeMo is now Speech AI only.

Collection: CI

Changelog

  • Upgrade base container image to pytorch:26.03-py3 and remove Apex/TE/Megatron/TRT-LLM.

Usage

  • You can potentially add a usage example below
# Add a code snippet demonstrating how to use this 

GitHub Actions CI

The Jenkins CI system has been replaced by GitHub Actions self-hosted runners.

The GitHub Actions CI will run automatically when the "Run CICD" label is added to the PR.
To re-run CI remove and add the label again.
To run CI on an untrusted fork, a NeMo user with write access must first click "Approve and run".

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you add or update any necessary documentation?
  • Does the PR affect components that are optional to install? (Ex: Numba, Pynini, Apex etc)
    • Reviewer: Does the PR have correct import guards for all optional libraries?

PR Type:

  • New Feature
  • Bugfix
  • Documentation

If you haven't finished some of the above items you can still open "Draft" PR.

Who can review?

Anyone in the community is free to review the PR once the checks have passed.
Contributor guidelines contains specific people who can review PRs to various areas.

Additional Information

  • Related to # (issue)

thomasdhc
thomasdhc previously approved these changes Apr 15, 2026
blisc
blisc previously approved these changes Apr 15, 2026
pzelasko and others added 4 commits April 17, 2026 16:29
…RT-LLM

The CI container had torchao 0.14.0 which is incompatible with recent
peft (requires >=0.16.0), causing test_salm_lora to fail. Upgrade the
base NGC PyTorch image to 26.03 (torchao 0.17, PyTorch 2.11) and drop
all build/install machinery for Apex, TransformerEngine, Megatron-LM,
and TensorRT-LLM since NeMo is now Speech AI only.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Piotr Żelasko <pzelasko@nvidia.com>
Re-add trt-llm entry in manifest.json, trt()/trtllm() functions in
install_dep.sh, TRTLLM build args in CI workflows, trt_llm.patch, and
the external/patches bind mount in Dockerfile.ci.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Piotr Żelasko <pzelasko@nvidia.com>
The wheel package is debian-installed without a RECORD file in
pytorch:26.03-py3, causing 'pip install -U wheel' to fail with
'uninstall-no-record-file'. Install wheel separately with
--ignore-installed so pip places a newer version in the higher-priority
/usr/local site-packages directory.

Signed-off-by: Piotr Żelasko <petezor@gmail.com>
PyYAML is debian-installed without a RECORD file in pytorch:26.03-py3,
so 'pip install .[all,cu12]' fails with 'uninstall-no-record-file' when
transformers/peft try to upgrade it. Add PyYAML to the --ignore-installed
pre-install alongside wheel, using the same shadowing strategy.

Signed-off-by: Piotr Żelasko <pzelasko@nvidia.com>
The pytorch:26.03-py3 NGC base image ships with CUDA 13, so installing
cu12-suffixed wheels (cuda-python<13, numba-cuda[cu12], nvidia-cuda-*-cu12)
alongside the CUDA 13 runtime is wasteful and can cause conflicts. Switch
.[all,cu12] to .[all,cu13] in Dockerfile.ci.

Note: the docs workflows still reference --no-extra cu12 and need to be
updated by someone with workflow-scope token access.

Signed-off-by: Piotr Żelasko <pzelasko@nvidia.com>
@github-actions
Copy link
Copy Markdown
Contributor

I'll monitor this PR until CI is green. I'll post a plan for any fix and wait for your approval before pushing anything. Ping me by removing 'Has Babysitter' to cancel.

Tests were failing at import time with
  RuntimeError: operator torchvision::nms does not exist
because torchvision's compiled ops were built against a different torch
than the one loaded at runtime.

The previous pin captured pip freeze *after* install_dep.sh had already
run. install_dep.sh's extra() does `pip install ${DEPS[@]}` (no --no-deps,
no constraint) which resolves deps of nvidia-modelopt/nemo_run, and pip's
default "prefer stable" behavior could swap the NGC pre-release
torchvision (built against torch 2.11.0a0+nv26.3) with a stable PyPI
build that expects a different torch ABI. We then "pinned" the
already-broken state and perpetuated it.

Capture pip freeze for torch/torchvision/torchaudio/triton *before* any
pip install runs, and export PIP_CONSTRAINT so both install_dep.sh and
the final .[all,cu13] install cannot choose anything other than the NGC
versions.

Signed-off-by: Piotr Żelasko <pzelasko@nvidia.com>
@pzelasko pzelasko changed the title Upgrade base image to pytorch:26.03-py3 and remove Apex/TE/Megatron/TRT-LLM Upgrade base image to pytorch:26.03-py3 and remove Apex/TE/Megatron Apr 21, 2026
@github-actions github-actions Bot removed the Run CICD label Apr 21, 2026
@github-actions
Copy link
Copy Markdown
Contributor

I wasn't able to investigate the CI failure in CICD NeMo. @pzelasko, could you take a look?

@chtruong814 chtruong814 removed the Has Babysitter Claude autonomously takes over the quest to get to a green CI. label Apr 21, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Babysitter deactivated for this PR.

The previous fix captured the NGC torch stack with
    pip freeze --all | grep '^(torch|...)==' > /tmp/nv-pinned.txt || true
but NGC's pip freeze emits torch/torchvision/torchaudio as direct-URL
installs (`torch @ file:///opt/pytorch/...`), not `name==version`. The
grep matched nothing, the pin file was empty, PIP_CONSTRAINT pointed at
an empty file, and pip happily swapped

    torch 2.11.0a0+a6c236b9fd.nv26.3.46836102 -> torch 2.9.1
    triton 3.6.0+git5d72932fc5.nv26.3         -> triton 3.5.1

while leaving NGC torchvision 0.25.0a0+nv26.3 in place. Result: at
import time `torchvision::nms` is registered against the NGC torch
TORCH_LIBRARY that no longer exists, and every unit-test job died on
    RuntimeError: operator torchvision::nms does not exist

Fix: capture versions via importlib.metadata, which reads METADATA
directly and is agnostic to how pip recorded the install source.

Also add a final diagnostic block that (a) logs the post-install torch
stack with `pip freeze` and (b) runs `from torchvision.ops import nms`
as a load-bearing probe, so any future ABI regression fails the
container build instead of silently surfacing at pytest time.

Signed-off-by: Piotr Żelasko <pzelasko@nvidia.com>
@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented Apr 22, 2026

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.

@ko3n1g ko3n1g added the Has Babysitter Claude autonomously takes over the quest to get to a green CI. label Apr 22, 2026
@chtruong814
Copy link
Copy Markdown
Collaborator

@ko3n1g the PR Babysitter is restricted to the NVIDIA-NeMo speech_team. Removing the Has Babysitter label.

@chtruong814 chtruong814 removed the Has Babysitter Claude autonomously takes over the quest to get to a green CI. label Apr 22, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Babysitter deactivated for this PR.

@pzelasko pzelasko added Has Babysitter Claude autonomously takes over the quest to get to a green CI. labels Apr 22, 2026
@github-actions
Copy link
Copy Markdown
Contributor

I'll monitor this PR until CI is green. I'll post a plan for any fix and wait for your approval before pushing anything. Ping me by removing 'Has Babysitter' to cancel.

@github-actions
Copy link
Copy Markdown
Contributor

I wasn't able to investigate the CI failure in CICD NeMo. @pzelasko, could you take a look?

@github-actions
Copy link
Copy Markdown
Contributor

Babysitter deactivated for this PR.

@pzelasko
Copy link
Copy Markdown
Collaborator Author

Closing this PR in favor of #15638
We'll first merge a third, simplified Dockerfile, then switch CI to it, then remove the old Dockerfiles and build on the new one.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants