Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation & error checking for AdaLoRA timing #2341

Merged
merged 12 commits into from
Jan 24, 2025

Conversation

githubnemo
Copy link
Collaborator

The documentation about how the AdaLoRA works was a bit unclear. Especially that tfinal is not a point in time but a duration.

It was also possible to build schedules that never budget and therefore lead to an exception because the code does not expect this case (which is OK). We prevent such a scenario now by treating this configuration as invalid. (Issue #2337)

Additionally, it was possible to provide total_step=None (the default) which is certainly going to lead to errors. This is technically a breaking change but the same could be said for the new check of the timing values. They both lead to errors in the code.

nemo added 8 commits January 23, 2025 08:08
The documentation about how the AdaLoRA works was a bit unclear.
Especially that `tfinal` is not a point in time but a duration.

It was also possible to build schedules that never budget and
therefore lead to an exception because the code does not expect
this case (which is OK). We prevent such a scenario now by treating
this configuration as invalid. (Issue huggingface#2337)
We also check for `total_step` != None since this is also a
guaranteed error in the code.
Also added `total_step` argument so that the optimizer will not break.
Copy link
Member

@BenjaminBossan BenjaminBossan left a comment

Choose a reason for hiding this comment

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

Thanks for this improvement to AdaLoRA argument checking and much better docs. LGTM.

@githubnemo githubnemo merged commit 9c25d94 into huggingface:main Jan 24, 2025
14 checks passed
BenjaminBossan added a commit to BenjaminBossan/peft that referenced this pull request Jan 27, 2025
PR huggingface#2341 added more rigorous checks for AdaLoRA and adjusted the tests
to take that into account. However, one GPU test was missed. This test
is now updated too, fixing the failing nightly CI (I ran it locally on
GPU to verify).

On top of that, I adjusted some numbers on the tests so that each
AdaLoRA phase runs for 2 steps, leading to 6 steps total. This means
that tests run a little bit longer but I think it's acceptable for
better test coverage.
BenjaminBossan added a commit that referenced this pull request Jan 27, 2025
PR #2341 added more rigorous checks for AdaLoRA and adjusted the tests
to take that into account. However, one GPU test was missed. This test
is now updated too, fixing the failing nightly CI (I ran it locally on
GPU to verify).

On top of that, I adjusted some numbers on the tests so that each
AdaLoRA phase runs for 2 steps, leading to 6 steps total. This means
that tests run a little bit longer but I think it's acceptable for
better test coverage.
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.

2 participants