Skip to content

Conversation

BenjaminBossan
Copy link
Member

@BenjaminBossan BenjaminBossan commented Oct 16, 2025

There is still some chaos in our test suite, despite recent efforts to refactor it. This PR tries to improve the situation a bit.

Some of the changes:

  • for some PEFT methods, adjust some tolerances where necessary instead of skipping the whole test
  • don't add return to pytest.skip, it's not necessary
  • avoid self.skipTest, always use pytest.skip
  • unused CONFIG_TESTING_KWARGS is removed
  • factor out common skipping logic into dedicated functions
  • many tests had code like: skip unless it's LoRA or IA³ or ... often, new PEFT methdos would actually work but were not added to this list, resulting in unnecessary skips
  • make it so that LN Tuning is allowed to run with 0 active adapters (ping @DTennant)
  • fix a bug in BOFT resulting in cayley_batch always returning float32 dtype (ping @zqiu24)
  • transpose delta_weight for WaveFT merging if base layer is Conv1D (ping @Bilican)
  • fix UnboundLocalError in C3A (ping @Phoveran)

For those that I pinged, this is just to let you know I made some fixes on PEFT methods that may concern you and ask you, if you have time, to double check them.

Errors not fixed in this PR (yet):

There is still some chaos in our test suite, despite recent efforts to
refactor it. This PR tries to improve the situation a bit.

Currently, some tests are expected to fail. This can be due to errors in
this PR but some errors may be genuine bugs. I'll investigate further.

Some of the changes:

- don't add return to pytest.skip, it's not necessary
- avoid self.skipTest, always use pytest.skip
- unused CONFIG_TESTING_KWARGS is removed
- factor out common skipping logic into dedicated functions
- many tests had code like: skip unless it's LoRA or IA³ or ... often,
  new PEFT methdos would actually work but were not added to this list,
  resulting in unnecessary skips
@HuggingFaceDocBuilderDev

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.

@BenjaminBossan BenjaminBossan marked this pull request as draft October 16, 2025 16:21
@BenjaminBossan
Copy link
Member Author

@Phoveran I also noticed that we missed a TODO:

The method is described in detail in [TODO].

@Phoveran
Copy link
Contributor

Hi,

Thanks for the notice! I have added the paper link in my fork.
However, for the error, I tried to replicate it by python -m pytest tests/ -k c3a but failed. The test cases are all passed or skipped. Could you show me more details on it?

@BenjaminBossan
Copy link
Member Author

I have added the paper link in my fork.

Nice, could you please create a PR?

However, for the error, I tried to replicate it by python -m pytest tests/ -k c3a but failed. The test cases are all passed or skipped. Could you show me more details on it?

You would have to use my branch from this PR. It removes a lot of skipping logic from the tests that I found unnecessary. But there is no need for you to get active, I already fixed the issue in C3A, my ping is just to let you know and for you to double check my change.

@Phoveran
Copy link
Contributor

Phoveran commented Oct 20, 2025

Got you. The PR is ready. Thanks!

* more BOFT dtype fixes
* fix faulty test
BenjaminBossan added a commit to BenjaminBossan/peft that referenced this pull request Oct 20, 2025
Currently, adapter deletion raises an error with DeLoRA. The reason is
that the dropout module is called module_dropout, i.e. the prefix
"delora" is not part of the name, which is required for proper working.
This PR renames the attribute to delora_dropout.

The reason why this was not caught is because the corresponding test was
not updated to include DeLoRA. The test was thus also changed.

Note: I came across this issue in huggingface#2846 but I wanted to fix it in a
separate PR, as huggingface#2846 is probably not going to make it into the next
PEFT release.
@BenjaminBossan
Copy link
Member Author

BenjaminBossan commented Oct 20, 2025

Note on some of the failing tests:

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