Skip to content

Require PyTorch and TorchAudio >= 2.6 - #1504

Merged
bruAristimunha merged 1 commit into
braindecode:masterfrom
bruAristimunha:pr/1489-2-torch-floor
Oct 31, 2026
Merged

bruAristimunha merged 1 commit into
braindecode:masterfrom
bruAristimunha:pr/1489-2-torch-floor

Conversation

@bruAristimunha

@bruAristimunha bruAristimunha commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Part of #1489.

The declared floor goes from 2.4 to 2.6, which is the PyTorch of the Intel Gaudi 1.21 software stack. The later PRs of this series use APIs that are available from 2.6, with the behaviour the tests check:

  • torch.compiler.is_compiling;
  • torch._dynamo.forbid_in_graph;
  • torch.utils.checkpoint with use_reentrant=False;
  • in-place nn.Module.compile.

Changes

  • pyproject.toml: torch>=2.6 and torchaudio>=2.6.
  • docs/install/install.rst: states the new minimum.
  • Version guards, test-side only, for failures that already exist on upstream master with older torch:
    • test_model_exported skips LUNA export below 2.10, and TFMTokenizer/BrainTokenizer export below 2.9;
    • test_registered_model_complex_only_after_spectral_input skips BDTCN, BENDR and TIDNet below 2.10, where there is no meta kernel for the weight_norm backward.
  • whats_new: the existing, still unreleased Requirements entry "Require PyTorch and TorchAudio >= 2.4 …" (:gh:1174) now says >= 2.6 and links this PR, instead of a second floor entry in the same release.

Defaults

Installing braindecode now needs torch >= 2.6. No library code changes.

Evidence

  • One independent review ran the full default suite twice, on CPU.
  • That review ran on the integration branch with this whole series applied, not on this branch alone.
torch Default suite Skips
2.6.0+cpu 9,685 passed, 0 failed 339
2.14.1+cpu 9,692 passed, 0 failed 332
  • Both runs collected the same 10,026 tests.
  • The 7 extra skips on 2.6 are the guards above, plus one pre-existing skip.
  • Mutation checks show each guard skips only below its cut-off, and that the edited tests still catch injected regressions on 2.14.1.
  • CI installs the latest CPU wheels, so CI never tests a version below the floor.

Tests

Branch tip 7f016138a404 (tree 0ffae6b7d927) on upstream master 428ad88. Every check ran in one Voyager CPU Job, bdw2-pr-prep-verify-10:

  • Environment: Python 3.12.15, torch 2.14.1+cpu, skorch 1.4.0, MNE 1.13.2, NumPy 2.5.4, MOABB 1.5.0 with real BNCI2014_001 fixtures; Intel Xeon Gold 6230R.
  • pytest test/ -n 8 from the repository root at this tip: 5,989 passed, 375 skipped, 1 xfailed, 0 failed. Upstream master under the same settings: 5,982 passed, 375 skipped, 1 xfailed.
  • pre-commit run --files <files changed by this PR>, with the repository's pinned hooks (Ruff, mypy, docstrfmt, blacken-docs, codespell, sphinx-lint): passed.
  • GitHub CI runs separately on the pushed head.

Notes for reviewers

  • No CI job runs the floor. CI installs the latest CPU wheels, so the 2.6 result above comes from these off-CI runs only. A follow-up could add a minimum-dependencies job (torch==2.6.* torchaudio==2.6.* on the CPU index, default tier).
  • EEGConformer torch.compile on CPU needs torch >= 2.7 for training with attention dropout. On torch 2.6 CPU, Inductor fails to compile it (BackendCompilerFailed in the dropout codegen). This already happens on upstream master. It works with dropout 0, in eval mode, with aot_eager, and on 2.7 and 2.14.1. No suite test hits it. It concerns only opt-in compilation.

@codecov

codecov Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.20%. Comparing base (a78824d) to head (b1163e5).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1504   +/-   ##
=======================================
  Coverage   91.20%   91.20%           
=======================================
  Files         169      169           
  Lines       21916    21916           
=======================================
  Hits        19989    19989           
  Misses       1927     1927           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

2.6 is the PyTorch of the Intel Gaudi 1.21 software stack. On torch 2.6 CPU
the suite needed only test-side version guards for failures that predate
this series (weight_norm meta backward and LUNA export before 2.10,
TFMTokenizer/BrainTokenizer export before 2.9).

Part of braindecode#1489.
@bruAristimunha
bruAristimunha marked this pull request as ready for review October 31, 2026 20:46
Copilot AI balanced review requested due to automatic review settings October 31, 2026 20:46

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

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.

2 participants