sgl-project/sglang · error · ValueError
Timesteps must be provided
Error message
Timesteps must be provided
What it means
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.
Source
Thrown at python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/hunyuan3d/shape.py:324
"""Prepare Hunyuan3D-specific variables for the base denoising loop."""
assert self.transformer is not None
pipeline = self.pipeline() if self.pipeline else None
scheduler = batch.scheduler
assert scheduler is not None
cache_dit_num_inference_steps = batch.extra.get(
"cache_dit_num_inference_steps", batch.num_inference_steps
)
freshly_loaded = load_transformer_if_needed(self, server_args)
if freshly_loaded:
self._maybe_enable_cache_dit(cache_dit_num_inference_steps, batch)
self._maybe_torch_compile(self.transformer)
register_loaded_transformer(self, server_args, pipeline)
else:
self._maybe_enable_cache_dit(cache_dit_num_inference_steps, batch)
timesteps = batch.timesteps
if timesteps is None:
raise ValueError("Timesteps must be provided")
latents = batch.latents
if latents is None:
raise ValueError("Latents must be provided")
cond = batch.prompt_embeds[0] if batch.prompt_embeds else None
if cond is None:
raise ValueError("Conditioning (prompt_embeds) must be provided")
if batch.raw_latent_shape is None:
batch.raw_latent_shape = latents.shape
guidance = batch.extra.get("shape_guidance")
num_inference_steps = batch.num_inference_steps
num_warmup_steps = len(timesteps) - num_inference_steps * scheduler.order
extra_step_kwargs = self.prepare_extra_func_kwargs(
scheduler.step,View on GitHub (pinned to 0132848349)
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
Example fix
# before batch = Req(latents=z, prompt_embeds=[c]) # no timesteps stage.forward(batch, server_args) # after batch.timesteps = scheduler.set_timesteps(num_inference_steps).timesteps stage.forward(batch, server_args)
Defensive patterns
Strategy: validation
Validate before calling
if batch.timesteps is None:
batch.timesteps = scheduler.set_timesteps(batch.num_inference_steps).timesteps Type guard
def has_timesteps(batch) -> bool:
return getattr(batch, "timesteps", None) is not None Prevention
- Use the official composed Hunyuan3D pipeline; don't invoke loop stages directly
- In tests, always run scheduler setup before the denoise stage
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Latents must be provided
- Conditioning (prompt_embeds) must be provided
- SANA-WM denoising requires prepared timesteps.
- {response.error}
- action policy returned no output
AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28).
Data as JSON: /api/errors/5676c0e0ebfa32ca.
Report an issue: GitHub.