{"record":{"id":"1a77fa15c90aeedf","repo":"sgl-project/sglang","slug":"beta-schedule-is-not-implemented-for-self-cla","errorCode":null,"errorMessage":"{beta_schedule} 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":280,"sourceCode":"            self.betas = torch.linspace(\n                beta_start, beta_end, num_train_timesteps, dtype=torch.float32\n            )\n        elif beta_schedule == \"scaled_linear\":\n            # this schedule is very specific to the latent diffusion model.\n            self.betas = (\n                torch.linspace(\n                    beta_start**0.5,\n                    beta_end**0.5,\n                    num_train_timesteps,\n                    dtype=torch.float32,\n                )\n                ** 2\n            )\n        elif beta_schedule == \"squaredcos_cap_v2\":\n            # Glide cosine schedule\n            self.betas = betas_for_alpha_bar(num_train_timesteps)\n        else:\n            raise NotImplementedError(\n                f\"{beta_schedule} is not implemented for {self.__class__}\"\n            )\n\n        if rescale_betas_zero_snr:\n            self.betas = rescale_zero_terminal_snr(self.betas)\n\n        self.alphas = 1.0 - self.betas\n        self.alphas_cumprod = torch.cumprod(self.alphas, dim=0)\n\n        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)","sourceCodeStart":262,"sourceCodeEnd":298,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/models/schedulers/scheduling_unipc_multistep.py#L262-L298","documentation":"Raised in UniPCMultistepScheduler.__init__ when the beta_schedule config value is not one of the supported schedules ('linear', 'scaled_linear', 'squaredcos_cap_v2'). The scheduler maps the schedule name to a betas array; unknown names cannot be mapped, so construction fails.","triggerScenarios":"Instantiating UniPCMultistepScheduler(from_config(...)) or from_pretrained with config beta_schedule set to a typo or unsupported value like 'cosine' (instead of 'squaredcos_cap_v2') or 'linear_beta'.","commonSituations":"Hand-written scheduler configs copied from other libraries (e.g. 'cosine' used in k-diffusion/other schedulers), typos, or config JSONs migrated from a diffusers version with different schedule names.","solutions":["Set beta_schedule to 'scaled_linear' (the default) or 'linear' or 'squaredcos_cap_v2'","Check the saved scheduler_config.json of the model you are loading for the exact original value","If you need a cosine schedule, use 'squaredcos_cap_v2' which is the Glide cosine schedule"],"exampleFix":"// before\nsched = UniPCMultistepScheduler.from_config(cfg, beta_schedule=\"cosine\")\n// after\nsched = UniPCMultistepScheduler.from_config(cfg, beta_schedule=\"squaredcos_cap_v2\")","handlingStrategy":"validation","validationCode":"from sglang.multimodal_gen.runtime.models.schedulers.scheduling_unipc_multistep import UniPCMultistepScheduler\nallowed = {\"linear\", \"scaled_linear\", \"squaredcos_cap_v2\"}\nassert cfg[\"beta_schedule\"] in allowed, f\"beta_schedule must be one of {allowed}\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Whitelist-check scheduler config values before from_config","Prefer loading the model's original scheduler_config.json over hand-writing it"],"tags":["scheduler","diffusion","config-validation","unipc"],"backgroundTag":"invalid-config-value","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}