sgl-project/sglang · error · RuntimeError

exponential_shift enabled but exponential_shift_mu is missin

Error message

exponential_shift enabled but exponential_shift_mu is missing

What it means

Raised when exponential_shift is enabled for a pair column but no mu value is available (neither a global exponential_shift_mu nor a per-column mu_override). mu controls the exponential shift transform exp(mu)/(exp(mu) + (1/base - 1)). It is a RuntimeError because it signals incomplete scheduler configuration at runtime.

Source

Thrown at python/sglang/multimodal_gen/runtime/models/schedulers/flow_match_pair.py:414

                            device=device,
                            dtype=dtype,
                        )[:-1]
                    else:
                        base = torch.linspace(
                            sigma_start,
                            self.sigma_min,
                            num_steps,
                            device=device,
                            dtype=dtype,
                        )

                    if self.inverse_timesteps:
                        base = torch.flip(base, dims=[0])

                    if self.exponential_shift:
                        mu_value = mu_override
                        if mu_value is None:
                            raise RuntimeError(
                                "exponential_shift enabled but exponential_shift_mu is missing"
                            )
                        exp_mu = math.exp(float(mu_value))
                        base = exp_mu / (exp_mu + (1 / base - 1))
                    else:
                        base = shift_value * base / (1 + (shift_value - 1) * base)

                    if self.shift_terminal is not None:
                        one_minus_z = 1 - base
                        scale_factor = one_minus_z[-1] / (1 - self.shift_terminal)
                        if scale_factor != 0:
                            base = 1 - (one_minus_z / scale_factor)

                    if self.reverse_sigmas:
                        base = 1 - base

                    if source == "timesteps":
                        return base * self.num_train_timesteps

View on GitHub (pinned to 0132848349)

Solutions

  1. Pass mu explicitly: set_pair_postprocess_by_name(..., audio_mu=...) or set exponential_shift_mu on the scheduler/config
  2. Compute mu from image resolution like diffusers does (mu = log(1/shift) style) and pass it per call
  3. If exponential shifting is not intended, set exponential_shift=False

Example fix

# before
sched.set_pair_postprocess_by_name("dual_sigma_shift", ..., audio_shift=3.0)  # exponential_shift=True
# after
mu = math.log(1.0 / 3.0)  # or computed from resolution
sched.set_pair_postprocess_by_name("dual_sigma_shift", ..., audio_shift=3.0, audio_mu=mu)
Defensive patterns

Strategy: validation

Validate before calling

if sched.exponential_shift and getattr(sched, "exponential_shift_mu", None) is None and audio_mu is None:
    raise ValueError("audio_mu required when exponential_shift is on")

Try / catch

try:
    sched.set_pair_postprocess_by_name("dual_sigma_shift", ..., audio_mu=mu)
except RuntimeError as e:
    if "exponential_shift_mu" in str(e):
        mu = math.log(1.0 / shift)
        sched.set_pair_postprocess_by_name("dual_sigma_shift", ..., audio_mu=mu)
    else:
        raise

Prevention

When it happens

Trigger: Constructing the scheduler with exponential_shift=True but omitting exponential_shift_mu, and calling set_pair_postprocess_by_name('dual_sigma_shift') without passing an audio_mu/image_mu override.

Common situations: Porting a single-modality exponential-shift config to the paired scheduler and forgetting mu; mu living under a different config key (e.g. model_path calculates mu dynamically and it is not plumbed through).

Related errors


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