Commit d1809fe
FIX FSDP plugin update for QLoRA (huggingface#36720)
The _fsdp_qlora_plugin_updates checks for LoraConfig but other PEFT
methods can also support quantized models, e.g. VeRA. Therefore, the
isinstance check is now looking for PeftConfig in general.
Moreover, the fsdp_plugin variable may be undefined in the 2nd if
condition, leading to an `UnboundLocalError` error. This is fixed by not
assigning the variable at all.
I checked for tests that may need updating but only found
test_fsdp_config_transformers_auto_wrap associated with this change.
AFAICT, this test does not cover the changed code, since the test does
not start the training loop. Therefore, I haven't updated any tests. LMK
if/how this fix should be tested.
Co-authored-by: Marc Sun <57196510+SunMarc@users.noreply.github.com>1 parent 26b4193 commit d1809fe
1 file changed
+4
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5202 | 5202 | | |
5203 | 5203 | | |
5204 | 5204 | | |
5205 | | - | |
| 5205 | + | |
5206 | 5206 | | |
5207 | 5207 | | |
5208 | | - | |
5209 | | - | |
5210 | | - | |
| 5208 | + | |
| 5209 | + | |
5211 | 5210 | | |
5212 | 5211 | | |
5213 | 5212 | | |
5214 | 5213 | | |
5215 | 5214 | | |
5216 | | - | |
| 5215 | + | |
5217 | 5216 | | |
5218 | 5217 | | |
5219 | 5218 | | |
| |||
0 commit comments