add device map and accelerate to DiffusionPipeline abstraction to reduce memory footprint when loading model
See original GitHub issueIs your feature request related to a problem? Please describe.
As a follow up for #281 we could add the device map and the possibility to load weights using accelerate
to DiffusionPipeline
abstraction for smaller memory footprint when loading models.
Describe the solution you’d like
from diffusers import DiffusionPipeline
pipeline = DiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-3", device_map="auto")
Describe alternatives you’ve considered
- Load models by hand every time
- Have a larger memory footprint when loading models
Additional context This is a follow up for #281.
I can work on that if you folks would let me.
Issue Analytics
- State:
- Created a year ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Stable Diffusion with Diffusers - Hugging Face
In this post, we want to show how to use Stable Diffusion with the Diffusers library, explain how the model works and finally...
Read more >Reducing the Memory Footprint of Metal Apps - Apple Developer
Load lower -resolution textures when running on memory-constrained devices. Consider reducing the fidelity of 3D models and compressing per-vertex data. Simplify ...
Read more >Optimizing Memory Usage of Textures & Meshes // Unreal ...
Support on Patreon: https://patreon.com/techartaid/Streaming weekly at https://twitch.tv/techartaid/
Read more >Estimating GPU Memory Consumption of Deep Learning Models
ABSTRACT. Deep learning (DL) has been increasingly adopted by a variety of software-intensive systems. Developers mainly use GPUs to accel-.
Read more >Python mmap: Improved File I/O With Memory Mapping
In this tutorial, you'll learn how to use Python's mmap module to improve your code's performance when you're working with files.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@CrazyBoyM, what happens is that, for that feature to work, we need a version of
accelerate
with https://github.com/huggingface/accelerate/pull/747 merged. This PR was merged 4 days ago and the last release was 7 days ago.Until they make the next release for accelerate, if you really want to use this feature I suggest you install accelerate from the master branch of the repository:
pip install git+https://github.com/huggingface/accelerate.git
, which you can revert to the pypi version after the next release.Hi, friend.I see this PR https://github.com/huggingface/diffusers/pull/361 but when i try this:
i get a error with:
can you help me?