{"record":{"id":"33539d4f2021d5d5","repo":"sgl-project/sglang","slug":"prediction-type-given-as-self-config-prediction-t-33539d","errorCode":null,"errorMessage":"prediction_type given as {self.config.prediction_type} must be one of `epsilon`, `sample`, or `v_prediction` for the UniPCMultistepScheduler.","messagePattern":"prediction_type given as (.+?) must be one of `epsilon`, `sample`, or `v_prediction` for the UniPCMultistepScheduler\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/models/schedulers/scheduling_unipc_multistep.py","lineNumber":775,"sourceCode":"                    f\"prediction_type given as {self.config.prediction_type} must be one of `epsilon`, `sample`, \"\n                    \"`v_prediction`, or `flow_prediction` for the UniPCMultistepScheduler.\"\n                )\n\n            if self.config.thresholding:\n                x0_pred = self._threshold_sample(x0_pred)\n\n            return x0_pred\n        else:\n            if self.config.prediction_type == \"epsilon\":\n                return model_output\n            elif self.config.prediction_type == \"sample\":\n                epsilon = (sample - alpha_t * model_output) / sigma_t\n                return epsilon\n            elif self.config.prediction_type == \"v_prediction\":\n                epsilon = alpha_t * model_output + sigma_t * sample\n                return epsilon\n            else:\n                raise ValueError(\n                    f\"prediction_type given as {self.config.prediction_type} must be one of `epsilon`, `sample`, or\"\n                    \" `v_prediction` for the UniPCMultistepScheduler.\"\n                )\n\n    def multistep_uni_p_bh_update(\n        self,\n        model_output: torch.Tensor,\n        *args,\n        sample: torch.Tensor = None,\n        order: int = None,\n        **kwargs,\n    ) -> torch.Tensor:\n        \"\"\"\n        One step for the UniP (B(h) version). Alternatively, `self.solver_p` is used if is specified.\n\n        Args:\n            model_output (`torch.Tensor`):\n                The direct output from the learned diffusion model at the current timestep.","sourceCodeStart":757,"sourceCodeEnd":793,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/models/schedulers/scheduling_unipc_multistep.py#L757-L793","documentation":"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.","triggerScenarios":"Scheduler with predict_x0=False and prediction_type='flow_prediction' or any other invalid string, then calling step().","commonSituations":"Using a flow model scheduler config while predict_x0 got flipped to False, or the same typos as the x0 branch.","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"],"exampleFix":"// before\nUniPCMultistepScheduler.from_config(cfg, prediction_type=\"flow_prediction\", predict_x0=False)\n// after\nUniPCMultistepScheduler.from_config(cfg, prediction_type=\"flow_prediction\")  # predict_x0 defaults True","handlingStrategy":"validation","validationCode":"assert cfg[\"prediction_type\"] in {\"epsilon\", \"sample\", \"v_prediction\"}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check predict_x0 and prediction_type together as a pair","Do not set flow_prediction with predict_x0=False"],"tags":["scheduler","diffusion","prediction-type","unipc"],"backgroundTag":"unsupported-parameter-value","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}