{"record":{"id":"d11327e044e9388f","repo":"sgl-project/sglang","slug":"missing-this-sample-as-a-required-keyword-argume-d11327","errorCode":null,"errorMessage":"missing `this_sample` as a required keyword argument","messagePattern":"missing `this_sample` as a required keyword argument","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/models/schedulers/scheduling_unipc_multistep.py","lineNumber":950,"sourceCode":"                The generated sample after the last predictor `x_{t}`.\n            order (`int`):\n                The `p` of UniC-p at this step. The effective order of accuracy should be `order + 1`.\n\n        Returns:\n            `torch.Tensor`:\n                The corrected sample tensor at the current timestep.\n        \"\"\"\n        this_timestep = args[0] if len(args) > 0 else kwargs.pop(\"this_timestep\", None)\n        if last_sample is None:\n            if len(args) > 1:\n                last_sample = args[1]\n            else:\n                raise ValueError(\"missing `last_sample` as a required keyword argument\")\n        if this_sample is None:\n            if len(args) > 2:\n                this_sample = args[2]\n            else:\n                raise ValueError(\"missing `this_sample` as a required keyword argument\")\n        if order is None:\n            if len(args) > 3:\n                order = args[3]\n            else:\n                raise ValueError(\"missing `order` as a required keyword argument\")\n        if this_timestep is not None:\n            deprecate(\n                \"this_timestep\",\n                \"1.0.0\",\n                \"Passing `this_timestep` is deprecated and has no effect as model output conversion is now handled via an internal counter `self.step_index`\",\n            )\n\n        model_output_list = self.model_outputs\n\n        m0 = model_output_list[-1]\n        x = last_sample\n        x_t = this_sample\n        model_t = this_model_output","sourceCodeStart":932,"sourceCodeEnd":968,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/models/schedulers/scheduling_unipc_multistep.py#L932-L968","documentation":"multistep_uni_c_bh_update also requires `this_sample` (the current-step sample) as the third positional arg or keyword; without it the corrector update cannot be computed.","triggerScenarios":"Calling multistep_uni_c_bh_update(model_output, last_sample) with this_sample omitted.","commonSituations":"Partial port of an old two-argument call signature when the corrector historically had fewer parameters.","solutions":["Use scheduler.step() instead","Pass this_sample as the third positional argument or keyword"],"exampleFix":"// before\nsched.multistep_uni_c_bh_update(model_output, last_sample)\n// after\nsched.multistep_uni_c_bh_update(model_output, last_sample, this_sample, order)","handlingStrategy":"validation","validationCode":"assert this_sample is not None","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pass (model_output, last_sample, this_sample, order) positionally when using the corrector directly"],"tags":["scheduler","diffusion","api-misuse","unipc"],"backgroundTag":"missing-required-argument","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}