Skip to content

Filter triton AnnAssign DeprecationWarning on Python 3.14#6467

Merged
albertvillanova merged 2 commits into
mainfrom
fix-triton-annassign-py314-warning
Jul 21, 2026
Merged

Filter triton AnnAssign DeprecationWarning on Python 3.14#6467
albertvillanova merged 2 commits into
mainfrom
fix-triton-annassign-py314-warning

Conversation

@albertvillanova

@albertvillanova albertvillanova commented Jul 20, 2026

Copy link
Copy Markdown
Member

This PR silences a DeprecationWarning emitted across many test modules in CI on Python 3.14 by Triton's kernel compiler.

I reported upstream at:

Removal is tracked in:

Note that on Python 3.15 this becomes a hard error the filter will not suppress, so Triton must be fixed/upgraded before then.

Motivation

Compiling @triton.jit kernels during tests triggers, on Python 3.14:

triton/compiler/code_generator.py:629: DeprecationWarning: AnnAssign.__init__ missing 1 required positional argument: 'simple'. This will become an error in Python 3.15.
  init_node = ast.AnnAssign(target=st_target, value=default_value, annotation=annotation)

Triton builds an ast.AnnAssign node without the required simple field (in visit_FunctionDef, for kernel arguments that have both an annotation and a default value). The warning comes from Triton, not TRL, and is triggered only indirectly by kernel compilation. It appears in tests/test_grpo_trainer.py, tests/test_kto_trainer.py, tests/test_dpo_trainer.py, tests/test_rloo_trainer.py, tests/test_sft_trainer.py, and tests/test_utils.py.

Solution

Following the existing precedent in pyproject.toml, filter the non-actionable upstream warning. The match stops before the colon in the message (AnnAssign.__init__ missing 1 required positional argument) so it stays a valid pytest filter spec and specific to this deprecation.

Changes

  • Add a filterwarnings entry in pyproject.toml to ignore Triton's AnnAssign simple-field DeprecationWarning

Note

Low Risk
Test configuration only; no production code paths change, though reliance on the filter will break on Python 3.15 if Triton remains unfixed.

Overview
Adds a pytest filterwarnings entry in pyproject.toml so CI on Python 3.14 no longer fails or floods logs when tests indirectly compile Triton kernels.

The ignored message is Triton’s upstream ast.AnnAssign missing simple DeprecationWarning (documented with tracking issue #6466 and triton-lang/triton#10981), matching the same pattern as existing filters for Liger, bitsandbytes, and PyTorch.

This is a test/CI hygiene change only; runtime TRL behavior is unchanged. Note that the warning is expected to become a hard error on Python 3.15, so the filter is temporary until Triton is fixed or upgraded.

Reviewed by Cursor Bugbot for commit 7e162b6. Bugbot is set up for automated code reviews on this repo. Configure here.

@bot-ci-comment

Copy link
Copy Markdown

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.

@albertvillanova
albertvillanova force-pushed the fix-triton-annassign-py314-warning branch from 7e162b6 to ec2d8d2 Compare July 21, 2026 09:28
@albertvillanova
albertvillanova merged commit d08f613 into main Jul 21, 2026
13 checks passed
@albertvillanova
albertvillanova deleted the fix-triton-annassign-py314-warning branch July 21, 2026 10:25
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