diffusers icon indicating copy to clipboard operation
diffusers copied to clipboard

CPU offloading currently done in a hacky way.

Open patrickvonplaten opened this issue 3 years ago • 1 comments

Describe the bug

It seems like accelerate doesn't yet support cpu offloading of modules that have single parameters such as: https://github.com/huggingface/diffusers/blob/29021090614641d2509155ca0021497896228999/src/diffusers/pipelines/stable_diffusion/safety_checker.py#L44

which forces one to do the following: https://github.com/huggingface/diffusers/blob/2c6bc0f13ba2ba609ac141022b4b56b677d74943/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py#L238 in the stable diffusion pipeline.

Need to investigate more before posting an issue on accelerate codebase.

Reproduction

No response

Logs

No response

System Info

"main"

patrickvonplaten avatar Nov 25 '22 12:11 patrickvonplaten

I won't find time to fix this anytime soon I believe. Also don't think it's a big problem.

patrickvonplaten avatar Dec 20 '22 00:12 patrickvonplaten

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

github-actions[bot] avatar Jan 13 '23 15:01 github-actions[bot]

This was actually fixed - cpu offloading is clean now :heart:

patrickvonplaten avatar Jan 22 '23 21:01 patrickvonplaten