Bump min peft 0.19.1 remove weight conversion duplicate code - #46442
Conversation
As discussed internally. Context When Transformers v5 was released with the new weight conversion feature, it required extra logic to deal with loading PEFT adapters. We agreed to move that logic to PEFT, but at the time there was no PEFT release containing the code, so the logic lived in Transformers. The code has later been duplicated in PEFT and is contained in the 0.19 release (with a bugfix in 0.19.1). Description Now that PEFT v0.19.1 has been out for a long time, we can safely remove the duplicated code in Transformers and bump the min required PEFT version to v0.19.1 (of course, PEFT still is an optional dependency). All duplicated code has been removed and docs have been updated where needed. I have confirmed on my machine that the Transformers PEFT tests still pass with this change. (There are failing tests relating to hotswapping, but those are being worked on elsewhere.) On the other side, PEFT tests for weight conversion also still pass. Open Some PEFT tests use patch_moe_parameter_targeting, but they are correctly guarded against removal of that function. After the next Transformers release, these tests can be removed in PEFT.
|
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. |
|
The one failing test, |
ArthurZucker
left a comment
There was a problem hiding this comment.
Super nice! I am gonna wait to test if this will break vllm along with https://github.com/huggingface/transformers/pull/46381/changes And will merge once its cool!
(should be alright AFAIK)
|
View the CircleCI Test Summary for this PR: https://huggingface.co/spaces/transformers-community/circle-ci-viz?pr=46442&sha=4a6b5b |
|
I merged latest main and resolved the merge conflicts. I ran the PEFT tests locally and they passed, except for the ones that are being worked on in #45682. |
|
@Cyrilvallez Could you please take a look since Arthur mentioned he's busy with tokenizers? I think there should be no blockers for merging (not sure if #46442 (review) is still relevant). |
CI recapDashboard: View test results in Grafana |
…face#46442) * [PEFT] Use PEFT weight conversion code, bump min version to 0.19.1 As discussed internally. Context When Transformers v5 was released with the new weight conversion feature, it required extra logic to deal with loading PEFT adapters. We agreed to move that logic to PEFT, but at the time there was no PEFT release containing the code, so the logic lived in Transformers. The code has later been duplicated in PEFT and is contained in the 0.19 release (with a bugfix in 0.19.1). Description Now that PEFT v0.19.1 has been out for a long time, we can safely remove the duplicated code in Transformers and bump the min required PEFT version to v0.19.1 (of course, PEFT still is an optional dependency). All duplicated code has been removed and docs have been updated where needed. I have confirmed on my machine that the Transformers PEFT tests still pass with this change. (There are failing tests relating to hotswapping, but those are being worked on elsewhere.) On the other side, PEFT tests for weight conversion also still pass. Open Some PEFT tests use patch_moe_parameter_targeting, but they are correctly guarded against removal of that function. After the next Transformers release, these tests can be removed in PEFT. * Fix more instances referring to older PEFT versions
As discussed internally.
What does this PR do?
Context
When Transformers v5 was released with the new weight conversion feature, it required extra logic to deal with loading PEFT adapters. We agreed to move that logic to PEFT, but at the time there was no PEFT release containing the code, so the logic lived in Transformers. The code has later been duplicated in PEFT and is contained in the 0.19 release (with a bugfix in 0.19.1).
Description
Now that PEFT v0.19.1 has been out for a long time, we can safely remove the duplicated code in Transformers. All code marked with
# TODO: remove once PEFT < 0.19 no longer supportedis removed. We bump the min required PEFT version to v0.19.1 (of course, PEFT still is an optional dependency).All duplicated code has been removed and docs have been updated where needed. I have confirmed on my machine that the Transformers PEFT tests still pass with this change. (There are failing tests relating to hotswapping, but those are being worked on elsewhere.) On the other side, PEFT tests for weight conversion also still pass.
The failing the CI test seems to be unrelated to this PR.
Open
Some PEFT tests use
patch_moe_parameter_targeting, but they are correctly guarded against removal of that function. After the next Transformers release, these tests can be removed in PEFT.Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.