huggingface / huggingface/diffusers
HunyuanVideo pipe.transformer.compile(): torch._dynamo hit config.recompile_limit (8)
- Lingua principale
- Python
- Stelle
- 34.5k
- Fork
- 7.3k
- Merge medio
- 3g 3h
- PR unite (30g)
- 91
Descrizione
### 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
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python, pytorch
- Ambito
- machine-learning, performance
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100