huggingface / huggingface/diffusers

HunyuanVideo pipe.transformer.compile(): torch._dynamo hit config.recompile_limit (8)

Offen
#10,932 5 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
bug stale
Vorherrschende Sprache
Python
Sterne
34.5k
Forks
7.3k
Ø Merge
3 T. 3 Std.
Gemergte PRs (30 T.)
91

Beschreibung

### Describe the bug

HunyuanVideo transformer compilation is not working as expected and results also in corrupted output video.

See [here](https://github.com/huggingface/diffusers/pull/10730#issuecomment-2639842593) related discussion as well and a functioning example for Flux-1.dev.

### Reproduction

```
import torch
from diffusers import HunyuanVideoPipeline, HunyuanVideoTransformer3DModel
from diffusers.utils import export_to_video

MODEL_ID = "tencent/HunyuanVideo"
PROMPT = "A cat walks on the grass, realistic"

transformer = HunyuanVideoTransformer3DModel.from_pretrained(
pretrained_model_name_or_path=MODEL_ID,
subfolder="transformer",
torch_dtype=torch.bfloat16,
revision="refs/pr/18",
)
pipe = HunyuanVideoPipeline.from_pretrained(
pretrained_model_name_or_path=MODEL_ID,
transformer=transformer,
torch_dtype=torch.float16,
revision="refs/pr/18",
)

pipe.vae.enable_tiling()
pipe.transformer.compile()

for _ in range(2):
output = pipe(
prompt="A cat walks on the grass, realistic",
height=320,
width=512,
num_frames=61,
num_inference_steps=30,
).frames[0]

export_to_video(output, "output.mp4", fps=15)
```

### Logs

```shell
(.repro) root@1bc6f7fdd66e:/workspace/scripts# TORCH_LOGS="+recompiles" python huvideo_compile_repro.py |& tee recompiles.log
Fetching 6 files: 100%|██████████| 6/6 [00:00<00:00, 61380.06it/s]
Loading checkpoint shards: 100%|██████████| 6/6 [00:00<00:00, 53.05it/s]
Loading checkpoint shards: 100%|██████████| 4/4 [00:00<00:00, 7.20it/s]it/s]
Loading pipeline components...: 100%|██████████| 7/7 [00:01<00:00, 4.09it/s]
0%| | 0/30 [00:00

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Start with the reproduction in huvideo_compile_repro.py and run it with TORCH_LOGS="+recompiles". Inspect forward in src/diffusers/models/transformers/transformer_hunyuan_video.py at lines 386 and 464, focusing on the processor guard failures. Done means HunyuanVideo compilation avoids the cache limit and produces an uncorrupted output video.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python, pytorch
Bereich
machine-learning, performance
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.