{"record":{"id":"5807ab9d96130eb5","repo":"sgl-project/sglang","slug":"joyecho-requires-audio-latents-for-denoising","errorCode":null,"errorMessage":"JoyEcho requires audio latents for denoising.","messagePattern":"JoyEcho requires audio latents for denoising\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/joy_echo/denoising.py","lineNumber":457,"sourceCode":"            ),\n            {\n                \"memory_video_len\": memory_video_len,\n                \"memory_audio_len\": memory_audio_len,\n                \"late_layer_ratio\": late_layer_ratio,\n                \"audio_replicated_for_sp\": sp_on,\n                \"video_memory_prefix_len\": memory_video_len if sp_on else 0,\n            },\n        )\n\n    def _run_denoising_step(\n        self,\n        ctx: LTX2DenoisingContext,\n        step: DenoisingStepState,\n        batch: Req,\n        server_args: ServerArgs,\n    ) -> None:\n        if ctx.audio_latents is None:\n            raise ValueError(\"JoyEcho requires audio latents for denoising.\")\n        if ctx.audio_scheduler is None:\n            raise ValueError(\"JoyEcho audio scheduler was not prepared.\")\n\n        sigmas = ctx.scheduler.sigmas\n        if not isinstance(sigmas, torch.Tensor):\n            raise ValueError(\"Expected scheduler.sigmas to be a tensor for JoyEcho.\")\n\n        sigma = sigmas[step.step_index].to(\n            device=ctx.latents.device, dtype=torch.float32\n        )\n        sigma_next = sigmas[step.step_index + 1].to(\n            device=ctx.latents.device, dtype=torch.float32\n        )\n        sigma_val = float(sigma.item())\n        sigma_next_val = float(sigma_next.item())\n\n        model_inputs = self._prepare_ltx2_model_inputs(\n            ctx, step, batch, server_args, sigma","sourceCodeStart":439,"sourceCodeEnd":475,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/joy_echo/denoising.py#L439-L475","documentation":"JoyEcho is an audio-conditioned video model; its denoising step requires ctx.audio_latents to be present. If the context was prepared without audio latents (no audio supplied, or the audio encode stage skipped), the step refuses to run rather than silently generating without conditioning.","triggerScenarios":"Invoking the JoyEcho denoising step when the DenoisingContext was built with audio_latents=None — typically because the request had no audio track or the audio encoder produced no latents.","commonSituations":"Sending video-only requests to a JoyEcho pipeline; an upstream audio encoder failing silently; misconfigured pipeline omitting the audio encode stage.","solutions":["Attach an audio track / TTS output to the request so audio latents are encoded","Verify the audio encoding stage ran and populated ctx.audio_latents before denoising","Use a non-JoyEcho (video-only) pipeline if no audio conditioning is intended"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if ctx.audio_latents is None:\n    raise ValueError('Request needs audio for JoyEcho')  # fail early, before loop start","typeGuard":"def joyecho_ready(ctx) -> bool:\n    return ctx.audio_latents is not None and ctx.audio_scheduler is not None","tryCatchPattern":null,"preventionTips":["Require an audio track in request validation for JoyEcho pipelines","Check ctx.audio_latents right after context preparation"],"tags":["joyecho","audio","missing-latents","denoising"],"backgroundTag":"missing-required-latents","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}