Support separate placement for encoding and decoding with tensor parallelism

オープン
#15,336 コメント 1 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@DN6 がすでに取り組んでいます。

2026年11月18日 から。

評価

この issue はまだ評価されていません。

説明

The tensor-parallel inference example from #13718 loads and runs the text encoders and VAE on every rank. Each rank encodes the same prompt and decodes the same final latents. For FLUX.1-schnell, those components account for about 9.3 GiB of bf16 weights per rank.

Could Diffusers support running encoding and decoding once per request, with configurable placement for those stages?

  • Encode the prompt and any input images once, then send the conditioning tensors to the TP group.
  • Run denoising across the TP group.
  • Decode and postprocess the final latents once.

Keeping the encoders and VAE on a single TP rank would reduce total memory use and redundant computation. If those weights stay resident during denoising, that rank still has less room for its denoiser shard. With equal-sized shards, the rank with the least free memory determines what fits across the group. To free memory on every TP rank during denoising, the pipeline could place encoding and decoding on a separate device or offload their weights between stages.

This came up while testing on Trainium, but the placement is hardware-independent. FLUX already accepts precomputed prompt embeddings and can return latents. Pipeline-level support would let callers use those stage boundaries without wiring them up separately for each pipeline.

主要言語
Python
スター
34.9k
フォーク
7.5k
平均マージ
3日 16時間
マージ済み PR(30日)
65

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

huggingface/diffusers のほかの issue

huggingface/diffusers の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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