huggingface / huggingface/diffusers
Flux Inference memory optimisation by pre-computing modulation parameters ahead of time
- Vorherrschende Sprache
- Python
- Sterne
- 34.5k
- Forks
- 7.3k
- Ø Merge
- 3 T. 3 Std.
- Gemergte PRs (30 T.)
- 91
Beschreibung
DiffusionKit has an excellent memory optimisation for Flux where it calculates modulation parameters ahead of time
then offloads the adaLN_modulation parameters which for fp16 saves ~ 6.5 GB peak memory usage during inference.
https://github.com/argmaxinc/DiffusionKit/pull/15/
It would be nice if a similar change could be made to Diffusers.
It's especially useful for MPS users who are getting left behind with the current trend using quantisation to reduce memory usage rather than optimisation and for whom CPU offloading is not a thing.
Beitragsleitfaden
Rechercherichtung
No Diffusers files or tests are named. Start by reading the linked DiffusionKit pull request, then locate the Flux inference and modulation-parameter handling in Diffusers. Done means achieving the analogous precomputation and offloading memory reduction while preserving inference behavior, including for MPS users.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python, pytorch
- Bereich
- machine-learning, performance
- Issue-Typ
- Refactoring
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 38/100