Support PyTorch 2.11.0 and PyTorch 2.13.0 with CUDA 13 - #1524
Merged
Merged
Conversation
Adds PyTorch 2.13.0 (`cpu`, `cu130`) to the support matrix, which enables co-installation with `vllm==0.28.0` (pins `torch==2.13.0` plus CUDA 13 runtime packages) and `transformers~=5.16`. Also completes the earlier PyTorch 2.11.0 (`cpu`, `cu126`, `cu128`) work. Three things had to change to build against PyTorch 2.13: - PyTorch 2.12 and later set `CMAKE_CXX_STANDARD 20`, so fairseq2n is now compiled as C++20. This is a breaking change for source builds: GCC 11.3 or greater, or Clang 16 or greater, is now required. The CI images already ship gcc-toolset-14, so `_build_wheel-linux.yaml` selects it for PyTorch 2.12+ and keeps gcc-toolset-11 (GCC 11.2) for older versions. - Under C++20, `fmt::format_string` is checked at compile time, so runtime strings can no longer be passed as the format. `sndfile.cc` and `sp_processor.cc` now pass libsndfile and SentencePiece error text as an argument instead. This also fixes a latent bug: error text containing braces was previously interpreted as format syntax. - Also under C++20, the unqualified `ssize()` call in the memory bindings became ambiguous with `std::ssize`, because `std::byte` in the template argument pulls `std` into the ADL set. It is now qualified. CUDA 13 dropped Volta, so the default `CMAKE_CUDA_ARCHITECTURES` is Turing rather than Volta when PyTorch is built against CUDA 13, and the wheel workflow selects architectures per variant. Finally, the bundled `zip` third-party project compiles itself with `-Werror`, and GCC 14's new `-Wcalloc-transposed-args` makes that fatal, so `-Werror` is disabled for that target only. Verified for torch 2.13.0+cu130 / py3.12 / x86_64: native suite 28/28, `pytest --device cpu` 1155 passed, `pytest --device cuda:0` on an H100 1154 passed (the one failure, gemma3n `test_batch_independence`, is a pre-existing GPU float-tolerance issue: max abs diff 9.5e-07 with `atol` left at its 1e-8 default). Wheels built in the new manylinux_2_28 cu130 image audit clean at glibc 2.27.
avidale
marked this pull request as ready for review
September 7, 2026 09:34
avidale
requested review from
MartinGleize,
cbalioglu and
zyaoj
as code owners
September 7, 2026 09:34
cbalioglu
approved these changes
Sep 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Adds PyTorch 2.13.0 (
cpu,cu130) to the support matrix, which enables co-installation withvllm==0.28.0(pinstorch==2.13.0plus CUDA 13 runtime packages) andtransformers~=5.16, removing friction in the downstream projects, such as Omnilingual.Changes
Three things had to change to build against PyTorch 2.13:
PyTorch 2.12 and later set
CMAKE_CXX_STANDARD 20, so fairseq2n is now compiled as C++20. This is a breaking change for source builds: GCC 11.3 or greater, or Clang 16 or greater, is now required. The CI images already ship gcc-toolset-14, so_build_wheel-linux.yamlselects it for PyTorch 2.12+ and keeps gcc-toolset-11 (GCC 11.2) for older versions.Under C++20,
fmt::format_stringis checked at compile time, so runtime strings can no longer be passed as the format.sndfile.ccandsp_processor.ccnow pass libsndfile and SentencePiece error text as an argument instead. This also fixes a latent bug: error text containing braces was previously interpreted as format syntax.Also under C++20, the unqualified
ssize()call in the memory bindings became ambiguous withstd::ssize, becausestd::bytein the template argument pullsstdinto the ADL set. It is now qualified.CUDA 13 dropped Volta, so the default
CMAKE_CUDA_ARCHITECTURESis Turing rather than Volta when PyTorch is built against CUDA 13, and the wheel workflow selects architectures per variant.Finally, the bundled
zipthird-party project compiles itself with-Werror, and GCC 14's new-Wcalloc-transposed-argsmakes that fatal, so-Werroris disabled for that target only.Verified for torch 2.13.0+cu130 / py3.12 / x86_64: native suite 28/28,
pytest --device cpu1155 passed,pytest --device cuda:0on an H100 1154 passed (the one failure, gemma3ntest_batch_independence, is a pre-existing GPU float-tolerance issue: max abs diff 9.5e-07 withatolleft at its 1e-8 default). Wheels built in the new manylinux_2_28 cu130 image audit clean at glibc 2.27.Some additional changes were required to make the Github CI pass; they seem unrelated to the torch/cuda/transformers versions upgrade, and instead, chase the natural evolution of the other dependencies:
mypycheck from 3.10 to 3.12, otherwise, the type stubs for numpy>=2.5, scipy, librosa are incompatible with the syntaxwandbdependency:wandb.util.generate_id → from wandb.sdk.lib.runid import generate_idDoes your PR introduce any breaking changes? If yes, please list them:
List of all backwards-incompatible changes.
Check list: