Closed
Description
Describe the bug
All training scripts which use AttnProcsLayers will not work properly with accelerate for any accelerate feature that requires calling into the wrapped return class for monkey patching the forward method.
All lora training scripts should instead:
- the top level module must be directly passed to accelerate.prepare
- the parameters passed to the optimizer must be pulled out of the top level module
- the saving callbacks must pull the lora weights out of the top level module
- the load callbacks must load weights into the top level module
- the clipped parameters must be pulled out of the top level module
- validation and/or other forward code must properly deal with potentially changed dtypes due to mixed precision now being actually enabled
- The save of the final trained model must pull the lora weights out of the top level module
This PR fixed these bugs in the dreambooth lora script https://github.com/huggingface/diffusers/pull/3778/files but there are still 4 lora training scripts which use AttnProcsLayers
other relevant github links : #4046 #4046 (comment)
Reproduction
n/a
Logs
No response
System Info
n/a
Who can help?
No response