{"record":{"id":"e611a3e4237b7ec8","repo":"sgl-project/sglang","slug":"only-one-of-config-use-beta-sigmas-config-use","errorCode":null,"errorMessage":"Only one of `config.use_beta_sigmas`, `config.use_exponential_sigmas`, `config.use_karras_sigmas` can be used.","messagePattern":"Only one of `config\\.use_beta_sigmas`, `config\\.use_exponential_sigmas`, `config\\.use_karras_sigmas` can be used\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/models/schedulers/scheduling_flow_match_euler_discrete.py","lineNumber":130,"sourceCode":"        invert_sigmas: bool = False,\n        shift_terminal: float | None = None,\n        use_karras_sigmas: bool | None = False,\n        use_exponential_sigmas: bool | None = False,\n        use_beta_sigmas: bool | None = False,\n        time_shift_type: str = \"exponential\",\n        stochastic_sampling: bool = False,\n    ):\n        if (\n            sum(\n                [\n                    self.config.use_beta_sigmas,\n                    self.config.use_exponential_sigmas,\n                    self.config.use_karras_sigmas,\n                ]\n            )\n            > 1\n        ):\n            raise ValueError(\n                \"Only one of `config.use_beta_sigmas`, `config.use_exponential_sigmas`, `config.use_karras_sigmas` can be used.\"\n            )\n        if time_shift_type not in {\"exponential\", \"linear\"}:\n            raise ValueError(\n                \"`time_shift_type` must either be 'exponential' or 'linear'.\"\n            )\n\n        timesteps = np.linspace(\n            1, num_train_timesteps, num_train_timesteps, dtype=np.float32\n        )[::-1].copy()\n        timesteps = torch.from_numpy(timesteps).to(dtype=torch.float32)\n\n        sigmas = timesteps / num_train_timesteps\n        if not use_dynamic_shifting:\n            # when use_dynamic_shifting is True, we apply the timestep shifting on the fly based on the image resolution\n            sigmas = shift * sigmas / (1 + (shift - 1) * sigmas)\n\n        self.timesteps = sigmas * num_train_timesteps","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/models/schedulers/scheduling_flow_match_euler_discrete.py#L112-L148","documentation":"Constructor validation: the alternative sigma parameterizations (beta, exponential, Karras) are mutually exclusive; more than one of config.use_beta_sigmas / use_exponential_sigmas / use_karras_sigmas set to True raises at scheduler construction.","triggerScenarios":"Building FlowMatchEulerDiscreteScheduler with a scheduler config where two or more of the use_*_sigmas flags are true (e.g. both karras and exponential from a merged YAML).","commonSituations":"Merging config overrides or copying flags from different example configs; enabling Karras sigmas while a template already had exponential sigmas on.","solutions":["Set exactly one of the three flags to True (or none)","Check the scheduler_config.json / YAML of the model for duplicated flags","If combining schedules is desired, implement it via custom sigmas passed to set_timesteps instead"],"exampleFix":"# before\ncfg = {\"use_karras_sigmas\": True, \"use_exponential_sigmas\": True}\nsched = FlowMatchEulerDiscreteScheduler(**cfg)\n# after\ncfg = {\"use_karras_sigmas\": True}\nsched = FlowMatchEulerDiscreteScheduler(**cfg)","handlingStrategy":"validation","validationCode":"flags = [cfg.get(\"use_beta_sigmas\", False), cfg.get(\"use_exponential_sigmas\", False), cfg.get(\"use_karras_sigmas\", False)]\nassert sum(flags) <= 1, \"at most one use_*_sigmas flag\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate config merges before constructing schedulers","Keep one sigma-style flag per config source"],"tags":["scheduler","config","mutually-exclusive","diffusion"],"backgroundTag":"mutually-exclusive-config-flags","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}