Skip to content

Conversation

isidentical
Copy link
Contributor

What does this PR do?

Part of #4975, along with #4976 and #4979. This PR leverages the accelerate's init empty weights (just like diffusers automatically does on certain models, like vae for SD) when we are initializing the LoRA weights for the first them. This grants a great boost for avoiding unnecessary computations which would be overriden just a moment later. On top of #4976 and #4979, this PR makes the load_lora_weights() + unload_lora_weights() cycle take around a second (1.05seconds to be precise) from ~6 seconds without any of them. Relative effect on top of the first two PRs (combined) is about 1.33x.

Before submitting

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@isidentical isidentical marked this pull request as ready for review September 11, 2023 17:12
@patrickvonplaten
Copy link
Contributor

I think this is already fixed by: #4994

@isidentical
Copy link
Contributor Author

Yep, #4994 fixes this!

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