Skip to content
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

can stable fast used with diffusers device_map='auto' #132

Open
zhangvia opened this issue Mar 7, 2024 · 1 comment
Open

can stable fast used with diffusers device_map='auto' #132

zhangvia opened this issue Mar 7, 2024 · 1 comment

Comments

@zhangvia
Copy link

zhangvia commented Mar 7, 2024

hey,fantasy work!
i 'm seeking some framework that can speedup diffusion and maintain the flexibility of original torch code.
i check the all features of your work, and it's really great.

and i want to know if this repo can still work when device_map in diffuser pipeline is set to "auto"

this is a new feature which will be released in next version of diffusers.

when you set the device_map to 'auto', diffusers will check all gpus you have on the server, and put different model to different gpu. and that will allow somebody who don't have high end gpu with large vram can still use diffusers with several low end gpu.

think about this: you load two controlnet, a whole txt2img pipeline. you want to generate a 1024*1024 picture。if you don't have a gpu with vram more than 20GB, that will be impossible. but with device_map='auto', the controlnet will be load to 'cuda:0', the unet will be load to 'cuda:1' and so on. so that you can generate that on two gpu like RTX2080ti.

they implement the device_map='auto' through hooks,which is a feature of accelerate. accelerate can add a hook which can align the device of input data and model to the diffusers model. so i want to know if the stable fast can work when the device_map = 'auto'

@chengzeyi
Copy link
Owner

@zhangvia Sorry, it is not tested. I guess you can give it a try.

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

No branches or pull requests

2 participants