Skip to content

Commit 9912987

Browse files
build: move cudnn-frontend override from Dockerfile.ci to Dockerfile.fw_final
fw_final inherits the Bridge image and re-syncs with fw_pyproject.toml, which would replace a git install made earlier. Install the feat/1.29.0-megatron ref after that sync instead, and drop it from Dockerfile.ci so it lives in one place. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Zhiyu Li <zhiyul@nvidia.com>
1 parent 16c4cbd commit 9912987

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

‎docker/Dockerfile.ci‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,6 @@ RUN if [ -n "$BASELINE_MCORE_REF" ]; then \
176176
ARG MCORE_TRIGGERED_TESTING=false
177177
ARG UV_CACHE_PRUNE_ARGS
178178

179-
# cuDNN Frontend is replaced after the final sync with this ref of NVIDIA/cudnn-frontend
180-
# (feat/1.29.0-megatron). Docker-only: outside pyproject.toml and uv.lock. Set empty to keep the
181-
# locked PyPI wheel.
182-
ARG CUDNN_FRONTEND_GIT_REF=8924d4b41fd678ba1b98cd7f98bb78b222637573
183-
184179
# TransformerEngine builds from source during uv sync. Target the GPUs CI runs on: Hopper, plus
185180
# Blackwell, which TE expands to 100a and 103a (B200, GB200, B300). TE's own default adds
186181
# 75, 80, 89, and 120.
@@ -260,10 +255,6 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
260255
uv sync --link-mode copy --locked --all-extras --all-groups --no-group diffusion --no-install-package mamba-ssm ${BASE_RUNTIME_UV_ARGS}; \
261256
fi && \
262257
bash /opt/install_mamba.sh /opt/Megatron-Bridge/uv.lock /opt/mamba.patch && \
263-
if [ -n "$CUDNN_FRONTEND_GIT_REF" ] && [ "$MBRIDGE_PRESERVE_BASE_RUNTIME" != "True" ]; then \
264-
uv pip install --no-deps --reinstall \
265-
"nvidia-cudnn-frontend @ git+https://github.com/NVIDIA/cudnn-frontend.git@${CUDNN_FRONTEND_GIT_REF}"; \
266-
fi && \
267258
python /opt/preserve_base_runtime.py check /opt/base-runtime-packages.json && \
268259
# uv may retain the baseline editable MCore wheel when only its source tree changes.
269260
# Rebuild the dispatched checkout so its optional dataset helper is present.

‎docker/Dockerfile.fw_final‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ RUN pushd /opt/Export-Deploy && \
5757
echo "Container built with NeMo-Run commit hash: $NEMO_RUN_COMMIT" && \
5858
popd
5959

60+
# cuDNN Frontend is replaced after the sync below with this ref of NVIDIA/cudnn-frontend
61+
# (feat/1.29.0-megatron). Docker-only: outside fw_pyproject.toml and uv.lock. Set empty to keep the
62+
# PyPI wheel.
63+
ARG CUDNN_FRONTEND_GIT_REF=8924d4b41fd678ba1b98cd7f98bb78b222637573
64+
6065
# Sync environment
6166
COPY --chmod=644 docker/common/fw_pyproject.toml /opt/NeMo-FW/pyproject.toml
6267
COPY --chmod=644 docker/common/_version.py docker/common/print_sha.sh /opt/NeMo-FW/
@@ -69,6 +74,10 @@ RUN \
6974
BASE_RUNTIME_UV_ARGS="--no-install-package nvidia-cudnn-frontend --no-install-package transformer-engine --no-install-package transformer-engine-torch"; \
7075
fi && \
7176
uv sync --no-cache-dir --all-groups --inexact ${BASE_RUNTIME_UV_ARGS} && \
77+
if [ -n "$CUDNN_FRONTEND_GIT_REF" ] && [ "${MBRIDGE_PRESERVE_BASE_RUNTIME:-False}" != "True" ]; then \
78+
uv pip install --no-cache-dir --no-deps --reinstall \
79+
"nvidia-cudnn-frontend @ git+https://github.com/NVIDIA/cudnn-frontend.git@${CUDNN_FRONTEND_GIT_REF}"; \
80+
fi && \
7281
python /opt/preserve_base_runtime.py check /opt/base-runtime-packages.json && \
7382
uv pip list && \
7483
chmod +x print_sha.sh && \

‎docker/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ Docker-only dependency, outside `pyproject.toml` and `uv.lock`.
6464
| `INSTALL_DIFFUSION_DEPS` | When `true`, runs `scripts/install_diffusion_deps.sh` to add WAN codecs to a CI image; defaults to `false` so CVE-carrying codecs stay out of shipped Framework images |
6565
| `UV_CACHE_PRUNE_ARGS` | Extra arguments forwarded to `uv cache prune` after install |
6666
| `PRESERVE_BASE_RUNTIME` | Preserve a validated base runtime through dependency installation; defaults to `False`. See [base runtime preservation](#preserving-a-validated-base-runtime). |
67-
| `CUDNN_FRONTEND_GIT_REF` | Commit of [NVIDIA/cudnn-frontend](https://github.com/NVIDIA/cudnn-frontend) (`feat/1.29.0-megatron`) installed over the locked cuDNN frontend after the final sync; empty keeps the locked PyPI wheel. Docker-only, outside `pyproject.toml` and `uv.lock`; skipped when `PRESERVE_BASE_RUNTIME=True`. |
6867

6968
Use the diffusion dependency opt-in only for CI images that run the diffusion test suite:
7069

@@ -251,6 +250,7 @@ docker build \
251250
| `NEMO_EXPORT_DEPLOY_COMMIT` | NeMo Export-Deploy git commit SHA |
252251
| `NEMO_EVALUATOR_COMMIT` | NeMo Evaluator git commit SHA |
253252
| `NEMO_RUN_COMMIT` | NeMo Run git commit SHA |
253+
| `CUDNN_FRONTEND_GIT_REF` | Commit of [NVIDIA/cudnn-frontend](https://github.com/NVIDIA/cudnn-frontend) (`feat/1.29.0-megatron`) installed over the PyPI cuDNN frontend after the environment sync; empty keeps the PyPI wheel. Docker-only, outside `fw_pyproject.toml`; skipped when `PRESERVE_BASE_RUNTIME=True`. |
254254

255255
---
256256

0 commit comments

Comments
 (0)