exp3: video VAE bf16 decode
Browse files
app.py
CHANGED
|
@@ -203,6 +203,12 @@ def load_models() -> str | None:
|
|
| 203 |
else:
|
| 204 |
pipe.transformer.set_attention_backend(ATTENTION)
|
| 205 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 206 |
_install_forward_timing(pipe)
|
| 207 |
|
| 208 |
if PLACEMENT == "offload":
|
|
|
|
| 203 |
else:
|
| 204 |
pipe.transformer.set_attention_backend(ATTENTION)
|
| 205 |
|
| 206 |
+
# The video VAE ships fp32 (`_keep_in_fp32_modules` over every module); decode it in bf16 instead —
|
| 207 |
+
# half the decode FLOPs and traffic on Blackwell. The audio VAE keeps its fp32 modules: a bf16
|
| 208 |
+
# audio VAE decodes the soundtrack roughly 20 dB too quiet (see the module docstring).
|
| 209 |
+
pipe.vae.to(torch.bfloat16)
|
| 210 |
+
print(f"[gen] video VAE cast to {next(pipe.vae.parameters()).dtype}", flush=True)
|
| 211 |
+
|
| 212 |
_install_forward_timing(pipe)
|
| 213 |
|
| 214 |
if PLACEMENT == "offload":
|