{"record":{"id":"ef048b137c1f0ad9","repo":"sgl-project/sglang","slug":"expected-scheduler-sigmas-to-be-a-tensor-for-joyec","errorCode":null,"errorMessage":"Expected scheduler.sigmas to be a tensor for JoyEcho.","messagePattern":"Expected scheduler\\.sigmas to be a tensor for JoyEcho\\.","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":463,"sourceCode":"                \"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(\n            model_inputs, batch, ctx, server_args, step.current_model\n        )\n\n        prompt_attention_mask = self._get_ltx_prompt_attention_mask(","sourceCodeStart":445,"sourceCodeEnd":481,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/joy_echo/denoising.py#L445-L481","documentation":"The JoyEcho step indexes ctx.scheduler.sigmas and requires a torch.Tensor (it calls .to(device=..., dtype=...)). If the configured flow-matching scheduler stores sigmas as a numpy array or other type, the step raises rather than doing implicit conversion.","triggerScenarios":"Using a scheduler implementation whose .sigmas property returns a numpy ndarray or list instead of torch.Tensor, then running the JoyEcho denoising step.","commonSituations":"Swapping in a custom/third-party scheduler; a diffusers-style scheduler whose sigmas are numpy-based; library upgrade changing the sigmas representation.","solutions":["Pass a scheduler whose sigmas are a torch.Tensor (the default LTX/flow-matching scheduler)","Convert once during preparation: ctx.scheduler.sigmas = torch.as_tensor(sigmas, dtype=torch.float32)","Pin/align sglang and scheduler versions"],"exampleFix":"# before\nctx.scheduler.sigmas  # numpy array\n# after\nimport torch\nif not isinstance(ctx.scheduler.sigmas, torch.Tensor):\n    ctx.scheduler.sigmas = torch.as_tensor(\n        ctx.scheduler.sigmas, dtype=torch.float32\n    )","handlingStrategy":"type-guard","validationCode":"import torch\nsig = ctx.scheduler.sigmas\nif not isinstance(sig, torch.Tensor):\n    ctx.scheduler.sigmas = torch.as_tensor(sig, dtype=torch.float32)","typeGuard":"def sigmas_are_tensor(ctx) -> bool:\n    return isinstance(ctx.scheduler.sigmas, torch.Tensor)","tryCatchPattern":null,"preventionTips":["Use the bundled LTX/flow-matching scheduler","Add a post-prepare assertion on scheduler.sigmas type"],"tags":["joyecho","scheduler","sigmas","type-mismatch"],"backgroundTag":"scheduler-sigmas-type-mismatch","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}