{"record":{"id":"f6d678517f84dbec","repo":"sgl-project/sglang","slug":"data-parallel-rank-is-deprecated-use-routed-dp-f6d678","errorCode":null,"errorMessage":"'data_parallel_rank' is deprecated, use 'routed_dp_rank' instead.","messagePattern":"'data_parallel_rank' is deprecated, use 'routed_dp_rank' instead\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"python/sglang/srt/managers/io_struct.py","lineNumber":388,"sourceCode":"        )\n\n    def normalize_batch_and_arguments(self):\n        \"\"\"\n        Normalize the batch size and arguments for the request.\n\n        This method resolves various input formats and ensures all parameters\n        are properly formatted as either single values or batches depending on the input.\n        It also handles parallel sampling expansion and sets default values for\n        unspecified parameters.\n\n        Raises:\n            ValueError: If inputs are not properly specified (e.g., none or all of\n                       text, input_ids, input_embeds are provided)\n        \"\"\"\n        if self.data_parallel_rank is not None:\n            import warnings\n\n            warnings.warn(\n                \"'data_parallel_rank' is deprecated, use 'routed_dp_rank' instead.\",\n                DeprecationWarning,\n                stacklevel=2,\n            )\n            if self.routed_dp_rank is None:\n                self.routed_dp_rank = self.data_parallel_rank\n            self.data_parallel_rank = None\n\n        self._validate_inputs()\n        self._determine_batch_size()\n        if self.session_id is not None and self.session_params is not None:\n            raise ValueError(\"session_id and session_params cannot both be set.\")\n        self._handle_parallel_sampling()\n\n        if self.is_single:\n            self._normalize_single_inputs()\n        else:\n            self._normalize_batch_inputs()","sourceCodeStart":370,"sourceCodeEnd":406,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/managers/io_struct.py#L370-L406","documentation":"DeprecationWarning from GenerateReqInput.normalize_batch_and_arguments: the request field `data_parallel_rank` is renamed to `routed_dp_rank`. If only the old field is set it is copied to routed_dp_rank; setting both means the old one is ignored after warning.","triggerScenarios":"Sending a generation request payload containing data_parallel_rank (e.g. via /generate HTTP API or LLM.generate) instead of routed_dp_rank.","commonSituations":"Clients and benchmark scripts written before the DP routing field rename; sending both fields with conflicting values.","solutions":["Rename the field to routed_dp_rank in request payloads","Update OpenAI-compatible client wrappers and load-test scripts that pin data_parallel_rank","Verify dp semantics: routed_dp_rank controls which data-parallel rank serves the request"],"exampleFix":"# before\n{\"text\": \"hi\", \"sampling_params\": {...}, \"data_parallel_rank\": 1}\n# after\n{\"text\": \"hi\", \"sampling_params\": {...}, \"routed_dp_rank\": 1}","handlingStrategy":"validation","validationCode":"payload.pop(\"data_parallel_rank\", None)  # normalize client payloads to routed_dp_rank before sending","typeGuard":"def is_valid_dp_request(payload: dict) -> bool:\n    return \"routed_dp_rank\" in payload and \"data_parallel_rank\" not in payload","tryCatchPattern":null,"preventionTips":["Use routed_dp_rank in request schemas","Never send both DP rank fields"],"tags":["deprecation","sglang","request-api","data-parallel"],"backgroundTag":"deprecated-argument","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}