-
Notifications
You must be signed in to change notification settings - Fork 5.9k
[Tests] Enable more general testing for torch.compile()
with LoRA hotswapping
#11322
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for refactoring the tests to make them modular and align them better with the diffusers testing style. I don't have anything to add, just a few nits. I was not sure if the tests are run in the CI so I ran them locally and they all passed (they took 2 min 7 sec).
Just added it to our nightly CI: 4b11ab2. |
Just a question. Why not place these under the LoRA tests in the nightlys? The compile image isn't actually needed anymore. It was only a workaround for issues we were facing with Python 3.8 and torch.compile. Since the base images now using 3.10, we should be okay to have them run there. |
@DN6 good point. Done. |
What does this PR do?
@BenjaminBossan shipped a great feature in #9453. We decided to add tests only for the
Unet2DConditionModel
. However, we support LoRA hotswapping withtorch.compile()
for all models subclassed withPeftAdapterMixin
.This PR refactors the
TestLoraHotSwappingForModel
class to make it more generally available to the model test classes. I believe this is nice to have as this feature is for power users and for users who usediffusers
in production environments.Currently, this PR adds
LoraHotSwappingForModelTesterMixin
(revised name) to the test classes ofUnet2DConditionModel
andFluxTransformer2DModel
as I think those are the most popular ones having significant usage.I think we can open the rest of the models for community contributions.
@yiyixuxu FYI.