Skip to content

Dockerfile - Add cuda13.3.dockerfile on pytorch:26.07-py3 - #846

Draft
gusui-msft wants to merge 3 commits into
mainfrom
dev/gusui/cuda13.3-image
Draft

Dockerfile - Add cuda13.3.dockerfile on pytorch:26.07-py3#846
gusui-msft wants to merge 3 commits into
mainfrom
dev/gusui/cuda13.3-image

Conversation

@gusui-msft

@gusui-msft gusui-msft commented Aug 18, 2026

Copy link
Copy Markdown

Description

Adds a cuda13.3 image built on nvcr.io/nvidia/pytorch:26.07-py3, replacing cuda13.0 (25.08-py3) in the CI matrix.

Motivation is security. A Trivy 0.72.0 scan of main-cuda13.0 (2026-07-15) reports 58 Critical occurrences. 18 of them are inherited from the NVIDIA base image and cannot be fixed in our own layers. 26.07-py3 clears all 18:

Package Occurrences In 25.08-py3 Required fix 26.07-py3 ships
linux-libc-dev 16 6.8.0-71.71 6.8.0-134.134 6.8.0-136.136
jupyter_server 1 2.16.0 2.20.0 2.20.0
Nsight efa_metrics/nic_sampler 1 Go v1.23.4 1.26.0-rc.3 go1.26.1

Each of those three versions was read directly out of the 26.07-py3 registry layers, not taken from release notes. The upgrade additionally brings wheel 0.45.1 -> 0.46.3 (CVE-2026-24049, HIGH) and pip 25.2 -> 26.1.2 (4 Medium, 1 Low).

Follows the one-Dockerfile-per-CUDA-version convention, so this is a new file rather than an edit to cuda13.0.dockerfile.

Major Revision

  • Add dockerfile/cuda13.3.dockerfile based on nvcr.io/nvidia/pytorch:26.07-py3.
  • Point the docker-build and docker-merge matrices at cuda13.3 instead of cuda13.0.
  • Add a CUDA_VER >= 13.3 branch to third_party/Makefile selecting CUTLASS v4.7.0, whose release notes state "Optimal code generation with CUDA toolkit versions 13.3". The existing >= 12.9 branch would otherwise still pick v4.1.0, which predates CUDA 13.3.

Minor Revision

  • HPCX_VERSION v2.24.1 -> v2.50. Not cosmetic: the install block does rm -rf /opt/hpcx and /etc/bash.bashrc sources hpcx-init.sh, so keeping v2.24.1 would replace the base image's HPC-X 2.50 with an older stack.
  • UCX_VERSION 1.18.0 -> 1.21.0, matching the base image. Also not cosmetic: LD_LIBRARY_PATH puts /usr/local/lib ahead of the base libraries, so the source-built UCX shadows the base's. The URL is also corrected from the -rc1 tag to the final release tag. The configure-release-mt multi-threaded build is kept.
  • setuptools==78.1.0 -> setuptools==81.0.0. The old pin is a downgrade now (base ships 81.0.0) and 78.1.0 is itself CVE-2025-47273 (HIGH), which the current scans report. Pinning to the version the base already carries keeps the line reproducible and makes it a no-op.
  • DOCKER_VERSION set to 29.7.2 so a brand-new image does not ship the 40 Critical occurrences that Dockerfile - Upgrade bundled Docker to 29.7.2 in cuda13.0 #845 removes from cuda13.0.
  • Version comment header updated to the actual 26.07-py3 component versions.
  • Rewrote the stale comment above cuda_cutlass in third_party/Makefile; it claimed 12.9+ builds v3.9 while the recipe already cloned v4.1.0, and adding a third branch made it more misleading.

What changed in the base image

Unchanged, so no migration work needed: Python 3.12, Ubuntu 24.04, CUDA_HOME, _CUDA_COMPAT_PATH.

Component 25.08-py3 26.07-py3
CUDA 13.0.0.044 13.3.1.008
PyTorch 2.8.0a0 2.13.0a0+9186a08
cuDNN 9.12.0.46 9.24.0.43
cuBLAS 13.0.0.19 13.6.0.2
NCCL 2.27.7 2.30.7
TransformerEngine 2.5 2.17
OpenMPI 4.1.7 5.0.10
HPC-X 2.24 2.50
UCX 1.19.0 1.21.0
RDMA-core 56.0 63.0
Nsight Systems 2025.4.1.136 2026.3.1.117

Artifact availability, checked 2026-08-18

  • hpcx-v2.50-gcc-doca_ofed-ubuntu24.04-cuda13-{x86_64,aarch64}.tbz: both 200
  • ucx-1.21.0.tar.gz at tag v1.21.0: 200
  • MLNX_OFED_LINUX-24.10-1.1.4.0-ubuntu24.04-{x86_64,aarch64}.tgz: both 200
  • NVIDIA/cuda-samples tag v13.3 exists, so the unconditional clone in cuda_bandwidthTest will not break
  • NVIDIA/cutlass tag v4.7.0 exists

Draft, because this is unvalidated

This replaces CUDA, cuDNN, NCCL, PyTorch, HPC-X, and UCX at once, so it cannot be accepted on a scan result alone.

  • Builds on arm64
  • Builds on amd64
  • Representative benchmark run on both architectures
  • PerfGate thresholds re-baselined for affected scenarios
  • Rescan the pushed digests per architecture, confirm 0 Critical

Risks, in the order I expect them to bite:

  1. PyTorch 2.8.0a0 -> 2.13.0a0, five minor releases. Affects megatron_lm, megatron_deepspeed, Apex, and TransformerEngine. setup.py only declares torch>=1.7.0a0 and there is no torch.__version__ guard anywhere in superbench/, so pip will not surface a break; it has to be found by building and running.
  2. OpenMPI 4.1 -> 5.0. python3-mpi4py comes from apt and links the distro MPI, while nccl-tests and perftest build against MPI_HOME=/usr/local/mpi.
  3. CUTLASS v4.7.0 has not been built here against CUDA 13.3 yet.
  4. Performance re-baselining, since the whole optimized stack moves together.
  5. MLNX_OFED 24.10-1.1.4.0 user-space now sits on top of rdma-core 63.0 rather than 56.0. Pre-existing pattern, wider gap.

Questions for reviewers

  • Should dockerfile/cuda13.0.dockerfile be deleted in this PR? CI/CD - Clean up image builds, remove cuda 12.8/12.4/12.2 and add cuda13.0 merge #819 kept superseded Dockerfiles and only changed the matrix, so this PR follows that precedent and leaves the file in place.
  • Should the HPC-X install block be dropped entirely rather than bumped, given the base already ships 2.50? That is a behavioural change, so it is not in this PR.
  • git clone ... && cd cutlass in third_party/Makefile is a no-op, since Make runs each recipe line in its own shell. Raised by review, but it is pre-existing on main in all three branches, so cleaning it up belongs in its own change rather than here.

Relationship to #845

Independent. #845 bumps Docker to 29.7.2 in cuda13.0.dockerfile; this PR creates a separate file that already carries 29.7.2, so there is no textual conflict. #845 should merge first because it closes 40 Critical occurrences on the image CI builds today, and it does not depend on any of the validation above.

Copilot AI lite review requested due to automatic review settings August 18, 2026 18:58

Copilot AI 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.

Pull request overview

This PR adds a new CUDA 13.3 container image definition based on nvcr.io/nvidia/pytorch:26.07-py3, updates the GitHub Actions image build/merge matrices to build/publish cuda13.3 instead of cuda13.0, and adjusts third-party build logic to select a newer CUTLASS for CUDA 13.3+.

Changes:

  • Add dockerfile/cuda13.3.dockerfile (new base image + updated HPC-X/UCX/Docker client handling).
  • Update .github/workflows/build-image.yml matrix entries to build/merge/publish cuda13.3 tags.
  • Update third_party/Makefile CUTLASS selection to use v4.7.0 when CUDA_VER >= 13.3.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
third_party/Makefile Adds a CUDA 13.3+ conditional branch to select CUTLASS v4.7.0.
dockerfile/cuda13.3.dockerfile Introduces the CUDA 13.3 image based on nvcr.io/nvidia/pytorch:26.07-py3 with updated dependency versions.
.github/workflows/build-image.yml Switches CI build/merge matrices from cuda13.0 to cuda13.3 tags/dockerfile.
Suppressed comments (1)

third_party/Makefile:47

  • git clone ... && cd cutlass is misleading/no-op here: each recipe line runs in its own shell, and the later build uses -S ./cutlass anyway, so the cd cutlass has no effect on subsequent steps. Consider removing the trailing && cd cutlass to avoid implying later commands run from inside the repo.
	$(eval ARCHS := "100;103")
	if [ -d cutlass ]; then rm -rf cutlass; fi
	git clone --branch v4.7.0 --depth 1 https://github.com/NVIDIA/cutlass.git && cd cutlass

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread third_party/Makefile Outdated
Comment thread dockerfile/cuda13.3.dockerfile Outdated
Copilot AI review requested due to automatic review settings August 18, 2026 19:13

Copilot AI 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.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Suppressed comments (2)

third_party/Makefile:48

  • git clone ... && cd cutlass is misleading here: Make runs each recipe line in its own shell, so the cd cutlass does not affect subsequent commands (which already reference ./cutlass). Consider dropping the && cd cutlass suffix to avoid implying that later steps run inside the repo directory.
ifeq ($(shell echo $(CUDA_VER)">=13.3" | bc -l), 1)
	$(eval ARCHS := "100;103")
	if [ -d cutlass ]; then rm -rf cutlass; fi
	git clone --branch v4.7.0 --depth 1 https://github.com/NVIDIA/cutlass.git && cd cutlass
else ifeq ($(shell echo $(CUDA_VER)">=12.9" | bc -l), 1)

dockerfile/cuda13.3.dockerfile:162

  • This Dockerfile changes the established pattern of pinning setuptools to an exact version (e.g., cuda13.0.dockerfile and cuda12.9.dockerfile use setuptools==...). Using a lower-bound specifier (setuptools>=...) makes image builds non-reproducible because the resolved version can change over time. Consider pinning to a specific known-good version (e.g., the base image’s current setuptools) and bump it deliberately when needed.
RUN python3 -m pip install --upgrade "setuptools>=78.1.1" && \
    python3 -m pip install --no-cache-dir .[nvworker] && \

@codecov

codecov Bot commented Aug 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.02%. Comparing base (67298ae) to head (5053ff4).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #846   +/-   ##
=======================================
  Coverage   86.02%   86.02%           
=======================================
  Files         103      103           
  Lines        7950     7950           
=======================================
  Hits         6839     6839           
  Misses       1111     1111           
Flag Coverage Δ
cpu-python3.12-unit-test 70.88% <ø> (ø)
cpu-python3.7-unit-test 70.31% <ø> (ø)
cuda-unit-test 83.95% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI review requested due to automatic review settings August 18, 2026 19:59
@gusui-msft

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree [company="{microsoft}"]

@microsoft-github-policy-service

Copy link
Copy Markdown

gusui-msft the command you issued was incorrect. Please try again.

Examples are:

@microsoft-github-policy-service agree

and

@microsoft-github-policy-service agree company="your company"

Copilot AI 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.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Suppressed comments (1)

third_party/Makefile:48

  • The new CUDA_VER>=13.3 branch duplicates the same ARCHS/rm/clone recipe used for the >=12.9 branch, which increases maintenance cost and makes future tag/arch updates easy to miss. Consider setting CUTLASS_TAG (and ARCHS) inside the conditional branches, then running the shared rm/clone logic once after the conditional (or factoring a small helper target).
# The CUTLASS tag is picked per CUDA_VER because each release only supports the SM archs of its own CUDA generation.
cuda_cutlass:
ifeq ($(shell echo $(CUDA_VER)">=13.3" | bc -l), 1)
	$(eval ARCHS := "100;103")
	if [ -d cutlass ]; then rm -rf cutlass; fi
	git clone --branch v4.7.0 --depth 1 https://github.com/NVIDIA/cutlass.git && cd cutlass
else ifeq ($(shell echo $(CUDA_VER)">=12.9" | bc -l), 1)

Comment on lines +69 to +74
# Install Docker
ENV DOCKER_VERSION=29.7.2
RUN TARGETARCH_HW=$(uname -m) && \
wget -q https://download.docker.com/linux/static/stable/${TARGETARCH_HW}/docker-${DOCKER_VERSION}.tgz -O docker.tgz && \
tar --extract --file docker.tgz --strip-components 1 --directory /usr/local/bin/ && \
rm docker.tgz
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