huggingface / huggingface/diffusers

Flux Inference memory optimisation by pre-computing modulation parameters ahead of time

オープン
#9,197 コメント 3 件 リアクション 2 件 担当者 0 名 GitHub で見る
stale
主要言語
Python
スター
34.5k
フォーク
7.3k
平均マージ
3日 3時間
マージ済み PR(30日)
91

説明

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.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Diffusers のファイルやテストは指定されていません。まずリンクされた DiffusionKit pull request を読み、その後 Diffusers 内の Flux の推論と変調パラメータの処理を見つけてください。完了の条件は、推論の挙動を維持しながら、同等の事前計算と offloading によるメモリ削減を実現することです。これには MPS ユーザーの場合も含まれます。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python, pytorch
領域
machine-learning, performance
issue の種類
リファクタリング
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
38/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。