Skip to content

🚨 [v5][PEFT] Bump min version requirement of PEFT to 0.18.0#41889

Merged
BenjaminBossan merged 12 commits intohuggingface:mainfrom
BenjaminBossan:peft-require-min-version-0.18.0
Nov 27, 2025
Merged

🚨 [v5][PEFT] Bump min version requirement of PEFT to 0.18.0#41889
BenjaminBossan merged 12 commits intohuggingface:mainfrom
BenjaminBossan:peft-require-min-version-0.18.0

Conversation

@BenjaminBossan
Copy link
Copy Markdown
Member

@BenjaminBossan BenjaminBossan commented Oct 27, 2025

What does this PR do?

PEFT is an optional dependency of transformers with a min version of 0.5.0. However, starting with transformers v5, older PEFT versions will not work anymore (see #41406). The minimum PEFT version will be 0.18.0.

This PR updates the PEFT integration to require PEFT 0.18.0. This allows us to eliminate some obsolete checks and tests that were required for backwards compatibility.

Note:

  • PEFT 0.18.0 is not yet released, so don't merge this PR yet. However, we will release it once we have tested it with the transformers v5 release candidate, before the transformers v5 released.
  • If this commit is not included in the transformers v5 release, users who want to use PEFT will get an ImportError without indication what's wrong. Therefore, I would highly recommend to merge this before the v5 release.

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests? <= Tests updated

PEFT is an optional dependency of transformers with a min version of
0.5.0. However, starting with transformers v5, older PEFT versions will
not work anymore (see huggingface#41406). The minimum PEFT version will be 0.18.0.

This PR updates the PEFT integration to require PEFT 0.18.0. This allows
us to eliminate some obsolete checks and tests that were required for
backwards compatibility.

Note: PEFT 0.18.0 is not yet released, so **don't merge** this PR yet.
However, we will release it once we have tested it with the transformers
v5 release candidate, before the transformers v5 released.
"""
check_peft_version(min_version=MIN_PEFT_VERSION)

if not is_peft_available():
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I deleted this check because check_peft_version already checks if PEFT is available, meaning it is redundant. This change is not strictly related to the min version bump.

@BenjaminBossan BenjaminBossan changed the title Peft require min version 0.18.0 🚨 [v5][PEFT] Bump min version requirement of PEFT to 0.18.0 Oct 27, 2025
@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.

Copy link
Copy Markdown
Contributor

@githubnemo githubnemo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good from my side

@BenjaminBossan BenjaminBossan marked this pull request as ready for review October 28, 2025 10:24
@BenjaminBossan
Copy link
Copy Markdown
Member Author

This PR should be included in the v5 release. Not sure who can best review it, ping @ydshieh. The failing tests seem to be unrelated to this PR.

Copy link
Copy Markdown
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to merge, wondering why we don't update the dependency_table and setup.py ? 🤗

@BenjaminBossan
Copy link
Copy Markdown
Member Author

Happy to merge, wondering why we don't update the dependency_table and setup.py ? 🤗

PEFT is an optional dependency, as such there is no entry there.

@ydshieh
Copy link
Copy Markdown
Collaborator

ydshieh commented Nov 14, 2025

Happy to merge, wondering why we don't update the dependency_table and setup.py ? 🤗

You can still put it in those files. Most of them are optional dependency, even torch .

The benefits is that an user could do something like pip install transformers[dev] or even pip install transformers[peft] (if you want such entries).

But it's just minor, up to you.

@BenjaminBossan
Copy link
Copy Markdown
Member Author

@ydshieh I didn't know that, I added PEFT to that list. The failing CI looks unrelated.

@BenjaminBossan
Copy link
Copy Markdown
Member Author

@ArthurZucker I updated the PR, could you please give a final review?

@BenjaminBossan
Copy link
Copy Markdown
Member Author

Merged the latest main, the failing test looks unrelated to this PR.

Copy link
Copy Markdown
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to merge 🤗

@BenjaminBossan BenjaminBossan merged commit 8d9923a into huggingface:main Nov 27, 2025
23 checks passed
@BenjaminBossan BenjaminBossan deleted the peft-require-min-version-0.18.0 branch November 27, 2025 14:35
SangbumChoi pushed a commit to SangbumChoi/transformers that referenced this pull request Jan 23, 2026
…ace#41889)

PEFT is an optional dependency of transformers with a min version of
0.5.0. However, starting with transformers v5, older PEFT versions will
not work anymore (see huggingface#41406). The minimum PEFT version will be 0.18.0.

This PR updates the PEFT integration to require PEFT 0.18.0. This allows
us to eliminate some obsolete checks and tests that were required for
backwards compatibility.
yichiche added a commit to yichiche/sglang that referenced this pull request Mar 26, 2026
….x compat

peft 0.17.0 imports HybridCache from transformers, which was removed in
transformers 5.x. peft>=0.18.0 drops this import and is required by
transformers v5 (huggingface/transformers#41889).

Made-with: Cursor
yichiche added a commit to yichiche/sglang that referenced this pull request Mar 26, 2026
….x compat

peft 0.17.0 imports HybridCache from transformers, which was removed in
transformers 5.x. peft>=0.18.0 drops this import and is required by
transformers v5 (huggingface/transformers#41889).
yichiche added a commit to yichiche/sglang that referenced this pull request Mar 26, 2026
….x compat

peft 0.17.0 imports HybridCache from transformers, which was removed in
transformers 5.x. peft>=0.18.0 drops this import and is required by
transformers v5 (huggingface/transformers#41889).
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.

5 participants