{"record":{"id":"a8f80e268b5dbec8","repo":"sgl-project/sglang","slug":"skip-attn-backend-init-is-deprecated-and-will-be-r","errorCode":null,"errorMessage":"skip_attn_backend_init is deprecated and will be removed; pre-planners should call ForwardBatch.mark_forward_metadata_ready() after planning instead. The flag is mapped onto the marker for now.","messagePattern":"skip_attn_backend_init is deprecated and will be removed; pre-planners should call ForwardBatch\\.mark_forward_metadata_ready\\(\\) after planning instead\\. The flag is mapped onto the marker for now\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"python/sglang/srt/model_executor/forward_batch_info.py","lineNumber":675,"sourceCode":"        )\n\n    def apply_deprecated_skip_attn_backend_init(\n        self, skip_attn_backend_init: Optional[bool]\n    ) -> None:\n        \"\"\"Map the deprecated ``skip_attn_backend_init`` kwarg onto the marker.\n\n        Mapped, not ignored: callers passing True relied on planning being\n        skipped — ignoring the flag would silently re-plan and corrupt\n        pre-planned multi-step draft metadata. Warns once per process (a\n        module flag, not the warnings filter, so the hot decode loop never\n        pays warnings.warn per forward).\n        \"\"\"\n        if skip_attn_backend_init is None:\n            return\n        global _skip_attn_backend_init_warned\n        if not _skip_attn_backend_init_warned:\n            _skip_attn_backend_init_warned = True\n            warnings.warn(\n                \"skip_attn_backend_init is deprecated and will be removed; \"\n                \"pre-planners should call \"\n                \"ForwardBatch.mark_forward_metadata_ready() after planning \"\n                \"instead. The flag is mapped onto the marker for now.\",\n                DeprecationWarning,\n                stacklevel=3,\n            )\n        if skip_attn_backend_init:\n            self.mark_forward_metadata_ready()\n\n    def init_mlp_sync_metadata(\n        self, batch: ScheduleBatch, device: Union[str, torch.device]\n    ) -> None:\n        \"\"\"Populate per-rank token counts for DP-attention MLP synchronization.\"\"\"\n        if batch.global_num_tokens is None:\n            return\n\n        assert batch.global_num_tokens_for_logprob is not None","sourceCodeStart":657,"sourceCodeEnd":693,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/model_executor/forward_batch_info.py#L657-L693","documentation":"DeprecationWarning (warned once per process) from ForwardBatch helper: the skip_attn_backend_init flag is deprecated. Pre-planning code should instead call ForwardBatch.mark_forward_metadata_ready() after planning; for now the flag is mapped onto that marker.","triggerScenarios":"Calling forward_batch_generation/forward with skip_attn_backend_init=True/False (not None); each process warns once via the module-level _skip_attn_backend_init_warned latch.","commonSituations":"Custom schedulers or lookahead/pre-planning code that suppressed attention backend metadata init with the old flag; TBO/overlap-scheduler forks using the flag.","solutions":["Stop passing skip_attn_backend_init and call ForwardBatch.mark_forward_metadata_ready() once planning completes","Remove the argument entirely (None skips the warning path)","Search for skip_attn_backend_init in scheduler/planner code and refactor"],"exampleFix":"# before\nbatch.forward(skip_attn_backend_init=True)\n# after\nplan(batch)\nbatch.mark_forward_metadata_ready()\nbatch.forward()","handlingStrategy":"validation","validationCode":"assert \"skip_attn_backend_init\" not in kwargs, \"deprecated; use mark_forward_metadata_ready()\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Call ForwardBatch.mark_forward_metadata_ready() after planning","Remove skip_attn_backend_init from scheduler flags and tests"],"tags":["deprecation","sglang","scheduler","attention-backend"],"backgroundTag":"deprecated-argument","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}