sgl-project/sglang · warning · DeprecationWarning

sglang.srt.layers.attention.nsa.index_buf_accessor is deprec

Error message

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

What it means

Import-time DeprecationWarning from a compat shim: the NSA index_buf_accessor module moved to sglang.kernels.ops.attention.dsa.index_buf_accessor. The shim re-exports the new module so behavior is unchanged, but the old path will be deleted.

Source

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

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

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

View on GitHub (pinned to 0132848349)

Solutions

  1. Update imports to sglang.kernels.ops.attention.dsa.index_buf_accessor
  2. Grep the repo for `attention.nsa` and fix all occurrences
  3. Add a CI check that fails on DeprecationWarning to prevent regressions

Example fix

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

Strategy: validation

Validate before calling

import importlib.util
assert importlib.util.find_spec("sglang.kernels.ops.attention.dsa.index_buf_accessor"), "upgrade sglang-kernels"

Prevention

When it happens

Trigger: Importing sglang.srt.layers.attention.nsa.index_buf_accessor directly or through the nsa package __init__; any from-import of names like index_buf_accessor helpers from the old path.

Common situations: Upgrading SGLang where NSA (Native Sparse Attention) code was renamed to DSA; user scripts or plugins pinned to the old module path.

Related errors


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