{"record":{"id":"ad93a97b95fc6609","repo":"sgl-project/sglang","slug":"rollout-sde-type-must-be-one-of-valid-rollout-sd","errorCode":null,"errorMessage":"rollout_sde_type must be one of {_VALID_ROLLOUT_SDE_TYPES}, got {self.rollout_sde_type!r}","messagePattern":"rollout_sde_type must be one of (.+?), got (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/configs/post_training/rl_rollout.py","lineNumber":37,"sourceCode":"    \"\"\"Rollout (log-prob trajectory) options used by SamplingParams and APIs.\"\"\"\n\n    rollout: bool = False\n    rollout_sde_type: str = \"sde\"\n    rollout_noise_level: float = 0.7\n    rollout_log_prob_no_const: bool = False\n    rollout_debug_mode: bool = False\n\n    def validate(self) -> None:\n        noise = self.rollout_noise_level\n        if isinstance(noise, bool) or not isinstance(noise, (int, float)):\n            raise ValueError(f\"rollout_noise_level must be a number, got {noise!r}\")\n        if not math.isfinite(float(noise)):\n            raise ValueError(f\"rollout_noise_level must be finite, got {noise!r}\")\n        if float(noise) < 0.0:\n            raise ValueError(f\"rollout_noise_level must be non-negative, got {noise!r}\")\n\n        if self.rollout_sde_type not in _VALID_ROLLOUT_SDE_TYPES:\n            raise ValueError(\n                f\"rollout_sde_type must be one of {_VALID_ROLLOUT_SDE_TYPES}, \"\n                f\"got {self.rollout_sde_type!r}\"\n            )\n\n    @classmethod\n    def validate_sampling_params(cls, params: Any) -> None:\n        \"\"\"Validate rollout fields on a duck-typed object (e.g. ``SamplingParams``).\n\n        Mirrors how ``ServerArgs`` runs ``NunchakuSVDQuantArgs.validate()`` from\n        ``_adjust_quant_config`` instead of inlining checks in a large validator.\n        \"\"\"\n        cls(\n            rollout=params.rollout,\n            rollout_sde_type=params.rollout_sde_type,\n            rollout_noise_level=params.rollout_noise_level,\n            rollout_log_prob_no_const=params.rollout_log_prob_no_const,\n            rollout_debug_mode=params.rollout_debug_mode,\n        ).validate()","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/configs/post_training/rl_rollout.py#L19-L55","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"# before\nparams.rollout_sde_type = \"Euler\"  # wrong case\n\n# after\nfrom sglang.multimodal_gen.configs.post_training.rl_rollout import _VALID_ROLLOUT_SDE_TYPES\nparams.rollout_sde_type = next(iter(_VALID_ROLLOUT_SDE_TYPES))  # or a valid literal","handlingStrategy":"validation","validationCode":"from sglang.multimodal_gen.configs.post_training.rl_rollout import _VALID_ROLLOUT_SDE_TYPES\nassert params.rollout_sde_type in _VALID_ROLLOUT_SDE_TYPES, f\"valid: {_VALID_ROLLOUT_SDE_TYPES}\"","typeGuard":"def is_valid_sde_type(v, valid) -> bool:\n    return v in valid","tryCatchPattern":null,"preventionTips":["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"],"tags":["rl-rollout","sde","enum-validation","config"],"backgroundTag":"invalid-enum-config-value","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}