Skip to content

Upgrade to Torch 2.11 with Cuda 13.1 - #347

Merged
shijieliu merged 5 commits into
NVIDIA:mainfrom
geoffreyQiu:upgrade_torch211_cuda131
Apr 8, 2026
Merged

shijieliu merged 5 commits into
NVIDIA:mainfrom
geoffreyQiu:upgrade_torch211_cuda131

Conversation

@geoffreyQiu

Copy link
Copy Markdown
Collaborator

This pull request focuses on upgrading the CUDA, PyTorch, TorchRec, and FBGEMM dependencies, as well as updating related build and source files to ensure compatibility with the new versions. It also includes several code changes to migrate from CUB to Thrust APIs and to improve compatibility with the updated libraries.

Dependency and Docker environment upgrades:

  • Updated the base Docker image to CUDA 13.1 and PyTorch 2.11 (nvcr.io/nvidia/pytorch:26.02-py3), switched to the CUDA 13 toolkit in all relevant paths, and updated the PyTorch, TorchRec, and FBGEMM versions to their latest releases. Also updated the CUDA architectures list for builds.

Source code and compatibility changes:

  • Migrated from CUB to Thrust APIs in CUDA source files, replacing cub::TransformInputIterator and cub::CountingInputIterator with thrust::make_transform_iterator and thrust::counting_iterator for better compatibility with CUDA 13.

TorchRec and FBGEMM integration:

  • Updated submodules and Docker build steps to use TorchRec v1.5.0-rc2 and FBGEMM v1.5.0, and adjusted build arguments for CUDA architectures accordingly.

  • Updated rw_sharding.py to handle changes in the latest TorchRec API, including version checks for the env parameter and conditional logic for different TorchRec versions. Meanwhile, they also keep compatible with TorchRec v1.2.0.

These changes collectively modernize the build environment and codebase, ensuring compatibility with the latest CUDA and PyTorch ecosystem libraries.

@geoffreyQiu

geoffreyQiu commented Apr 8, 2026 •

Copy link
Copy Markdown
Collaborator Author

CI passed.

@greptile-apps

greptile-apps Bot commented Apr 8, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR upgrades the build environment to CUDA 13 / PyTorch 2.11, pins FBGEMM and TorchRec to their v1.5.0 releases, migrates CUB iterators to Thrust equivalents for CUDA 13 compatibility, and fixes the previously flagged TorchRec version check using packaging.version.Version.

  • The build stage of the Dockerfile still downloads nvcomp-linux-x86_64-5.1.0.21_cuda12-archive.tar.xz, a CUDA 12 binary, while the base image has been upgraded to CUDA 13; this archive should be updated to a CUDA 13 build to avoid potential ABI mismatches at link/runtime.

Confidence Score: 4/5

PR is functionally correct except for the nvcomp CUDA 12 archive in a CUDA 13 environment, which should be resolved before shipping.

All Python and CUDA source changes are correct and address prior review feedback. The one P1 finding is the unchanged nvcomp download referencing a CUDA 12 binary inside the newly CUDA 13-based build stage — a likely oversight from the upgrade that could cause link/runtime failures.

docker/Dockerfile — specifically the nvcomp archive download in the build stage (line ~92).

Vulnerabilities

No security concerns identified. The changes are scoped to build-environment upgrades and CUDA API migrations; no credential exposure, injection surface, or auth boundary is affected.

Important Files Changed

Filename Overview
docker/Dockerfile Upgrades base image to CUDA 13 / PyTorch 2.11, pins FBGEMM v1.5.0 and TorchRec release/V1.5.0, adds CUDA 13 symlink step and --no-build-isolation for hstu; nvcomp archive still references cuda12 (P1).
corelib/dynamicemb/dynamicemb/planner/rw_sharding.py Replaces fragile startswith() version check with packaging.version.Version comparison (< 1.5.0), adds env parameter to both _create_embedding_kernel overrides; addressing prior review feedback correctly.
corelib/dynamicemb/src/index_calculation.cu Migrates from cub::TransformInputIterator to thrust::make_transform_iterator and adds host annotation to CastI32ToI64 functor for CUDA 13 / Thrust compatibility.
corelib/dynamicemb/src/index_calculation.h Replaces cub::CountingInputIterator with thrust::counting_iterator; correct and minimal change.
corelib/dynamicemb/setup.py Removes compute_70/sm_70 (Volta/V100) from NVCC gencode flags, consistent with the FBGEMM and commons arch-list changes also dropping 7.0.
third_party/FBGEMM Submodule pointer bumped from df29adb to 65bad42, tracking the FBGEMM v1.5.0 release.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["Docker Build: nvcr.io/nvidia/pytorch:26.02-py3\n(CUDA 13 / PyTorch 2.11)"] --> B[Install base deps\ntorchx, gin-config, cloudpickle, triton 3.6.0\nnvidia-cutlass-dsl 4.3.0]
    B --> C[Build & install FBGEMM v1.5.0\narch: 7.5 8.0 9.0]
    C --> D[Install TorchRec release/V1.5.0]
    D --> E[Create CUDA 13 include symlink\ncuda-13/cccl/cuda → /usr/local/cuda/include/cuda]
    E --> F[Build & install fbgemm_gpu_hstu\n--no-build-isolation]
    F --> G{build stage}
    G --> H[Install dynamicemb\nsetup.py: arch 7.5 8.0 9.0]
    G --> I[Download nvcomp\n⚠️ cuda12 archive]
    G --> J[Build examples/commons\narch: 7.5 8.0 8.6 9.0]

    style I fill:#ffcccc,stroke:#cc0000
Loading

Reviews (4): Last reviewed commit: "Fix docker file" | Re-trigger Greptile

Comment thread docker/Dockerfile Resolved

This comment was marked as duplicate.

@greptile-apps

greptile-apps Bot commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Tip:

Greploops — Automatically fix all review issues by running /greploops in Claude Code. It iterates: fix, push, re-review, repeat until 5/5 confidence.

Use the Greptile plugin for Claude Code to query reviews, search comments, and manage custom context directly from your terminal.

@shijieliu
shijieliu force-pushed the upgrade_torch211_cuda131 branch from 469122b to b6db87c Compare April 8, 2026 07:21
@shijieliu
shijieliu merged commit 2892109 into NVIDIA:main Apr 8, 2026
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.

3 participants