Skip to content

Fix release wheel CUDA index calculation#3100

Open
fallintoplace wants to merge 1 commit into
NVIDIA:mainfrom
fallintoplace:fix/wheel-docker-cuda-version
Open

Fix release wheel CUDA index calculation#3100
fallintoplace wants to merge 1 commit into
NVIDIA:mainfrom
fallintoplace:fix/wheel-docker-cuda-version

Conversation

@fallintoplace
Copy link
Copy Markdown

Summary

  • compute the PyTorch CUDA wheel index with a single Python expression
  • keep the existing Torch/CUDA version mapping unchanged
  • avoid the invalid Python line continuation in the release wheel Dockerfile

Validation

  • checked the shell expression for Torch 2.5-2.9 with CUDA 11.8 and 12.8
  • ran git diff --check -- .github/actions/build-pytorch-wheel/Dockerfile

@github-actions github-actions Bot added the community-contribution PRs from external contributor outside the core maintainers, representing community-driven work. label Jun 6, 2026
@fallintoplace fallintoplace marked this pull request as ready for review June 6, 2026 14:41
Signed-off-by: Minh Vu <vuhoangminh97@gmail.com>
@fallintoplace fallintoplace force-pushed the fix/wheel-docker-cuda-version branch from 1ab88b9 to 0cebce7 Compare June 6, 2026 14:42
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Jun 6, 2026

Greptile Summary

This PR fixes a Python SyntaxError in the PyTorch wheel install step caused by a backslash-space (\ ) line continuation (the trailing space after \ made it invalid Python syntax). The fix consolidates the multi-line python -c expression into a single semicolon-separated one-liner and also adds the missing trailing newline to the file.

  • The Torch/CUDA version mapping (minv/maxv pairs per Torch minor version) is preserved exactly: 2.5–2.7 use 118 as minv, 2.8–2.9 use 126, and maxv values range from 124 to 130.
  • The CUDA boundary check (< 120) correctly separates CUDA 11.x (118, 119) from CUDA 12.x (120+), consistent with the original logic.

Confidence Score: 5/5

Safe to merge — the change is a targeted fix to a broken Python expression inside a Dockerfile RUN step, with no functional logic changes.

The old multi-line python -c string had a \ (backslash followed by a space before the newline) on its first continuation line, which is invalid Python and would have caused a SyntaxError at build time. The new single-line form removes that syntax issue, the version lookup table values are bit-for-bit identical to the originals, and the CUDA boundary comparison is unchanged. The file also gains a proper trailing newline. No logic is altered.

No files require special attention.

Important Files Changed

Filename Overview
.github/actions/build-pytorch-wheel/Dockerfile Collapses the multi-line Python -c expression into a single line, fixing the invalid backslash-space line continuation that would cause a Python SyntaxError; preserves the Torch/CUDA version mapping verbatim and adds a missing trailing newline.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Docker RUN step] --> B[Extract MATRIX_CUDA_VERSION via awk]
    B --> C[Extract MATRIX_TORCH_VERSION via awk]
    C --> D[Python one-liner: lookup versions dict]
    D --> E{MATRIX_CUDA_VERSION less than 120?}
    E -- Yes: CUDA 11.x --> F[Use minv e.g. cu118 or cu126]
    E -- No: CUDA 12.x --> G[Use maxv e.g. cu124 to cu130]
    F --> H[pip install torch with cu index URL]
    G --> H
Loading

Reviews (1): Last reviewed commit: "Fix release wheel CUDA index calculation" | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution PRs from external contributor outside the core maintainers, representing community-driven work.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant