huggingface / huggingface/diffusers
HunyuanVideo pipe.transformer.compile(): torch._dynamo hit config.recompile_limit (8)
- Dominant language
- Python
- Stars
- 34.5k
- Forks
- 7.3k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 91
Description
### 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
Contributor guide
Assessment
This issue has not been assessed yet.