sgl-project/sglang · error · ValueError

Only one of `config.use_beta_sigmas`, `config.use_exponentia

Error message

Only one of `config.use_beta_sigmas`, `config.use_exponential_sigmas`, `config.use_karras_sigmas` can be used.

What it means

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.

Source

Thrown at python/sglang/multimodal_gen/runtime/models/schedulers/scheduling_flow_match_euler_discrete.py:130

        invert_sigmas: bool = False,
        shift_terminal: float | None = None,
        use_karras_sigmas: bool | None = False,
        use_exponential_sigmas: bool | None = False,
        use_beta_sigmas: bool | None = False,
        time_shift_type: str = "exponential",
        stochastic_sampling: bool = False,
    ):
        if (
            sum(
                [
                    self.config.use_beta_sigmas,
                    self.config.use_exponential_sigmas,
                    self.config.use_karras_sigmas,
                ]
            )
            > 1
        ):
            raise ValueError(
                "Only one of `config.use_beta_sigmas`, `config.use_exponential_sigmas`, `config.use_karras_sigmas` can be used."
            )
        if time_shift_type not in {"exponential", "linear"}:
            raise ValueError(
                "`time_shift_type` must either be 'exponential' or 'linear'."
            )

        timesteps = np.linspace(
            1, num_train_timesteps, num_train_timesteps, dtype=np.float32
        )[::-1].copy()
        timesteps = torch.from_numpy(timesteps).to(dtype=torch.float32)

        sigmas = timesteps / num_train_timesteps
        if not use_dynamic_shifting:
            # when use_dynamic_shifting is True, we apply the timestep shifting on the fly based on the image resolution
            sigmas = shift * sigmas / (1 + (shift - 1) * sigmas)

        self.timesteps = sigmas * num_train_timesteps

View on GitHub (pinned to 0132848349)

Solutions

  1. Set exactly one of the three flags to True (or none)
  2. Check the scheduler_config.json / YAML of the model for duplicated flags
  3. If combining schedules is desired, implement it via custom sigmas passed to set_timesteps instead

Example fix

# before
cfg = {"use_karras_sigmas": True, "use_exponential_sigmas": True}
sched = FlowMatchEulerDiscreteScheduler(**cfg)
# after
cfg = {"use_karras_sigmas": True}
sched = FlowMatchEulerDiscreteScheduler(**cfg)
Defensive patterns

Strategy: validation

Validate before calling

flags = [cfg.get("use_beta_sigmas", False), cfg.get("use_exponential_sigmas", False), cfg.get("use_karras_sigmas", False)]
assert sum(flags) <= 1, "at most one use_*_sigmas flag"

Prevention

When it happens

Trigger: 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).

Common situations: Merging config overrides or copying flags from different example configs; enabling Karras sigmas while a template already had exponential sigmas on.

Related errors


AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28). Data as JSON: /api/errors/e611a3e4237b7ec8. Report an issue: GitHub.