Repository navigation
Studio: fix flash-attn and torchao install on Blackwell (sm_100+) GPUs (Closes #6961) - #6970
Conversation
Fixes #6961. This function skipped flash-attn on Blackwell GPUs because no prebuilt wheel existed; Dao-AILab now ships one and url_exists() already gates resolution. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Fixes #6961. Torchao 0.16.0's cpp extensions are built against CUDA 12, so on a CUDA-13 torch (cu130 / Blackwell) they fail to load with "libcudart.so.12: cannot open shared object file". Select 0.17.0 there instead: its cpp targets torch 2.11, so it is skipped cleanly rather than crashing. CUDA-12 / ROCm / CPU torch 2.10 keeps 0.16.0 and its working kernels. Co-Authored-By: Claude Opus 4.8 <[email protected]>
There was a problem hiding this comment.
Code Review
This pull request removes the has_blackwell_gpu check and instead dynamically selects the appropriate torchao version based on the CUDA major version extracted from the PyTorch installation tag. This prevents loading incompatible CUDA-12 C++ extensions on CUDA-13 (Blackwell) environments, avoiding runtime crashes. Feedback on the changes highlights a potential parsing bug in _cuda_major_from_torch_version when handling two-digit CUDA tags (e.g., +cu13), which would incorrectly resolve the major version to 1 instead of 13.
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.
|
Thanks for this. I went through both changes on a B200 and they hold up. torchao 0.16 to 0.17 on CUDA 13: confirmed. On a clean flash-attn: confirmed. Dropping the On the review note at I pushed one small commit on top that condenses the torchao selection comments. It is comment-only, the AST is unchanged, and the tests pass: This supersedes #6971, which I had opened for the same issue before seeing yours. I will close that one and take this. |
… wheels Map torch 2.11 to the torch2.10 prebuilt wheels for flash-attn, causal-conv1d, and mamba through wheel_utils.prebuilt_wheel_torch_mm, applied in direct_wheel_url (filename) and flash_attn_wheel_url (version). Those torch2.10 CUDA wheels load and pass each project's own test suite on torch 2.11 (verified on B200), so a torch 2.11 environment gets the prebuilt accelerators instead of skipping or building from source. Raise _CUDA_TORCH_PKG_SPEC to <2.12.0 (torchvision <0.27.0, torchaudio <2.12.0) so the CUDA torch repair path can install torch 2.11, where torchao 0.17's cpp kernels load cleanly. Add tests for the mapping.
|
Pushed a commit to make torch 2.11 work end to end for anyone who lands on it. The torch2.10 prebuilt wheels for flash-attn, causal-conv1d and mamba all import and pass their own test suites on torch 2.11 (checked on a B200: FA2 forward/backward, causal-conv1d, and mamba selective scan all match reference), so there is no reason to skip them or build from source on 2.11. What changed:
Note on scope: this does not change what a fresh CUDA install lands on. The base torch is still pinned by |
Nice work! |
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
…h gating Keep the nvidia-smi compute_cap detection and its two call sites, but short-circuit with return False at the top so flash-attn is no longer skipped on Blackwell (sm_100+ now has prebuilt wheels and url_exists gates resolution). Drop the early return to re-enable arch-based detection later.
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6d4cc8b292
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| "torch>=2.4,<2.11.0", | ||
| "torchvision>=0.19,<0.26.0", | ||
| "torchaudio>=2.4,<2.11.0", | ||
| "torch>=2.4,<2.12.0", |
There was a problem hiding this comment.
Avoid upgrading Volta repairs to torch 2.11
When a Linux Volta/V100 host with a CUDA 12.8+ driver reaches _ensure_cuda_torch(), _detect_cuda_torch_index_url() selects the cu128 index from the driver version alone; widening this spec lets pip resolve torch==2.11.0 from that index. PyTorch 2.11's cu128/cu129 wheels no longer include SM 7.0 support, so this repair path can replace the previous working torch<2.11 CUDA wheel with one that cannot run on V100. Please keep Volta repairs below 2.11 or choose a compatible index/spec based on compute capability.
Useful? React with 👍 / 👎.
| "direct_wheel_url", | ||
| "flash_attn_wheel_url", | ||
| "has_blackwell_gpu", | ||
| "install_wheel", | ||
| "probe_torch_wheel_env", | ||
| "url_exists", |
There was a problem hiding this comment.
Keep has_blackwell_gpu in the test stub
core/training/worker.py still imports has_blackwell_gpu from utils.wheel_utils at module import time, but this lightweight MLX test loader now stubs utils.wheel_utils without that attribute. When the loader reaches the wheel_utils import, spec.loader.exec_module(module) raises ImportError before any MLX config assertions can run; add the stubbed name back or remove the production import first.
Useful? React with 👍 / 👎.
On Blackwell GPUs, the Studio Setup left two things broken. Both are fixed here, and both are scoped so non-Blackwell setups are unchanged.
has_blackwell_gpu()skip because now there are actually prebuilt wheels for Blackwell. See: https://github.com/Dao-AILab/flash-attention/releases/tag/v2.8.1/+cu130) they fail to load withlibcudart.so.12: cannot open shared object file. This was fixed by the latest release of Torchao at: https://github.com/pytorch/ao/releases/tag/v0.17.0. This deliberately trades torchao's compiled kernels for a clean import on Blackwell — they can't load on torch 2.10 regardless — while CUDA-12/ROCm/CPU users keep their working kernels.