{"record":{"id":"4d21bd8f0e97c81d","repo":"sgl-project/sglang","slug":"joyecho-audio-scheduler-was-not-prepared","errorCode":null,"errorMessage":"JoyEcho audio scheduler was not prepared.","messagePattern":"JoyEcho audio scheduler was not prepared\\.","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":459,"sourceCode":"                \"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\n        )\n        model_inputs, memory_meta = self._build_memory_model_inputs(","sourceCodeStart":441,"sourceCodeEnd":477,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/joy_echo/denoising.py#L441-L477","documentation":"JoyEcho denoises audio and video jointly, so the context must carry a prepared audio scheduler (ctx.audio_scheduler). Its absence means context preparation was incomplete — the scheduler is created alongside audio latents in the prepare phase, so None indicates a broken or partial setup path.","triggerScenarios":"Reaching _run_denoising_step with a LTX2DenoisingContext whose audio_scheduler is None — e.g. a custom path constructing the context manually or a prepare step that returned early after failing to build the audio scheduler.","commonSituations":"Custom pipeline code constructing DenoisingContext directly; a failed/early-exited prepare step whose exception was swallowed; version mismatch where scheduler setup moved to a new hook.","solutions":["Use the standard prepare path that builds both audio latents and the audio scheduler","Ensure audio config (steps, schedule) is valid so scheduler construction doesn't bail","Upgrade sglang so context preparation and the denoising step agree"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"assert ctx.audio_scheduler is not None, 'prepare step must build the audio scheduler'","typeGuard":"def joyecho_ready(ctx) -> bool:\n    return ctx.audio_latents is not None and ctx.audio_scheduler is not None","tryCatchPattern":null,"preventionTips":["Use the library's standard prepare path instead of constructing contexts manually","Fail fast after prepare if any audio component is missing"],"tags":["joyecho","audio","scheduler","initialization"],"backgroundTag":"incomplete-context-initialization","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}