sgl-project/sglang · error · ValueError
prediction_type given as {self.config.prediction_type} must
Error message
prediction_type given as {self.config.prediction_type} must be one of `epsilon`, `sample`, or `v_prediction` for the UniPCMultistepScheduler. What it means
In convert_model_output (epsilon-prediction branch, predict_x0=False), prediction_type must be 'epsilon', 'sample', or 'v_prediction'. Note 'flow_prediction' is NOT valid here because epsilon conversion for flow models is undefined; the message intentionally omits it.
Source
Thrown at python/sglang/multimodal_gen/runtime/models/schedulers/scheduling_unipc_multistep.py:775
f"prediction_type given as {self.config.prediction_type} must be one of `epsilon`, `sample`, "
"`v_prediction`, or `flow_prediction` for the UniPCMultistepScheduler."
)
if self.config.thresholding:
x0_pred = self._threshold_sample(x0_pred)
return x0_pred
else:
if self.config.prediction_type == "epsilon":
return model_output
elif self.config.prediction_type == "sample":
epsilon = (sample - alpha_t * model_output) / sigma_t
return epsilon
elif self.config.prediction_type == "v_prediction":
epsilon = alpha_t * model_output + sigma_t * sample
return epsilon
else:
raise ValueError(
f"prediction_type given as {self.config.prediction_type} must be one of `epsilon`, `sample`, or"
" `v_prediction` for the UniPCMultistepScheduler."
)
def multistep_uni_p_bh_update(
self,
model_output: torch.Tensor,
*args,
sample: torch.Tensor = None,
order: int = None,
**kwargs,
) -> torch.Tensor:
"""
One step for the UniP (B(h) version). Alternatively, `self.solver_p` is used if is specified.
Args:
model_output (`torch.Tensor`):
The direct output from the learned diffusion model at the current timestep.View on GitHub (pinned to 0132848349)
Solutions
- If using a flow-matching model, keep predict_x0=True (default) with prediction_type='flow_prediction'
- Otherwise set prediction_type to 'epsilon','sample', or 'v_prediction'
- Verify both predict_x0 and prediction_type in the config together
Example fix
// before UniPCMultistepScheduler.from_config(cfg, prediction_type="flow_prediction", predict_x0=False) // after UniPCMultistepScheduler.from_config(cfg, prediction_type="flow_prediction") # predict_x0 defaults True
Defensive patterns
Strategy: validation
Validate before calling
assert cfg["prediction_type"] in {"epsilon", "sample", "v_prediction"} Prevention
- Check predict_x0 and prediction_type together as a pair
- Do not set flow_prediction with predict_x0=False
When it happens
Trigger: Scheduler with predict_x0=False and prediction_type='flow_prediction' or any other invalid string, then calling step().
Common situations: Using a flow model scheduler config while predict_x0 got flipped to False, or the same typos as the x0 branch.
Related errors
- prediction_type given as {self.config.prediction_type} must
- {beta_schedule} is not implemented for {self.__class__}
- {solver_type} is not implemented for {self.__class__}
- {self.config.timestep_spacing} is not supported. Please make
- `final_sigmas_type` must be one of 'zero', or 'sigma_min', b
AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28).
Data as JSON: /api/errors/33539d4f2021d5d5.
Report an issue: GitHub.