transformers - 💡(How to fix) Fix `MIN_PEFT_VERSION` bumped to 0.18.2 which is not yet released on PyPI [3 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
huggingface/transformers#45405Fetched 2026-04-15 06:19:43
View on GitHub
Comments
3
Participants
3
Timeline
7
Reactions
0
Timeline (top)
commented ×3closed ×1labeled ×1mentioned ×1

Root Cause

Installing peft from git (pip install git+https://github.com/huggingface/peft.git) gives 0.18.2.dev0, but this also fails the version check because PEP 440 orders 0.18.2.dev0 < 0.18.2.

Code Example

from peft.utils.save_and_load import _maybe_shard_state_dict_for_tp
RAW_BUFFERClick to expand / collapse

System Info

  • transformers version: 5.6.0.dev0 (post-commit c585eeaa65)
  • Platform: Linux-5.14.0-570.12.1.el9_6.x86_64-x86_64-with-glibc2.34
  • Python version: 3.11.15
  • Huggingface_hub version: 1.9.0
  • Safetensors version: 0.7.0
  • Accelerate version: 1.13.0
  • Accelerate config: not found
  • DeepSpeed version: not installed
  • PyTorch version (accelerator?): 2.11.0+cu130 (CUDA)
  • Using distributed or parallel set-up in script?: No
  • Using GPU in script?: No
  • GPU type: NVIDIA H100 80GB HBM3

Who can help?

@BenjaminBosworking with integrations/peft.py, relevant imports

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • My own task or dataset (give details below)

Reproduction

Commit c585eeaa65 ("Load adapter with TP") added:

from peft.utils.save_and_load import _maybe_shard_state_dict_for_tp

and bumped MIN_PEFT_VERSION to "0.18.2" in src/transformers/integrations/peft.py.

However, peft 0.18.2 has not been released on PyPI yet — the latest available version is 0.18.1.

This means anyone running transformers from main who calls enable_adapters() or any peft integration path hits:

ImportError: ... requires a minimum version of 0.18.2

Installing peft from git (pip install git+https://github.com/huggingface/peft.git) gives 0.18.2.dev0, but this also fails the version check because PEP 440 orders 0.18.2.dev0 < 0.18.2.

Expected behavior

Either:

  1. Wait for peft 0.18.2 to be released before bumping MIN_PEFT_VERSION, or
  2. Use 0.18.2.dev0 as the minimum version so the git-installed dev version satisfies the check, or
  3. Gate the new _maybe_shard_state_dict_for_tp import behind a version check so the rest of the peft integration still works with 0.18.1

extent analysis

TL;DR

The most likely fix is to wait for the release of peft version 0.18.2 or adjust the minimum version check to accommodate the development version 0.18.2.dev0.

Guidance

  • The issue arises from the version mismatch between the required peft version (0.18.2) and the latest available version on PyPI (0.18.1), as well as the development version installed from git (0.18.2.dev0) not satisfying the version check due to PEP 440 ordering.
  • To verify the issue, check the peft version installed and compare it with the minimum required version in the transformers integration.
  • Consider installing peft from git using pip install git+https://github.com/huggingface/peft.git to get the development version, but be aware that this version may not pass the version check.
  • An alternative solution could be to adjust the code to gate the new import behind a version check, allowing the rest of the peft integration to work with version 0.18.1.

Example

No specific code example is provided due to the nature of the issue focusing on version management rather than code implementation.

Notes

The solution depends on the release schedule of peft version 0.18.2 and the specific requirements of the project regarding version compatibility.

Recommendation

Apply a workaround by using the development version of peft (0.18.2.dev0) and adjust the version check in the code to accommodate this version, as waiting for the official release of 0.18.2 might not be feasible for immediate development needs.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Either:

  1. Wait for peft 0.18.2 to be released before bumping MIN_PEFT_VERSION, or
  2. Use 0.18.2.dev0 as the minimum version so the git-installed dev version satisfies the check, or
  3. Gate the new _maybe_shard_state_dict_for_tp import behind a version check so the rest of the peft integration still works with 0.18.1

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING