Skip to content

Dockerfile: build from the official PyTorch image#15638

Merged
artbataev merged 5 commits into
mainfrom
vbataev/updated_dockerfile
Apr 25, 2026
Merged

Dockerfile: build from the official PyTorch image#15638
artbataev merged 5 commits into
mainfrom
vbataev/updated_dockerfile

Conversation

@artbataev
Copy link
Copy Markdown
Collaborator

@artbataev artbataev commented Apr 22, 2026

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 ?

Add Dockerfile.stable to build a container with NeMo from official PyTorch container https://hub.docker.com/r/pytorch/pytorch/tags

Collection: [Note which collection this PR will affect]

Changelog

  • Add specific line by line info of high level changes in this PR.

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)

@artbataev artbataev requested a review from pzelasko April 22, 2026 20:09
@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.

@artbataev artbataev force-pushed the vbataev/updated_dockerfile branch from 5e37348 to 76217fb Compare April 22, 2026 20:17
Comment thread docker/Dockerfile.stable Outdated
COPY tutorials /workspace/nemo/tutorials
# COPY README.rst LICENSE /workspace/nemo/

# Fix for Megatron: set a permanent location inside the container (NOT /tmp, which might get wiped)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Where is Megatron coming from? We removed it

Copy link
Copy Markdown
Collaborator Author

@artbataev artbataev Apr 22, 2026

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I thought megatron-fsdp is a standalone lib with no dependency on Megatron Core / LM

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Removed

Comment thread docker/Dockerfile.stable Outdated
# Check install
# NB: adjusting LD_LIBRARY_PATH (only here, should not be persistent!) is a temporary hack
# to avoid failure if CUDA is unavailable (`docker build` does not expose GPUs)
# The error is raised in NeMo Core, and the main reason is reinstalled Transformer-Engine;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What is installing Transformer Engine? We can install it for Automodel's fast-path in the container, but I'm surprised it's present somehow

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Removed

Comment thread docker/Dockerfile.stable Outdated
# The error is raised in NeMo Core, and the main reason is reinstalled Transformer-Engine;
RUN CHECK_MSG=$(export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${CUDA_HOME}/compat/lib.real && \
python -c "import nemo.collections.asr as nemo_asr" && \
python -c "import nemo.collections.nlp as nemo_nlp" && \
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This collection no longer exists

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed

Comment thread docker/Dockerfile.stable Outdated
apt-get install -y \
libtool \
libltdl-dev \
automake \
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What do we need various build tools listed here for? BTW I thought we removed K2 dependency (mostly), and it's not in this container - do we want to keep supporting it?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Removed

Comment thread docker/Dockerfile.stable Outdated

# base image: official PyTorch image
ARG BASE_IMAGE=pytorch/pytorch:2.10.0-cuda13.0-cudnn9-devel
# NB: automodel requires torch<=2.10.0, cannot use 2.11.0 for now
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@adil-a is this true? if yes, why is max torch version capped in Automodel?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Change for max version is from here: https://github.com/NVIDIA-NeMo/Automodel/pull/1004/changes (was 2.9.0 before this PR)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Updated automodel -> now using pytorch 2.11.0

Comment thread docker/Dockerfile.stable
else echo "Import check success"; fi


# copy scripts/examples/tests into container for end user
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why not copy the entire repo?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I think that the idea is to copy only necessary separate parts of the repo. NeMo is installed in non-editable mode. But if copied, it can be used or not used (through automatic addition to PYTHONPATH) depending on the directory used.
I would prefer to keep it as is (copy only scripts/examples/test/tutorials). If someone wants to change NeMo code - it is possible through mounting the directory and manually adjusting PYTHONPATH.

Signed-off-by: Vladimir Bataev <vbataev@nvidia.com>
Signed-off-by: Vladimir Bataev <vbataev@nvidia.com>
Signed-off-by: Vladimir Bataev <vbataev@nvidia.com>
@artbataev artbataev force-pushed the vbataev/updated_dockerfile branch from 0e9ca32 to 64b7733 Compare April 22, 2026 20:53
Signed-off-by: Vladimir Bataev <vbataev@nvidia.com>
@artbataev artbataev marked this pull request as ready for review April 23, 2026 19:50
@artbataev artbataev changed the title Update Dockerfile: build from the official PyTorch image Dockerfile: build from the official PyTorch image Apr 23, 2026
Copy link
Copy Markdown
Collaborator

@pzelasko pzelasko left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions
Copy link
Copy Markdown
Contributor

[🤖]: Hi @artbataev 👋,

We wanted to let you know that a CICD pipeline for this PR just finished successfully.

So it might be time to merge this PR or get some approvals.

@artbataev artbataev merged commit 2223816 into main Apr 25, 2026
267 checks passed
@artbataev artbataev deleted the vbataev/updated_dockerfile branch April 25, 2026 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants