{"record":{"id":"225a12a2804211a9","repo":"sgl-project/sglang","slug":"speculative-algorithm-self-name-does-not-support","errorCode":null,"errorMessage":"Speculative algorithm {self.name} does not support overlap scheduling.","messagePattern":"Speculative algorithm (.+?) does not support overlap scheduling\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/speculative/spec_registry.py","lineNumber":115,"sourceCode":"\n    def supports_grammar_overlap(self) -> bool:\n        # Whether the worker advances the grammar FSM inside verify() (via the\n        # scheduler's grammar barrier), letting spec + grammar decode overlap.\n        return False\n\n    def has_draft_kv(self) -> bool:\n        # Conservative default: the larger KV reserve.\n        return True\n\n    def handle_server_args(self, server_args: ServerArgs) -> None:\n        pass\n\n    def create_worker(self, server_args: ServerArgs) -> Type:\n        from sglang.srt.arg_groups.overrides import resolving_view\n\n        cfg = resolving_view(server_args)\n        if not cfg.disable_overlap_schedule and not self.supports_overlap:\n            raise ValueError(\n                f\"Speculative algorithm {self.name} does not support overlap scheduling.\"\n            )\n        if not self.supports_overlap:\n            # Reached only when overlap is disabled, so the algorithm really\n            # does run synchronously on the V2 schema below.\n            logger.warning(\n                \"Speculative algorithm %s is registered with \"\n                \"supports_overlap=False, which is deprecated: the spec V1 \"\n                \"worker path has been removed, and the algorithm now runs on \"\n                \"the V2 scheduler schema with overlap disabled (synchronous). \"\n                \"Migrate the plugin worker to support overlap scheduling.\",\n                self.name,\n            )\n        return self.factory(server_args)\n\n    def get_num_tokens_per_req_for_target_verify(\n        self, num_draft_tokens: int, is_draft_worker: bool\n    ) -> int:","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/speculative/spec_registry.py#L97-L133","documentation":"When a speculative algorithm worker is created, the registry checks overlap-scheduling compatibility. If the server runs with overlap scheduling enabled (disable_overlap_schedule=False) and the algorithm's spec class declares supports_overlap=False, creation fails immediately.","triggerScenarios":"Launching with --speculative-algorithm <algo> while overlap scheduling is on (default) and the algorithm has supports_overlap() returning False, e.g. certain custom or NGram/STANDALONE variants that run synchronously.","commonSituations":"Default server flags combined with an algorithm that has not been made overlap-safe; plugin algorithms that forgot to override supports_overlap.","solutions":["Add --disable-overlap-schedule to the server launch","If you own the algorithm, implement overlap support and set supports_overlap() -> True","Switch to an algorithm that supports overlap (e.g. EAGLE-family)"],"exampleFix":"# before\npython -m sglang.launch_server --model m --speculative-algorithm MYALGO\n# after\npython -m sglang.launch_server --model m --speculative-algorithm MYALGO --disable-overlap-schedule","handlingStrategy":"validation","validationCode":"algo = SpeculativeAlgorithm.from_string(name)\nif not algo.supports_overlap and not server_args.disable_overlap_schedule:\n    server_args.disable_overlap_schedule = True  # or abort with a clear message","typeGuard":"def needs_overlap_disabled(name: str, server_args) -> bool:\n    spec = SpeculativeAlgorithm.from_string(name)\n    return not spec.supports_overlap and not server_args.disable_overlap_schedule","tryCatchPattern":null,"preventionTips":["Check supports_overlap before launching; script the flag pairing","Keep a matrix of algorithm -> required server flags"],"tags":["speculative-decoding","overlap-scheduling","configuration"],"backgroundTag":"unsupported-feature-combination","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}