Filter reworded torch.jit.script_method warning on Python 3.14#6465
Merged
Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
…t-method-py314-warning
albertvillanova
force-pushed
the
fix-torch-jit-script-method-py314-warning
branch
from
July 21, 2026 08:36
268f3ea to
07b65bb
Compare
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.
This PR extends the existing PyTorch JIT
filterwarningsentry so it also silences the Python 3.14+ variant of thetorch.jit.script_methoddeprecation warning.Motivation
pyproject.tomlalready filters thetorch.jit.script_methodDeprecationWarning, but only its original wording (... is deprecated). On Python 3.14 PyTorch reworded the same deprecation:Since the message no longer starts with "is deprecated", the existing filter does not match and the warning resurfaces in CI on Python 3.14.
Solution
Add a targeted
filterwarningsentry matching the reworded message. Matching stops at`torch.jit.script_method` is not supportedso it stays specific to this deprecation (not broad enough to catch unrelated futuretorch.jit.script_methodwarnings) while being robust to the Python version number in the text.Changes
ignoreentry inpyproject.tomlfor thetorch.jit.script_method"is not supported in Python 3.14+"DeprecationWarning.Note
Low Risk
Test configuration only; no runtime or library behavior changes.
Overview
Extends pytest
filterwarningsinpyproject.tomlso CI on Python 3.14+ stays quiet for the same upstream PyTorch JIT deprecation that was already ignored when the message said`torch.jit.script_method` is deprecated.Adds a second ignore rule matching
`torch.jit.script_method` is not supported(plus a short comment), since PyTorch reworded that warning on 3.14 and the old pattern no longer matched.Reviewed by Cursor Bugbot for commit 07b65bb. Bugbot is set up for automated code reviews on this repo. Configure here.