sgl-project/sglang · warning
'data_parallel_rank' is deprecated, use 'routed_dp_rank' ins
Error message
'data_parallel_rank' is deprecated, use 'routed_dp_rank' instead.
What it means
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.
Source
Thrown at python/sglang/srt/managers/io_struct.py:388
)
def normalize_batch_and_arguments(self):
"""
Normalize the batch size and arguments for the request.
This method resolves various input formats and ensures all parameters
are properly formatted as either single values or batches depending on the input.
It also handles parallel sampling expansion and sets default values for
unspecified parameters.
Raises:
ValueError: If inputs are not properly specified (e.g., none or all of
text, input_ids, input_embeds are provided)
"""
if self.data_parallel_rank is not None:
import warnings
warnings.warn(
"'data_parallel_rank' is deprecated, use 'routed_dp_rank' instead.",
DeprecationWarning,
stacklevel=2,
)
if self.routed_dp_rank is None:
self.routed_dp_rank = self.data_parallel_rank
self.data_parallel_rank = None
self._validate_inputs()
self._determine_batch_size()
if self.session_id is not None and self.session_params is not None:
raise ValueError("session_id and session_params cannot both be set.")
self._handle_parallel_sampling()
if self.is_single:
self._normalize_single_inputs()
else:
self._normalize_batch_inputs()View on GitHub (pinned to 0132848349)
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
Example fix
# before
{"text": "hi", "sampling_params": {...}, "data_parallel_rank": 1}
# after
{"text": "hi", "sampling_params": {...}, "routed_dp_rank": 1} Defensive patterns
Strategy: validation
Validate before calling
payload.pop("data_parallel_rank", None) # normalize client payloads to routed_dp_rank before sending Type guard
def is_valid_dp_request(payload: dict) -> bool:
return "routed_dp_rank" in payload and "data_parallel_rank" not in payload Prevention
- Use routed_dp_rank in request schemas
- Never send both DP rank fields
When it happens
Trigger: Sending a generation request payload containing data_parallel_rank (e.g. via /generate HTTP API or LLM.generate) instead of routed_dp_rank.
Common situations: Clients and benchmark scripts written before the DP routing field rename; sending both fields with conflicting values.
Related errors
- routed_dp_rank={routed_dp_rank} out of range [0, {dp_size})
- Invalid X-Data-Parallel-Rank header: must be an integer, got
- 'data_parallel_rank' is deprecated, use 'routed_dp_rank' ins
- 'data_parallel_rank' is deprecated, use 'routed_dp_rank' ins
- sglang.srt.layers.attention.nsa.dequant_k_cache is deprecate
AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28).
Data as JSON: /api/errors/f6d678517f84dbec.
Report an issue: GitHub.