sgl-project/sglang · warning · DeprecationWarning

sglang.srt.layers.attention.nsa.transform_index is deprecate

Error message

sglang.srt.layers.attention.nsa.transform_index is deprecated; use sglang.kernels.ops.attention.dsa.transform_index instead.

What it means

DeprecationWarning emitted when importing the old nsa.transform_index shim; the module now lives at sglang.kernels.ops.attention.dsa.transform_index and is re-exported for compatibility.

Source

Thrown at python/sglang/srt/layers/attention/nsa/transform_index.py:4

# [Deprecated] Re-export shim for backward compatibility. Use dsa.transform_index instead.
import warnings

warnings.warn(
    "sglang.srt.layers.attention.nsa.transform_index is deprecated; "
    "use sglang.kernels.ops.attention.dsa.transform_index instead.",
    DeprecationWarning,
    stacklevel=2,
)
from sglang.kernels.ops.attention.dsa.transform_index import *  # noqa: F401, F403

View on GitHub (pinned to 0132848349)

Solutions

  1. Import from sglang.kernels.ops.attention.dsa.transform_index
  2. Audit imports with grep for `attention\.nsa`
  3. Pin an older SGLang release only if you cannot patch immediately

Example fix

# before
from sglang.srt.layers.attention.nsa.transform_index import transform_index
# after
from sglang.kernels.ops.attention.dsa.transform_index import transform_index
Defensive patterns

Strategy: validation

Prevention

When it happens

Trigger: `from sglang.srt.layers.attention.nsa.transform_index import ...` or indirect import via the nsa package.

Common situations: Post-upgrade code that transforms sparse-attention indices using the pre-rename module path.

Related errors


AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28). Data as JSON: /api/errors/9d2a0bb3adfe5373. Report an issue: GitHub.