{"record":{"id":"5676c0e0ebfa32ca","repo":"sgl-project/sglang","slug":"timesteps-must-be-provided-5676c0","errorCode":null,"errorMessage":"Timesteps must be provided","messagePattern":"Timesteps must be provided","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/hunyuan3d/shape.py","lineNumber":324,"sourceCode":"        \"\"\"Prepare Hunyuan3D-specific variables for the base denoising loop.\"\"\"\n        assert self.transformer is not None\n        pipeline = self.pipeline() if self.pipeline else None\n        scheduler = batch.scheduler\n        assert scheduler is not None\n        cache_dit_num_inference_steps = batch.extra.get(\n            \"cache_dit_num_inference_steps\", batch.num_inference_steps\n        )\n        freshly_loaded = load_transformer_if_needed(self, server_args)\n        if freshly_loaded:\n            self._maybe_enable_cache_dit(cache_dit_num_inference_steps, batch)\n            self._maybe_torch_compile(self.transformer)\n            register_loaded_transformer(self, server_args, pipeline)\n        else:\n            self._maybe_enable_cache_dit(cache_dit_num_inference_steps, batch)\n\n        timesteps = batch.timesteps\n        if timesteps is None:\n            raise ValueError(\"Timesteps must be provided\")\n\n        latents = batch.latents\n        if latents is None:\n            raise ValueError(\"Latents must be provided\")\n\n        cond = batch.prompt_embeds[0] if batch.prompt_embeds else None\n        if cond is None:\n            raise ValueError(\"Conditioning (prompt_embeds) must be provided\")\n\n        if batch.raw_latent_shape is None:\n            batch.raw_latent_shape = latents.shape\n\n        guidance = batch.extra.get(\"shape_guidance\")\n        num_inference_steps = batch.num_inference_steps\n        num_warmup_steps = len(timesteps) - num_inference_steps * scheduler.order\n\n        extra_step_kwargs = self.prepare_extra_func_kwargs(\n            scheduler.step,","sourceCodeStart":306,"sourceCodeEnd":342,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/hunyuan3d/shape.py#L306-L342","documentation":"The Hunyuan3D denoising loop stage expects timesteps to have been computed by an earlier scheduler-setup stage and carried on the batch object. If batch.timesteps is None the loop cannot run because the diffusion schedule is undefined. This indicates a broken or skipped pipeline stage ordering rather than a user-facing parameter mistake.","triggerScenarios":"Running the shape denoising stage without its preceding scheduler/timestep-computation stage, or when that upstream stage failed silently / was disabled in the pipeline composition. Also when constructing the batch manually for tests and forgetting timesteps.","commonSituations":"Custom or reordered pipelines that omit the scheduler stage; warmup or test harnesses building Req objects by hand; a refactor that renamed the field carrying timesteps; upstream stage crashed before populating the batch.","solutions":["Ensure the pipeline includes and executes the scheduler/timestep-setup stage before the Hunyuan3D denoising stage","Inspect pipeline composition/logs to confirm the upstream stage ran and attached timesteps to the batch","When constructing batches manually (tests), populate batch.timesteps from the configured scheduler"],"exampleFix":"# before\nbatch = Req(latents=z, prompt_embeds=[c])  # no timesteps\nstage.forward(batch, server_args)\n\n# after\nbatch.timesteps = scheduler.set_timesteps(num_inference_steps).timesteps\nstage.forward(batch, server_args)","handlingStrategy":"validation","validationCode":"if batch.timesteps is None:\n    batch.timesteps = scheduler.set_timesteps(batch.num_inference_steps).timesteps","typeGuard":"def has_timesteps(batch) -> bool:\n    return getattr(batch, \"timesteps\", None) is not None","tryCatchPattern":null,"preventionTips":["Use the official composed Hunyuan3D pipeline; don't invoke loop stages directly","In tests, always run scheduler setup before the denoise stage"],"tags":["hunyuan3d","pipeline-order","missing-state","scheduler"],"backgroundTag":"pipeline-stage-ordering-error","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}