sgl-project/sglang · warning
{name} is deprecated; use {replacement} instead.
Error message
{name} is deprecated; use {replacement} instead. What it means
DeprecationWarning from sglang.srt.layers.dcp.comm: the DCP accessor helpers (dcp_enabled, get_attention_dcp_world_size, get_attention_dcp_rank) are deprecated in favor of newer accessors (the runtime_context get_parallel() state). Each call to these helpers warns once via _warn_deprecated_dcp_accessor.
Source
Thrown at python/sglang/srt/layers/dcp/comm.py:43
import torch
from sglang.kernels.ops.attention.dcp_kernels import (
CPTritonContext,
_lse_pack_dim,
correct_attn_out,
dcp_lse_combine_triton,
dcp_pack_a2a_send,
)
from sglang.srt.distributed.device_communicators.pynccl_allocator import (
use_symmetric_memory,
)
from sglang.srt.distributed.parallel_state import GroupCoordinator
from sglang.srt.runtime_context import get_parallel
def _warn_deprecated_dcp_accessor(name: str, replacement: str) -> None:
warnings.warn(
f"{name} is deprecated; use {replacement} instead.",
DeprecationWarning,
stacklevel=2,
)
def dcp_enabled() -> bool:
"""Deprecated: use ``get_parallel().dcp_enabled``."""
_warn_deprecated_dcp_accessor("dcp_enabled()", "get_parallel().dcp_enabled")
return get_parallel().dcp_enabled
def get_attention_dcp_world_size() -> int:
"""Deprecated: use ``get_parallel().attn_dcp_size``."""
_warn_deprecated_dcp_accessor(
"get_attention_dcp_world_size()", "get_parallel().attn_dcp_size"
)
return get_parallel().attn_dcp_sizeView on GitHub (pinned to 0132848349)
Solutions
- Replace calls with the recommended replacements named in the warning (runtime_context get_parallel() DCP fields)
- Inspect the docstring/source of _warn_deprecated_dcp_accessor callers for the exact replacement names
- Wrap remaining calls behind your own helper during migration
Example fix
# before from sglang.srt.layers.dcp.comm import get_attention_dcp_rank rank = get_attention_dcp_rank() # after from sglang.srt.runtime_context import get_parallel rank = get_parallel().dcp_rank # per replacement noted in warning
Defensive patterns
Strategy: validation
Prevention
- Use runtime_context get_parallel() DCP accessors
- Wrap DCP queries in one helper so renames are single-point fixes
When it happens
Trigger: Calling dcp_enabled(), get_attention_dcp_world_size(), or get_attention_dcp_rank() from model or parallel-state code.
Common situations: DP-attention/DCP model code written before the accessor refactor; checking DCP rank/world size inside custom models after upgrading SGLang.
Related errors
- --dcp-comm-backend fi_a2a delegates the exchange to FlashInf
- --dcp-replicate-q-proj requires --dcp-size > 1.
- --dcp-replicate-q-proj only applies to the a2a/fi_a2a DCP co
- Kimi-K3 DCP with decode_attention_backend='cutedsl_mla' requ
- Kimi-K3 DCP with decode_attention_backend='cutedsl_mla' requ
AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28).
Data as JSON: /api/errors/425668473bd6a0f9.
Report an issue: GitHub.