peft icon indicating copy to clipboard operation
peft copied to clipboard

TST: Some SHiRA tests are failing when run with parallelism

Open BenjaminBossan opened this issue 1 year ago • 3 comments

System Info

PEFT 0.17.0

Who can help?

No response

Reproduction

When running

pytest tests/test_custom_models.py -k shira -n2

(or with higher parallelism), some SHiRA tests fail locally. Which ones depends on the level of parallelism. This is true with CPU and GPU. I'm not sure why the CI doesn't pick it up.

@kkb-code can you reproduce that?

Expected behavior

Tests should pass.

BenjaminBossan avatar Aug 01 '25 17:08 BenjaminBossan

Hi @BenjaminBossan, I am interested in this issue. Can I raise a PR to fix this ?

akacmazz avatar Aug 12 '25 22:08 akacmazz

Hi @BenjaminBossan and @akacmazz, sorry for the delay in my response. I had been debugging this and it seems like the issue originates in the test_disable_adapters_with_merging test assert statement here. It seems like the SHiRA adapter must act like a no-op for this assert to pass successfully (as evident from these lines for the same test here and other similar lines in a similar test_disable_adapters test here). However, the SHiRA adapters that we have declared for these tests will not act as a no-op (which we needed for many other tests).

The solution might be to just add these lines right below this line. I am not really sure why the CI passed at all. But hopefully this should resolve this issue.

@akacmazz: Thanks so much for offering to help with this. Please feel free to tag me to the PR and ask any questions.

kkb-code avatar Aug 13 '25 01:08 kkb-code

Thanks for investigating @kkb-code. Indeed, adding this line solves the issue, although it is still strange to me that the level of parallelism somehow affects the outcome. Let me work on a solution, as I may do some additional clean ups related to this test file.

Also, thanks @akacmazz for your offer.

BenjaminBossan avatar Aug 13 '25 09:08 BenjaminBossan