Repository navigation
Move LTS dependencies from pyproject.toml to Dockerfile.ci.lts #4877
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
a531bc3
refactor: Deprecate 'lts' extra in pyproject.toml and update related …
balasaajay 541ec4e
Merge branch 'NVIDIA:main' into aut-479
balasaajay 64db405
Merge branch 'main' into aut-479
balasaajay f3bdfed
Update pyproject.toml and SKILL.md to reflect the deprecation of the …
balasaajay c0d729f
update uv.lock with pyproject.toml changes
balasaajay ae48317
Refactor LTS Python dependency management by moving pinned dependenci…
balasaajay 351c275
Merge branch 'main' into aut-479
balasaajay c429a8a
Update requirements.txt to include nvidia-resiliency-ext version 0.6.0
balasaajay File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,138 @@ | ||
| # Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. | ||
| # syntax=docker/dockerfile:1.3-labs | ||
| # | ||
| # LTS CI image for Megatron-LM. | ||
| # | ||
| # The LTS image is bumped only once a year and intentionally lags behind the | ||
| # floating dev tag. Its Python dependency set is therefore pinned directly in | ||
| # this Dockerfile (rather than in pyproject.toml) so the pyproject can host | ||
| # meaningful module-level extras (inference, RL, MoE, ...) without colliding | ||
| # with the LTS pin set. See AUT-479 for background. | ||
| # | ||
| # To bump the LTS dependency set: | ||
| # 1. Update the LTS_REQUIREMENTS list below. | ||
| # 2. Rebuild and run the LTS CI lane. | ||
| # 3. (Optional) Bump docker/.ngc_version.lts if also moving the base image. | ||
|
|
||
| ARG FROM_IMAGE_NAME | ||
| FROM ${FROM_IMAGE_NAME} as main | ||
| ENV PIP_CONSTRAINT="" | ||
| ENV DEBIAN_FRONTEND=noninteractive | ||
| ARG UV_VERSION=0.7.2 | ||
| ARG YQ_VERSION=4.44.1 | ||
| ENV PATH="/root/.local/bin:$PATH" | ||
| ARG UV_PROJECT_ENVIRONMENT=/opt/venv | ||
| ENV UV_PROJECT_ENVIRONMENT=${UV_PROJECT_ENVIRONMENT} | ||
| ENV VIRTUAL_ENV=$UV_PROJECT_ENVIRONMENT | ||
| ENV PATH="$UV_PROJECT_ENVIRONMENT/bin:$PATH" | ||
| ENV UV_LINK_MODE=copy | ||
|
|
||
| RUN bash -ex <<"EOF" | ||
| apt-get update | ||
| apt-get install -y --no-install-recommends gettext python3-venv psmisc uuid-runtime | ||
| apt-get clean | ||
| python -m venv /opt/jet | ||
| ARCH=$(uname -m) | ||
| case "${ARCH}" in \ | ||
| "x86_64") YQ_ARCH=amd64 ;; \ | ||
| "aarch64") YQ_ARCH=arm64 ;; \ | ||
| "armv7l") YQ_ARCH=arm ;; \ | ||
| *) echo "Unsupported architecture: ${ARCH}" && exit 1 ;; \ | ||
| esac | ||
| wget https://github.com/mikefarah/yq/releases/download/v${YQ_VERSION}/yq_linux_${YQ_ARCH} -O /usr/local/bin/yq | ||
| chmod a+x /usr/local/bin/yq | ||
| curl -LsSf https://astral.sh/uv/${UV_VERSION}/install.sh | sh | ||
| EOF | ||
|
|
||
| COPY README.md pyproject.toml uv.lock /workspace/ | ||
| COPY megatron/core/__init__.py /workspace/megatron/core/ | ||
| COPY megatron/core/package_info.py /workspace/megatron/core/ | ||
| ENV NVTE_BUILD_NUM_PHILOX_ROUNDS=3 | ||
| RUN --mount=type=cache,target=/root/.cache/uv \ | ||
| bash -ex <<"EOF" | ||
| export NVTE_CUDA_ARCHS="80;90;100" | ||
| uv venv ${UV_PROJECT_ENVIRONMENT} --system-site-packages | ||
| uv sync --only-group build | ||
| uv sync --extra mlm --extra ssm --extra te --link-mode copy --locked \ | ||
| --no-install-package torch \ | ||
| --no-install-package torchvision \ | ||
| --no-install-package triton \ | ||
| --no-install-package transformer-engine-cu12 \ | ||
| --no-install-package nvidia-cublas-cu12 \ | ||
| --no-install-package nvidia-cuda-cupti-cu12 \ | ||
| --no-install-package nvidia-cuda-nvrtc-cu12 \ | ||
| --no-install-package nvidia-cuda-runtime-cu12 \ | ||
| --no-install-package nvidia-cudnn-cu12 \ | ||
| --no-install-package nvidia-cufft-cu12 \ | ||
| --no-install-package nvidia-cufile-cu12 \ | ||
| --no-install-package nvidia-curand-cu12 \ | ||
| --no-install-package nvidia-cusolver-cu12 \ | ||
| --no-install-package nvidia-cusparse-cu12 \ | ||
| --no-install-package nvidia-cusparselt-cu12 \ | ||
| --no-install-package nvidia-nccl-cu12 | ||
| EOF | ||
|
|
||
| # LTS-specific Python dependencies. | ||
| # | ||
| # These used to live in `[project.optional-dependencies].lts` in pyproject.toml, | ||
| # but were moved here (AUT-479) so pyproject.toml can host meaningful per-module | ||
| # extras. Pins are reviewed at LTS bump time only. | ||
| RUN --mount=type=cache,target=/root/.cache/uv \ | ||
| bash -ex <<"EOF" | ||
| uv pip install \ | ||
| "tqdm" \ | ||
| "einops~=0.8" \ | ||
| "tensorstore~=0.1,!=0.1.46,!=0.1.72" \ | ||
| "multi-storage-client~=0.27" \ | ||
| "opentelemetry-api~=1.33.1" \ | ||
| "megatron-energon[av_decode]~=6.0" \ | ||
| "av" \ | ||
| "flashinfer-python>=0.5.0,<0.7.0" \ | ||
| "wget" \ | ||
| "onnxscript" \ | ||
| "fastapi~=0.50" \ | ||
| "datasets" \ | ||
| "emerging_optimizers @ git+https://github.com/NVIDIA-NeMo/Emerging-Optimizers.git@v0.2.0" | ||
| EOF | ||
|
|
||
| # Install DeepEP | ||
| COPY docker/patches/deepep.patch /workspace/deepep.patch | ||
| RUN bash -ex <<"EOF" | ||
| cd /workspace | ||
| uv pip install nvidia-nvshmem-cu13==3.4.5 | ||
| pushd /opt/venv/lib/python3.12/site-packages/nvidia/nvshmem/lib/ | ||
| ln -s libnvshmem_host.so.3 libnvshmem_host.so | ||
| popd | ||
|
|
||
| git clone --branch hybrid-ep https://github.com/deepseek-ai/DeepEP.git | ||
| pushd DeepEP | ||
| git checkout 34152ae28f80bcc3ee38d7a12cb2ad87cfd4ea72 | ||
| patch -p1 < /workspace/deepep.patch | ||
| popd | ||
| TORCH_CUDA_ARCH_LIST="9.0 10.0 12.0" uv pip install --no-build-isolation -v DeepEP/. | ||
| rm -rf DeepEP | ||
| EOF | ||
|
|
||
| COPY assets/ /opt/data/ | ||
| ENV UV_PYTHON=$UV_PROJECT_ENVIRONMENT/bin/python | ||
|
|
||
| ##### For NVIDIANS only ##### | ||
| FROM main as jet | ||
| ARG JET_API_VERSION | ||
| ENV PATH="$PATH:/opt/jet/bin" | ||
| RUN --mount=type=secret,id=JET_INDEX_URLS bash -ex <<"EOF" | ||
| JET_INDEX_URLS=$(cat /run/secrets/JET_INDEX_URLS) | ||
| python -m venv /opt/jet | ||
| /opt/jet/bin/pip install --no-cache-dir $JET_INDEX_URLS \ | ||
| "jet-api==$JET_API_VERSION" "setuptools<82.0.0" | ||
| EOF | ||
|
|
||
| RUN --mount=type=secret,id=JET_INDEX_URLS \ | ||
| --mount=type=secret,id=LOGGER_INDEX_URL bash -ex <<"EOF" | ||
| JET_INDEX_URLS=$(cat /run/secrets/JET_INDEX_URLS) | ||
| LOGGER_INDEX_URL=$(cat /run/secrets/LOGGER_INDEX_URL) | ||
| uv pip install --no-cache-dir --upgrade $LOGGER_INDEX_URL "one-logger" | ||
| uv pip install --no-cache-dir --upgrade "setuptools>=80" | ||
| uv pip install --no-cache-dir --upgrade $JET_INDEX_URLS "jet-client~=4.0" | ||
| EOF | ||
| ### | ||
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these version pinned though? Should we be adding explicit versions to each package?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
they are currently not pinned. but, I think it makes sense to pin these packages and lock LTS packages and their dependencies to specific versions, since LTS needs to be supported for a longer period