{"record":{"id":"4b195404fb2500e0","repo":"sgl-project/sglang","slug":"video-vae-became-unavailable-during-decode","errorCode":null,"errorMessage":"video_vae became unavailable during decode","messagePattern":"video_vae became unavailable during decode","errorType":"error_code","errorClass":"RuntimeError","httpStatus":null,"severity":"critical","filePath":"python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/stages/decoding.py","lineNumber":376,"sourceCode":"    def forward(self, batch: Req, server_args: ServerArgs) -> OutputBatch:\n        _minimax_h3_decoder_task(batch)\n        visual_latent = _required_tensor(batch.latents, \"batch.latents\")\n        audio_latent = _required_tensor(batch.audio_latents, \"batch.audio_latents\")\n        if visual_latent.ndim != 5:\n            raise ValueError(\"batch.latents must be [B, C, T, H, W]\")\n        if audio_latent.ndim != 3:\n            raise ValueError(\n                \"batch.audio_latents must be [audio_channel, latent_dim, T]\"\n            )\n\n        if self.video_vae is None:\n            raise RuntimeError(\"MiniMax H3 tasks require the video_vae output decoder\")\n        with self.use_declared_component(\n            component_name=\"video_vae\",\n            module=self.video_vae,\n        ) as selected_video_vae:\n            if selected_video_vae is None:\n                raise RuntimeError(\"video_vae became unavailable during decode\")\n            self.video_vae = selected_video_vae\n            if selected_video_vae.training:\n                selected_video_vae.eval()\n            visual_arch_config = server_args.pipeline_config.vae_config.arch_config\n            visual_decode_latent = _reverse_normalize_latents(\n                visual_latent,\n                mean_values=visual_arch_config.latents_mean,\n                std_values=visual_arch_config.latents_std,\n                name=\"video_vae\",\n            )\n            video_vae_dtype = resolve_decode_precision(server_args, \"video_vae\")\n            visual_autocast_enabled = autocast_enabled_for_device(\n                visual_latent, video_vae_dtype, server_args.disable_autocast\n            )\n            if visual_autocast_enabled:\n                selected_video_vae.prepare_decoder_autocast_weights(video_vae_dtype)\n            with autocast_context(\n                video_vae_dtype,","sourceCodeStart":358,"sourceCodeEnd":394,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/stages/decoding.py#L358-L394","documentation":"Inside the use_declared_component('video_vae') context the selected module must not be None; if component resolution yields None mid-decode (component released/unregistered concurrently) this RuntimeError fires.","triggerScenarios":"The declared video_vae component being unset or garbage-collected/released by another thread while decode is in flight.","commonSituations":"Concurrent pipeline teardown or component hot-swap during generation; a bug where the component registry entry for video_vae was deleted before decoding finished.","solutions":["Keep the video_vae component registered/alive for the lifetime of the decode call","Avoid tearing down or mutating the component registry concurrently with inference","File/inspect a race where the component lease is released early"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"assert stage.video_vae is not None  # and keep module referenced for the call duration","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Don't unregister/release components concurrently with inference","Hold a reference to the module across the decode call"],"tags":["minimax-h3","vae","race-condition","component-registry"],"backgroundTag":"runtime-resource-unavailable","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}