Skip to content

cp: build: Fix ngc pytorch build with deep-ep (1234) into r0.4.0 - #1299

Merged
terrykong merged 1 commit into
r0.4.0from
cherry-pick-1234-r0.4.0
Oct 7, 2025
Merged

cp: build: Fix ngc pytorch build with deep-ep (1234) into r0.4.0#1299
terrykong merged 1 commit into
r0.4.0from
cherry-pick-1234-r0.4.0

Conversation

@chtruong814

@chtruong814 chtruong814 commented Oct 7, 2025

Copy link
Copy Markdown
Contributor

beep boop [ðŸĪ–]: Hi @chtruong814 👋,

we've cherry picked #1234 into  for you! 🚀

Please review and approve this cherry pick by your convenience!

Summary by CodeRabbit

  • Chores
    • Updated Docker image build to include CUDA architectures for latest-generation NVIDIA GPUs (e.g., H100), improving compatibility and performance.
    • Enhanced build process with an additional dependency sync step to ensure required GPU communication libraries are present before compilation.
    • Expanded dependency groups resolved during image build for broader coverage and fewer setup issues, resulting in more reliable container builds.

Signed-off-by: Charlie Truong <chtruong@nvidia.com>
Signed-off-by: NeMo Bot <nemo-bot@nvidia.com>
@chtruong814
chtruong814 requested a review from a team as a code owner October 7, 2025 16:02
@terrykong terrykong added the CI:docs Run doctest label Oct 7, 2025
@terrykong
terrykong enabled auto-merge (squash) October 7, 2025 16:08
@coderabbitai

coderabbitai Bot commented Oct 7, 2025

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Updates the NGC PyTorch Dockerfile: sets TORCH_CUDA_ARCH_LIST to "9.0 10.0" in the hermetic build stage and modifies the build RUN steps to ensure nvshmem is installed before building DeepEP, followed by an additional uv sync with expanded extra groups and flags.

Changes

Cohort / File(s) Summary
Docker build updates
docker/Dockerfile.ngc_pytorch
Added ENV TORCH_CUDA_ARCH_LIST="9.0 10.0". Updated build RUN commands to sync/install nvshmem before DeepEP, then perform an additional uv sync with extended --extra groups (vllm, mcore, automodel, all-groups) and flags, maintaining no-install-project behavior and improving dependency resolution order.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant Dev as Developer
    participant Docker as Docker Build
    participant Herm as Hermetic Stage
    participant UV as uv
    participant NVSH as nvshmem
    participant DeepEP as DeepEP Build

    Dev->>Docker: build
    Docker->>Herm: start build stage
    Note over Herm: ENV TORCH_CUDA_ARCH_LIST="9.0 10.0"
    Herm->>UV: uv sync (ensure nvshmem)
    UV->>NVSH: install/verify nvshmem
    NVSH-->>UV: ready
    Herm->>DeepEP: build DeepEP
    DeepEP-->>Herm: built
    Herm->>UV: uv sync --extra vllm,mcore,automodel,all-groups ...<br/>--no-install-project
    UV-->>Herm: dependencies synced
    Herm-->>Docker: stage complete
Loading

Estimated code review effort

ðŸŽŊ 2 (Simple) | ⏱ïļ ~10 minutes

Possibly related PRs

Suggested labels

r0.4.0

Suggested reviewers

  • guyueh1
  • terrykong

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title Check ⚠ïļ Warning The title primarily documents the cherry-pick operation and branch target instead of succinctly summarizing the actual change, and it includes backticks, PR numbers, and branch names that add noise. It does not clearly convey the key update to the Dockerfile, namely adding CUDA architecture settings and sync steps for DeepEP compatibility. Please revise the title to focus on the functional change, for example “build: add TORCH_CUDA_ARCH_LIST and sync steps in ngc_pytorch Dockerfile for DeepEP support,” and remove cherry-pick metadata and branch references.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
Test Results For Major Changes ✅ Passed Based on the summary, this PR only updates a Dockerfile to set TORCH_CUDA_ARCH_LIST and adjusts build steps/dependency sync for DeepEP; there are no model, algorithm, or runtime logic changes. While the PR description lacks test results, the changes are build/infrastructure-only and unlikely to affect numerics or runtime performance. Therefore, this qualifies as a minor change under the check criteria, and explicit test results are not required for passing.
âœĻ Finishing touches
🧊 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch cherry-pick-1234-r0.4.0

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

âĪïļ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 0

ðŸ§đ Nitpick comments (1)
docker/Dockerfile.ngc_pytorch (1)

100-103: Avoid installing all extras; add an explicit NVSHMEM presence check before DeepEP build

Installing with --all-groups can pull dev/test extras, inflating image size and build time. Also, the comment implies nvshmem must pre-exist; make that explicit with a fast failure check.

  • Keep extras minimal (only what’s required to build/use DeepEP).
  • Verify where nvshmem actually comes from (system vs pip meta). If it’s a system lib, add a preflight check.

Apply:

-# Ensure nvshmem is installed before building DeepEP
-uv sync --link-mode symlink --locked --inexact --no-install-project $UV_NO_INSTALL_PACKAGES
-uv sync --link-mode symlink --locked --inexact --extra vllm --extra mcore --extra automodel --all-groups --no-install-project $UV_NO_INSTALL_PACKAGES
+# Ensure NVSHMEM runtime is present before building DeepEP (fail fast if missing)
+ldconfig -p | grep -q nvshmem || { echo "ERROR: NVSHMEM runtime not found on system path"; exit 1; }
+# Prime base deps without installing the project to keep layer size lower
+uv sync --link-mode symlink --locked --inexact --no-install-project $UV_NO_INSTALL_PACKAGES
+# Install only the extras needed (avoid --all-groups to prevent dev/test bloat)
+uv sync --link-mode symlink --locked --inexact \
+  --extra vllm --extra mcore --extra automodel \
+  --no-install-project $UV_NO_INSTALL_PACKAGES

If DeepEP requires an additional extra (e.g., --extra deep_ep), prefer adding that explicitly over --all-groups. Please confirm which extra actually triggers DeepEP’s build in pyproject.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

ðŸ“Ĩ Commits

Reviewing files that changed from the base of the PR and between 82ab565 and b7e687a.

📒 Files selected for processing (1)
  • docker/Dockerfile.ngc_pytorch (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Lint check
  • GitHub Check: Lint check
  • GitHub Check: Lint check
  • GitHub Check: Post submodule check comment / Comment on PR
  • GitHub Check: Post automodel integration comment / Comment on PR
🔇 Additional comments (1)
docker/Dockerfile.ngc_pytorch (1)

86-87: Use semicolon-separated TORCH_CUDA_ARCH_LIST with +PTX; verify sm_100 support

Replace:

- ENV TORCH_CUDA_ARCH_LIST="9.0 10.0"
+ ENV TORCH_CUDA_ARCH_LIST="9.0;10.0+PTX"

Confirm that nvcr.io/nvidia/pytorch:25.06-py3’s toolchain supports sm_100; gate or remove it if unsupported.

@terrykong
terrykong merged commit a334b30 into r0.4.0 Oct 7, 2025
66 of 69 checks passed
@terrykong
terrykong deleted the cherry-pick-1234-r0.4.0 branch October 7, 2025 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants