sgl-project/sglang · error · ValueError
Either num_inference_steps, sigmas, or timesteps must be…
Error message
Either num_inference_steps, sigmas, or timesteps must be provided
What it means
Raised by the flow-match Euler scheduler's set_timesteps when none of num_inference_steps, sigmas, or timesteps is provided, leaving no way to build a schedule. Pass num_inference_steps (and optionally sigmas/timesteps).
Solutions
- Pass num_inference_steps explicitly: scheduler.set_timesteps(50)
- Or pass a sigmas/timesteps list from which the count is inferred
- Audit refactor leftovers where the steps variable became None
Example fix
# before scheduler.set_timesteps() # after scheduler.set_timesteps(num_inference_steps=50)
Defensive patterns
Strategy: validation
Validate before calling
assert num_inference_steps is not None or sigmas is not None or timesteps is not None, "provide steps or a schedule"
Prevention
- Pass num_inference_steps explicitly
- Guard against None step counts after refactors
When it happens
Trigger: Calling scheduler.set_timesteps() with no arguments (relying on a previously stored default that does not exist in this implementation).
Common situations: Porting code from schedulers that default num_inference_steps=50; refactors that moved the step count into a variable that evaluates to None.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- denoising_strength must be positive
- --disagg-server-addr is required for --disagg-role
- items must be provided
- kv-canary: launch_canary_plan_kernels_torch_reference…
- kv-canary: max_prefill_tokens must be positive, got
AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28).
Data as JSON: /api/errors/8aa396e9e3d2e1fb.
Report an issue: GitHub.
Appendix: source
Thrown at python/sglang/multimodal_gen/runtime/models/schedulers/scheduling_flow_match_euler_discrete.py:326
and timesteps is not None
and len(sigmas) != len(timesteps)
):
raise ValueError("`sigmas` and `timesteps` should have the same length")
if num_inference_steps is not None:
if (sigmas is not None and len(sigmas) != num_inference_steps) or (
timesteps is not None and len(timesteps) != num_inference_steps
):
raise ValueError(
"`sigmas` and `timesteps` should have the same length as num_inference_steps, if `num_inference_steps` is provided"
)
else:
if sigmas is not None:
num_inference_steps = len(sigmas)
elif timesteps is not None:
num_inference_steps = len(timesteps)
else:
raise ValueError(
"Either num_inference_steps, sigmas, or timesteps must be provided"
)
self.num_inference_steps = num_inference_steps
# 1. Prepare default sigmas
is_timesteps_provided = timesteps is not None
timesteps_array: np.ndarray | None = None
if is_timesteps_provided:
assert timesteps is not None
timesteps_array = np.array(timesteps).astype(np.float32)
sigmas_array: np.ndarray
if sigmas is None:
if timesteps_array is None:
timesteps_array = np.linspace(
self._sigma_to_t(self.sigma_max),View on GitHub (pinned to 0132848349)