{"record":{"id":"8055b61682b3485b","repo":"sgl-project/sglang","slug":"exponential-shift-enabled-but-exponential-shift-mu","errorCode":null,"errorMessage":"exponential_shift enabled but exponential_shift_mu is missing","messagePattern":"exponential_shift enabled but exponential_shift_mu is missing","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/models/schedulers/flow_match_pair.py","lineNumber":414,"sourceCode":"                            device=device,\n                            dtype=dtype,\n                        )[:-1]\n                    else:\n                        base = torch.linspace(\n                            sigma_start,\n                            self.sigma_min,\n                            num_steps,\n                            device=device,\n                            dtype=dtype,\n                        )\n\n                    if self.inverse_timesteps:\n                        base = torch.flip(base, dims=[0])\n\n                    if self.exponential_shift:\n                        mu_value = mu_override\n                        if mu_value is None:\n                            raise RuntimeError(\n                                \"exponential_shift enabled but exponential_shift_mu is missing\"\n                            )\n                        exp_mu = math.exp(float(mu_value))\n                        base = exp_mu / (exp_mu + (1 / base - 1))\n                    else:\n                        base = shift_value * base / (1 + (shift_value - 1) * base)\n\n                    if self.shift_terminal is not None:\n                        one_minus_z = 1 - base\n                        scale_factor = one_minus_z[-1] / (1 - self.shift_terminal)\n                        if scale_factor != 0:\n                            base = 1 - (one_minus_z / scale_factor)\n\n                    if self.reverse_sigmas:\n                        base = 1 - base\n\n                    if source == \"timesteps\":\n                        return base * self.num_train_timesteps","sourceCodeStart":396,"sourceCodeEnd":432,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/models/schedulers/flow_match_pair.py#L396-L432","documentation":"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.","triggerScenarios":"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.","commonSituations":"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).","solutions":["Pass mu explicitly: set_pair_postprocess_by_name(..., audio_mu=...) or set exponential_shift_mu on the scheduler/config","Compute mu from image resolution like diffusers does (mu = log(1/shift) style) and pass it per call","If exponential shifting is not intended, set exponential_shift=False"],"exampleFix":"# before\nsched.set_pair_postprocess_by_name(\"dual_sigma_shift\", ..., audio_shift=3.0)  # exponential_shift=True\n# after\nmu = math.log(1.0 / 3.0)  # or computed from resolution\nsched.set_pair_postprocess_by_name(\"dual_sigma_shift\", ..., audio_shift=3.0, audio_mu=mu)","handlingStrategy":"validation","validationCode":"if sched.exponential_shift and getattr(sched, \"exponential_shift_mu\", None) is None and audio_mu is None:\n    raise ValueError(\"audio_mu required when exponential_shift is on\")","typeGuard":null,"tryCatchPattern":"try:\n    sched.set_pair_postprocess_by_name(\"dual_sigma_shift\", ..., audio_mu=mu)\nexcept RuntimeError as e:\n    if \"exponential_shift_mu\" in str(e):\n        mu = math.log(1.0 / shift)\n        sched.set_pair_postprocess_by_name(\"dual_sigma_shift\", ..., audio_mu=mu)\n    else:\n        raise","preventionTips":["Compute mu alongside shift whenever exponential_shift is enabled","Wrap scheduler setup in a helper that derives mu from resolution/shift"],"tags":["scheduler","flow-matching","missing-parameter","exponential-shift"],"backgroundTag":"missing-config-value","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}