You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The VAE keeps everything in fp32 no matter what dtype you pass, but the decode block wraps vae.decode in a fp16 autocast, so the decoder gets downcast to fp16 anyway on every call. On CUDA this just costs VRAM, RAM and disk space.
Decoding 192 frames at 1344x768:
weights
peak
main
9.70 GiB
16.69 GiB
decode in fp16
5.19 GiB
7.67 GiB
As seen on the table, this prevents to use this model on 16GB GPUs for that resolution and duration.
Reproduction
Just normal inference on a cuda GPU will reproduce it
importtorchfromdiffusersimportComponentsManager, ModularPipelinemanager=ComponentsManager()
manager.enable_auto_cpu_offload(device="cuda")
pipe=ModularPipeline.from_pretrained("MiniMaxAI/MiniMax-H3", components_manager=manager)
pipe.load_components(workflow="t2va", dtype=torch.bfloat16)
results=pipe(
prompt="An astronaut hiking through the mountains, humming a tune",
num_frames=192,
output=["videos", "audio", "sampling_rate"],
)
Describe the bug
The VAE keeps everything in fp32 no matter what dtype you pass, but the decode block wraps vae.decode in a fp16 autocast, so the decoder gets downcast to fp16 anyway on every call. On CUDA this just costs VRAM, RAM and disk space.
Decoding 192 frames at 1344x768:
As seen on the table, this prevents to use this model on 16GB GPUs for that resolution and duration.
Reproduction
Just normal inference on a cuda GPU will reproduce it
code to test a PoC fix:
main
decoded_fp32pin.mp4
PoC fix
decoded_fp16decoder.mp4
System Info
diffusers from main
any cuda platform
Who can help?