Skip to content

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

Draft
gusui-msft wants to merge 4 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 4 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, from exactly two sources. This PR closes both, so the new image starts at 0 Critical:

Source Occurrences Fixed by
NVIDIA base image (25.08-py3) 18 FROM nvcr.io/nvidia/pytorch:26.07-py3
Docker static bundle we install 40 DOCKER_VERSION=29.7.2
Total 58

Both changes land together on purpose. Following the one-Dockerfile-per-CUDA-version convention, this is a new file rather than an edit to cuda13.0.dockerfile, and a new file should not be born carrying a known-vulnerable Docker bundle. Keeping the two bumps in one PR means one CUDA version maps to exactly one image that gets built, benchmarked, and scanned once. This supersedes #845, which is now closed.

Major Revision

  • Add dockerfile/cuda13.3.dockerfile based on nvcr.io/nvidia/pytorch:26.07-py3.
  • Pin DOCKER_VERSION=29.7.2 in the new file, rather than inheriting 20.10.8 from cuda13.0.dockerfile.
  • 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.
  • Version comment header updated to the actual 26.07-py3 component versions. The Docker line reads full static bundle installed in this dockerfile, because the RUN unpacks all eight binaries, not only the client.
  • 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.

1. Base image findings cleared, 18 occurrences

These are inherited and cannot be fixed in our own layers.

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).

2. Docker bundle findings cleared, 40 occurrences

cuda13.0.dockerfile pins the Docker static distribution at 20.10.8, built with Go 1.16.6. Trivy reports 40 Critical occurrences against the eight binaries the RUN unpacks into /usr/local/bin/. These are compiled-in Go dependencies, not installed packages, so apt and pip cannot touch them; the bundle itself has to be replaced.

Docker 29.7.2 (released 2026-08-05) is built with Go 1.26.5 and carries gRPC v1.82.1:

CVE Component Occurrences Required fix 29.7.2 ships
CVE-2025-68121 Go stdlib 8 1.24.13, 1.25.7, 1.26.0-rc.3 go1.26.5
CVE-2022-23806 Go stdlib 8 1.16.14, 1.17.7 go1.26.5
CVE-2023-24538 Go stdlib 8 1.19.8, 1.20.3 go1.26.5
CVE-2023-24540 Go stdlib 8 1.19.9, 1.20.4 go1.26.5
CVE-2024-24790 Go stdlib 8 1.21.11, 1.22.4 go1.26.5

Verified before opening, carried over from #845:

  • x86_64/docker-29.7.2.tgz and aarch64/docker-29.7.2.tgz both return 200. ${TARGETARCH_HW} already resolves correctly for both.
  • Every binary in the bundle reports go1.26.5, on both architectures.
  • dockerd embeds google.golang.org/grpc v1.82.1.
  • The extracted client is statically linked and reports Docker version 29.7.2, build a7dcaa6.

Host compatibility. SuperBench only uses the Docker client against the host daemon socket (monitor.py, docker_base.py, runner.py, system_info.py, and deploy.yaml, which mounts /var/run/docker.sock). There is no reference to dockerd, containerd, runc, ctr, or docker-proxy anywhere in the tree. Docker 29.3.0 lowered the minimum daemon API version from v1.44 back to v1.40 (Docker 19.03), so the newer client still talks to older host daemons. docker login --username/--password and every subcommand we invoke are still present in 29.7.2. One note for reviewers: the v1 containerd-shim binary no longer ships in the 29.x bundle, and nothing here references it.

3. 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, UCX, and Docker at once, so it cannot be accepted on a scan result alone.

  • Builds on arm64
  • Builds on amd64
  • docker --version inside the built image reports 29.7.2
  • 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.

Docker is deliberately low on that list: the client-side surface is small and the compatibility floor was checked above. It is bundled here because splitting it out produces a cuda13.0 image variant that CI would no longer build once this PR lands.

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. Note that if it is kept, it keeps Docker 20.10.8, since Dockerfile - Upgrade bundled Docker to 29.7.2 in cuda13.0 #845 is closed; that is intentional, as CI will no longer build it.
  • 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.

Not in this PR

  • cuda12.9 and cuda11.1.1 are also built by CI and still carry Docker 20.10.8. Same bundle, same 40 occurrences each. They need either the same one-line bump or their own base upgrade, tracked separately.
  • Installing only the docker client instead of the full bundle. That would drop 7 unused binaries and ~181 MB, but it changes image contents rather than a version string, so it is left as a follow-up.
  • Checksum verification of the downloaded Docker tarball. Worth doing, but it is the same gap in every dockerfile/*.dockerfile here, so it belongs in one change across all of them rather than only this one.
  • The ROCm side, where the equivalent Docker bump rides along with the new rocm6.4.x.dockerfile in Dockerfile - Add ROCm6.4 dockerfile #837.

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 (66564a5) to head (24cb5ff).

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.10-unit-test 70.88% <ø> (ø)
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

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
Copilot AI review requested due to automatic review settings August 19, 2026 21:35
@gusui-msft

Copy link
Copy Markdown
Author

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

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 (2)

third_party/Makefile:47

  • The && cd cutlass at the end of this recipe line is misleading/no-op: each Make recipe line runs in its own shell (no .ONESHELL here), and the later build already uses -S ./cutlass. Dropping the cd avoids implying subsequent lines run inside the repo directory.
	git clone --branch v4.7.0 --depth 1 https://github.com/NVIDIA/cutlass.git && cd cutlass

dockerfile/cuda13.3.dockerfile:138

  • This UCX build leaves the downloaded tarball and extracted source tree under /tmp, which increases final image size and can make layer caching less effective. Consider removing the UCX tarball/source directory in the same RUN layer after make install.
    tar xzf ucx-${UCX_VERSION}.tar.gz && \
    cd ucx-${UCX_VERSION} && \
    ./contrib/configure-release-mt --prefix=/usr/local && \
    make -j ${NUM_MAKE_JOBS} && \
    make install

Comment on lines +80 to +82
sed -i "s/[# ]*PermitRootLogin prohibit-password/PermitRootLogin yes/" /etc/ssh/sshd_config && \
sed -i "s/[# ]*PermitUserEnvironment no/PermitUserEnvironment yes/" /etc/ssh/sshd_config && \
sed -i "s/[# ]*Port.*/Port 22/" /etc/ssh/sshd_config && \
…ndle

Carries over the review outcome from #845: the RUN unpacks all eight binaries
from the tarball into /usr/local/bin/, not only the client, so the header must
not say "Docker Client".
Copilot AI review requested due to automatic review settings August 24, 2026 19:54
@gusui-msft
gusui-msft force-pushed the dev/gusui/cuda13.3-image branch from 9f89402 to 24cb5ff Compare August 24, 2026 19:54

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 (1)

.github/workflows/build-image.yml:34

  • These entries remove the last CUDA 13.0 build and make the unvalidated CUDA 13.3 image the only CUDA 13 artifact, while the PR's own checklist still leaves both architecture builds, representative runs, and rescans unchecked. If the simultaneous CUDA/PyTorch/OpenMPI/UCX changes fail, this replaces the known-good CI artifact rather than introducing a canary. Please keep cuda13.0 in the matrix or gate this replacement on successful validation of both architectures and representative scans/runs.
        - name: cuda13.3-arm64
          dockerfile: cuda13.3
          tags: superbench/main:cuda13.3-arm64

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