{"record":{"id":"1e1dac4b65a6aaca","repo":"sgl-project/sglang","slug":"solver-type-is-not-implemented-for-self-class-1e1dac","errorCode":null,"errorMessage":"{solver_type} is not implemented for {self.__class__}","messagePattern":"(.+?) is not implemented for (.+?)","errorType":"validation","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/models/schedulers/scheduling_unipc_multistep.py","lineNumber":308,"sourceCode":"        if rescale_betas_zero_snr:\n            # Close to 0 without being 0 so first sigma is not inf\n            # FP16 smallest positive subnormal works well here\n            self.alphas_cumprod[-1] = 2**-24\n\n        # Currently we only support VP-type noise schedule\n        self.alpha_t = torch.sqrt(self.alphas_cumprod)\n        self.sigma_t = torch.sqrt(1 - self.alphas_cumprod)\n        self.lambda_t = torch.log(self.alpha_t) - torch.log(self.sigma_t)\n        self.sigmas = ((1 - self.alphas_cumprod) / self.alphas_cumprod) ** 0.5\n\n        # standard deviation of the initial noise distribution\n        self.init_noise_sigma = 1.0\n\n        if solver_type not in [\"bh1\", \"bh2\"]:\n            if solver_type in [\"midpoint\", \"heun\", \"logrho\"]:\n                self.register_to_config(solver_type=\"bh2\")\n            else:\n                raise NotImplementedError(\n                    f\"{solver_type} is not implemented for {self.__class__}\"\n                )\n\n        self.predict_x0 = predict_x0\n        # setable values\n        self.num_inference_steps = None\n        timesteps = np.linspace(\n            0, num_train_timesteps - 1, num_train_timesteps, dtype=np.float32\n        )[::-1].copy()\n        self.timesteps = torch.from_numpy(timesteps)\n        self.num_train_timesteps = num_train_timesteps\n        self.model_outputs = [None] * solver_order\n        self.timestep_list = [None] * solver_order\n        self.lower_order_nums = 0\n        self.disable_corrector = disable_corrector\n        self.solver_p = solver_p\n        self.last_sample = None\n        self._step_index = None","sourceCodeStart":290,"sourceCodeEnd":326,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/models/schedulers/scheduling_unipc_multistep.py#L290-L326","documentation":"Raised in UniPCMultistepScheduler.__init__ when solver_type is not 'bh1' or 'bh2' and not one of the legacy aliases ('midpoint', 'heun', 'logrho') which are auto-remapped to 'bh2'. Only the B(h) formulations bh1 (B_h = h) and bh2 (B_h = expm1(h)) are implemented for the UniPC solver.","triggerScenarios":"Creating the scheduler with solver_type='euler', 'rk4', or any string other than bh1/bh2/midpoint/heun/logrho.","commonSituations":"Users copying solver_type from other schedulers (e.g. DPMSolverSDESque terms) or assuming arbitrary solver names are supported; stale config files referencing removed solver names.","solutions":["Use solver_type='bh1' or 'bh2' (bh2 is the default and more accurate)","If you passed 'midpoint', 'heun', or 'logrho' you should not see this — otherwise rename to 'bh2'","Inspect the model's scheduler config JSON and correct the stored solver_type"],"exampleFix":"// before\nUniPCMultistepScheduler.from_config(cfg, solver_type=\"heun_midpoint\")\n// after\nUniPCMultistepScheduler.from_config(cfg, solver_type=\"bh2\")","handlingStrategy":"validation","validationCode":"assert cfg.get(\"solver_type\", \"bh2\") in {\"bh1\", \"bh2\", \"midpoint\", \"heun\", \"logrho\"}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use only bh1/bh2 for solver_type","Treat legacy names midpoint/heun/logrho as aliases auto-mapped to bh2"],"tags":["scheduler","diffusion","solver","unipc"],"backgroundTag":"unsupported-parameter-value","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}