sgl-project/sglang · error · ValueError
Invalid VAE type: {self.vae_type}
Error message
Invalid VAE type: {self.vae_type} What it means
mova_audio_dit's frequency precomputation only supports vae_type == "dac"; any other value raises. The RoPE freqs depend on the audio VAE layout, so unsupported VAEs are rejected explicitly.
Source
Thrown at python/sglang/multimodal_gen/runtime/models/dits/mova_audio_dit.py:193
self.previous_e0_even = None
self.previous_e0_odd = None
self.previous_residual_even = None
self.previous_residual_odd = None
self.is_even = False
self.should_calc_even = True
self.should_calc_odd = True
self.accumulated_rel_l1_distance_even = 0
self.accumulated_rel_l1_distance_odd = 0
self.__post_init__()
def _init_freqs(self):
if self.freqs is not None:
return
head_dim = self.dim // self.num_heads
if self.vae_type == "dac":
self.freqs = precompute_freqs_cis_1d(head_dim)
else:
raise ValueError(f"Invalid VAE type: {self.vae_type}")
def patchify(
self,
x: torch.Tensor,
control_camera_latents_input: Optional[torch.Tensor] = None,
):
x = self.patch_embedding(x)
grid_size = x.shape[2:]
x = rearrange(x, "b c f -> b f c").contiguous()
return x, grid_size # x, grid_size: (f)
def unpatchify(self, x: torch.Tensor, grid_size: tuple[int]):
return rearrange(
x, "b f (p c) -> b c (f p)", f=grid_size[0], p=self.patch_size[0]
)
def forward(
self,View on GitHub (pinned to 0132848349)
Solutions
- Set vae_type to "dac" in the audio DiT config (only supported audio VAE)
- Check that the audio model config is not accidentally reusing the video model's vae_type
- Update the library if you need a different audio VAE — it is unimplemented
Example fix
# before audio_cfg = dict(vae_type="mova") # after audio_cfg = dict(vae_type="dac")
Defensive patterns
Strategy: validation
Validate before calling
assert audio_cfg["vae_type"] == "dac", audio_cfg["vae_type"]
Type guard
def is_supported_audio_vae(cfg) -> bool:
return cfg.get("vae_type") == "dac" Prevention
- Keep audio and video model configs separate
- Test vae_type early at config load, not lazily at first forward
When it happens
Trigger: Instantiating the audio DiT with a config whose vae_type is not "dac" (e.g. a video VAE type string leaking into the audio model config).
Common situations: Sharing one config object between video and audio model construction; typo'd vae_type; new audio codec support not implemented.
Related errors
AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28).
Data as JSON: /api/errors/2056bb2289dcc1c1.
Report an issue: GitHub.