Skip to main content

Module vae3d

Module vae3d 

Source
Expand description

MiniMax-H3’s video VAE decoder: a ViT3D, not a conv stack.

36 transformer blocks over the latent grid, each latent cell one token, and a single linear that expands every token into a 4×16×16×3 block of pixels. The encoder half is a 3-D causal CNN and is not packed — text-to-video never runs it.

§Tiling is not an optimization here

The reference decodes in 256-pixel spatial tiles and 17-frame temporal clips ALWAYS — tiling=True is the constructor default and decode_tiled just forwards to decode. Because the decoder is global attention, a tile sees a different context than the whole frame would, so the tiling is part of the model’s output, not a memory strategy layered on top of it. Both schedules are reproduced exactly: split_tiles down to the last overlap unit, and the clip/token-drop bookkeeping that makes a chunk emit 17 frames and carry 5 over.

Structs§

VideoVae
VideoVaeEncoder
The encoder half: [3, h, w] in [-1, 1] → normalized latents [24, h/16, w/16].

Statics§

VAE3D_PROF
Where a VAE decode actually goes. The DiT had a profiler for months while this stage — the LARGER half of a render at low step counts, 37.8 s against the denoiser’s 19.2 — had none, so every hour of tuning went to the half that was already instrumented.

Functions§

vae3d_prof_report
One line per phase, sorted by cost.