Skip to content

Studio: install torch 2.11 on all modern CUDA (cu126/cu128/cu130) - #6997

Closed
danielhanchen wants to merge 1 commit into
mainfrom
torch211-cuda-broaden
Closed

danielhanchen wants to merge 1 commit into
mainfrom
torch211-cuda-broaden

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

Install torch 2.11 on all modern CUDA indexes, not just Blackwell/cu130. This extends the existing rocm7.2 TORCH_CONSTRAINT override in install.sh to the CUDA 12.6+/13 indexes (cu126, cu128, cu130), all of which publish torch 2.11.0 wheels. It generalizes #6982 (which did cu130 only) into one coherent change for the whole modern-CUDA stack.

case "$TORCH_INDEX_URL" in
    */rocm7.2) TORCH_CONSTRAINT="torch>=2.11.0,<2.12.0" ;;
    */cu130)   TORCH_CONSTRAINT="torch>=2.11.0,<2.12.0" ;;
    */cu128)   TORCH_CONSTRAINT="torch>=2.11.0,<2.12.0" ;;
    */cu126)   TORCH_CONSTRAINT="torch>=2.11.0,<2.12.0" ;;
esac

The default torch>=2.4,<2.11.0 is intentionally left untouched, so older CUDA (cu124/cu118), other ROCm tags, CPU, and macOS stay on the 2.10 family. torch 2.11 publishes no wheels for those indexes, so bumping the default would make old-driver fresh installs resolve a nonexistent wheel and fail. Keeping the default also means the "hardcoded torch>=2.4 appears exactly once" test guard stays valid.

torch 2.11 is already supported end to end from #6970: torchao 0.17's cpp kernels load on 2.11, and flash-attn / causal-conv1d / mamba reuse their torch2.10 wheels via wheel_utils.prebuilt_wheel_torch_mm. GPU-arch support is unchanged: cu126 2.11 keeps Maxwell/Pascal/Volta/Turing+, and cu128/cu130 are Turing (SM 7.5)+ exactly as their 2.10 counterparts were.

Verification

Structural tests: tests/sh/test_torch_constraint.sh asserts each cu126/cu128/cu130 override is present (26 -> now covers all three) and passes 28/28; tests/python/test_tokenizers_and_torch_constraint.py and studio/backend/tests/test_torchao_select.py pass.

Stack smoke on a B200 (sm_100, compute cap 10.0) with a fresh torch 2.11.0+cu130 venv, the exact wheels the installer selects:

  • torch 2.11.0+cu130 initializes, device reports B200 / (10, 0)
  • flash-attn 2.8.1 (the torch2.10 cu13 wheel): FA2 forward matches SDPA, max|err| = 8.1e-03 (bf16)
  • torchao 0.17.0: int8-weight-only quantized Linear runs (cpp path loads, output finite)
  • bitsandbytes 0.49.2: Linear4bit runs, output finite
  • triton 3.6.0 and xformers 0.0.35 import

This complements the RTX 5090 (sm_120) run in #6982, so both Blackwell tiers are covered on torch 2.11.

Scope / follow-ups

  • Supersedes Studio: install torch 2.11 on all modern CUDA (cu126/cu128/cu130) #6982 (cu130 only). Happy to close that in favor of this, keeping its 5090 verification noted here.
  • cu126/cu128 target Ampere/Hopper/older; a spot-check LoRA run on one of those archs would round it out, though the accelerator reuse is a torch-version ABI property (proven on 2.11) independent of CUDA major.
  • CPU, macOS arm64, and Windows CUDA (install.ps1) are separate follow-ups; each has torch 2.11 wheels but wants its own smoke pass. Old CUDA (cu124/cu118), non-7.2 ROCm, and macOS x86 stay on 2.10 (no 2.11 wheels).

Related: #6961, #6970, #6982.

Extend the rocm7.2 TORCH_CONSTRAINT override in install.sh to the CUDA 12.6+/13
indexes, which all publish torch 2.11.0 wheels. torchao 0.17's cpp kernels load on
2.11 and flash-attn/causal-conv1d/mamba reuse their torch2.10 wheels there
(prebuilt_wheel_torch_mm). Older CUDA (cu124/cu118), other ROCm tags, CPU and macOS
keep the <2.11.0 default since torch 2.11 ships no wheels for them. Adds structural
tests asserting each cu126/cu128/cu130 override. Generalizes #6982 (cu130 only).

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request updates install.sh to allow PyTorch 2.11.0 for CUDA 12.6+ and 13 indexes (cu126, cu128, cu130) by adjusting the TORCH_CONSTRAINT variable. It also adds corresponding unit tests in tests/sh/test_torch_constraint.sh to verify these overrides. There are no review comments, and I have no additional feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 54b934a6b0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread install.sh
Comment on lines +2478 to +2480
*/cu130) TORCH_CONSTRAINT="torch>=2.11.0,<2.12.0" ;;
*/cu128) TORCH_CONSTRAINT="torch>=2.11.0,<2.12.0" ;;
*/cu126) TORCH_CONSTRAINT="torch>=2.11.0,<2.12.0" ;;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Gate torch 2.11 on supported Python versions

When a user installs with --python 3.9 (still accepted by this installer and by the package's >=3.9 metadata), any cu126/cu128/cu130 host now forces torch>=2.11.0,<2.12.0 into the Step 1 uv pip install. PyTorch 2.11 wheels start at cp310, so that combination has no torch candidate and fails, whereas the previous <2.11.0 ceiling could resolve an older cp39 CUDA wheel. Please keep the old ceiling for Python 3.9 or reject that Python before applying the modern-CUDA override.

Useful? React with 👍 / 👎.

@danielhanchen

Copy link
Copy Markdown
Member Author

Folded into #6982, which now covers all modern CUDA (cu126/cu128/cu130). Closing in favor of that.

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.

1 participant