sgl-project/sglang · error · ValueError
rollout_sde_type must be one of {_VALID_ROLLOUT_SDE_TYPES},
Error message
rollout_sde_type must be one of {_VALID_ROLLOUT_SDE_TYPES}, got {self.rollout_sde_type!r} What it means
rollout_sde_type selects the SDE discretization/scheme used during RL rollouts and must be one of the entries in _VALID_ROLLOUT_SDE_TYPES. Any other string (or wrong case, or typo) is rejected at validation time.
Source
Thrown at python/sglang/multimodal_gen/configs/post_training/rl_rollout.py:37
"""Rollout (log-prob trajectory) options used by SamplingParams and APIs."""
rollout: bool = False
rollout_sde_type: str = "sde"
rollout_noise_level: float = 0.7
rollout_log_prob_no_const: bool = False
rollout_debug_mode: bool = False
def validate(self) -> None:
noise = self.rollout_noise_level
if isinstance(noise, bool) or not isinstance(noise, (int, float)):
raise ValueError(f"rollout_noise_level must be a number, got {noise!r}")
if not math.isfinite(float(noise)):
raise ValueError(f"rollout_noise_level must be finite, got {noise!r}")
if float(noise) < 0.0:
raise ValueError(f"rollout_noise_level must be non-negative, got {noise!r}")
if self.rollout_sde_type not in _VALID_ROLLOUT_SDE_TYPES:
raise ValueError(
f"rollout_sde_type must be one of {_VALID_ROLLOUT_SDE_TYPES}, "
f"got {self.rollout_sde_type!r}"
)
@classmethod
def validate_sampling_params(cls, params: Any) -> None:
"""Validate rollout fields on a duck-typed object (e.g. ``SamplingParams``).
Mirrors how ``ServerArgs`` runs ``NunchakuSVDQuantArgs.validate()`` from
``_adjust_quant_config`` instead of inlining checks in a large validator.
"""
cls(
rollout=params.rollout,
rollout_sde_type=params.rollout_sde_type,
rollout_noise_level=params.rollout_noise_level,
rollout_log_prob_no_const=params.rollout_log_prob_no_const,
rollout_debug_mode=params.rollout_debug_mode,
).validate()View on GitHub (pinned to 0132848349)
Solutions
- Check the allowed set in the error/config module (_VALID_ROLLOUT_SDE_TYPES) and use one of those exact strings
- Fix casing/typos, e.g. the canonical spellings listed in _VALID_ROLLOUT_SDE_TYPES
- After upgrading sglang, re-verify the valid SDE type list — names may have changed
Example fix
# before params.rollout_sde_type = "Euler" # wrong case # after from sglang.multimodal_gen.configs.post_training.rl_rollout import _VALID_ROLLOUT_SDE_TYPES params.rollout_sde_type = next(iter(_VALID_ROLLOUT_SDE_TYPES)) # or a valid literal
Defensive patterns
Strategy: validation
Validate before calling
from sglang.multimodal_gen.configs.post_training.rl_rollout import _VALID_ROLLOUT_SDE_TYPES
assert params.rollout_sde_type in _VALID_ROLLOUT_SDE_TYPES, f"valid: {_VALID_ROLLOUT_SDE_TYPES}" Type guard
def is_valid_sde_type(v, valid) -> bool:
return v in valid Prevention
- Import the valid set and validate configs against it, not hardcoded strings
- Re-check the valid set after sglang upgrades
- Use exact casing from the constants module
When it happens
Trigger: Passing an unrecognized string as rollout_sde_type (e.g. 'euler', 'Euler', 'DDIM' when not in the allowed set) in sampling params; raised from validate() via validate_sampling_params.
Common situations: Typos or wrong casing; copying a scheme name from a different library (diffusers/eulerancestral) into this config; version changes that rename or remove supported SDE types.
Related errors
- rollout_noise_level must be a number, got {noise!r}
- Invalid backend: {value}. Must be one of: {', '.join([m.valu
- Invalid attention backend '{backend}'. Available options are
- kv-canary: kv_canary must be one of none/log/raise, got {mod
- Unknown CacheAware Policy: {policy=}
AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28).
Data as JSON: /api/errors/ad93a97b95fc6609.
Report an issue: GitHub.