Skip to content

Set kernels optional dependency via transformers#5884

Merged
albertvillanova merged 2 commits into
mainfrom
fix-dep-kernels
May 30, 2026
Merged

Set kernels optional dependency via transformers#5884
albertvillanova merged 2 commits into
mainfrom
fix-dep-kernels

Conversation

@albertvillanova
Copy link
Copy Markdown
Member

@albertvillanova albertvillanova commented May 29, 2026

Set kernels optional dependency via transformers[kernels].

This PR updates the way the kernels dependency is specified in both the main and development dependencies in pyproject.toml. Instead of directly depending on the kernels package, the project now relies on the transformers[kernels] extra, which should simplify dependency management and improve compatibility.

Related to:

Motivation

Since TRL does not directly depend on the kernels package itself, the new extra simply re-exports the corresponding transformers extra instead of duplicating its dependency specification. This keeps transformers as the single source of truth for the underlying package requirements and version constraints.

This also ensures we automatically inherit both the lower and upper version bounds defined upstream (and any future updates to them), avoiding duplication in TRL.

Changes

Dependency management updates:

  • Replaced the direct dependency on kernels<0.15.1 with transformers[kernels] in the main dependencies list.
  • Updated the development dependencies to use transformers[kernels] instead of kernels<0.15.1.

Note

Low Risk
Packaging-only change with no runtime code; install graphs may shift if Transformers' kernels extra differs from the old pin.

Overview
The kernels optional extra and the dev dependency bundle no longer pin kernels<0.15.1 directly. Both now install transformers[kernels], so kernel package versions and bounds come from Transformers instead of being duplicated in TRL (related to GH-5878 / #5880).

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

@HuggingFaceDocBuilderDev
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 merged commit 2fc06c8 into main May 30, 2026
12 of 13 checks passed
@albertvillanova albertvillanova deleted the fix-dep-kernels branch May 30, 2026 05:41
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.

3 participants