{"record":{"id":"783106ef1a34a86d","repo":"sgl-project/sglang","slug":"time-shift-type-must-either-be-exponential-or","errorCode":null,"errorMessage":"`time_shift_type` must either be 'exponential' or 'linear'.","messagePattern":"`time_shift_type` must either be 'exponential' or 'linear'\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/models/schedulers/scheduling_flow_match_euler_discrete.py","lineNumber":134,"sourceCode":"        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\n        self.num_train_timesteps = num_train_timesteps\n\n        self._step_index: int | None = None\n        self._begin_index: int | None = None","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/models/schedulers/scheduling_flow_match_euler_discrete.py#L116-L152","documentation":"The constructor accepts time_shift_type of only 'exponential' or 'linear' (validated against a set). This controls how mu-based time shifting maps sigmas during set_timesteps.","triggerScenarios":"Passing time_shift_type='sqrt' or another string at construction, or a config file carrying an unsupported value from a different scheduler version.","commonSituations":"Downstream schedulers adding new shift types (e.g. 'flux-like' or custom) while this copy only supports two; typos like 'Exponential'.","solutions":["Use exactly 'exponential' or 'linear' (lowercase)","If a new shift type is required, extend both the constructor check and time_shift() dispatch","Verify the value in the model's scheduler config JSON"],"exampleFix":"# before\nFlowMatchEulerDiscreteScheduler(..., time_shift_type=\"exp\")\n# after\nFlowMatchEulerDiscreteScheduler(..., time_shift_type=\"exponential\")","handlingStrategy":"validation","validationCode":"assert time_shift_type in {\"exponential\", \"linear\"}, time_shift_type","typeGuard":"from typing import Literal\nShiftType = Literal[\"exponential\", \"linear\"]","tryCatchPattern":null,"preventionTips":["Use Literal types for time_shift_type","Validate values loaded from JSON configs"],"tags":["scheduler","invalid-enum-value","config"],"backgroundTag":"invalid-enum-value","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}