sgl-project/sglang · warning · DeprecationWarning

sglang.srt.layers.attention.nsa_backend is deprecated; use s

Error message

sglang.srt.layers.attention.nsa_backend is deprecated; use sglang.srt.layers.attention.dsa_backend instead.

What it means

Import-time DeprecationWarning: nsa_backend.py is a shim that re-exports sglang.srt.layers.attention.dsa_backend (the NSA attention backend renamed to DSA backend). It will be removed in a future release.

Source

Thrown at python/sglang/srt/layers/attention/nsa_backend.py:5

# [Deprecated] nsa_backend.py is a thin re-export shim for backward compatibility.
# Use dsa_backend.py instead. This file will be removed in a future release.
import warnings

warnings.warn(
    "sglang.srt.layers.attention.nsa_backend is deprecated; "
    "use sglang.srt.layers.attention.dsa_backend instead.",
    DeprecationWarning,
    stacklevel=2,
)
from sglang.srt.layers.attention.dsa_backend import *  # noqa: F401, F403
from sglang.srt.layers.attention.dsa_backend import (  # noqa: F401
    DeepseekSparseAttnBackend,
    DeepseekSparseAttnMultiStepBackend,
    DSAFlashMLAMetadata,
    DSAIndexerMetadata,
    DSAMetadata,
    NativeSparseAttnBackend,
    NativeSparseAttnMultiStepBackend,
    NSAFlashMLAMetadata,
    NSAIndexerMetadata,
    NSAMetadata,
)

View on GitHub (pinned to 0132848349)

Solutions

  1. Import from sglang.srt.layers.attention.dsa_backend
  2. Update backend-name strings from nsa to dsa where applicable
  3. Pin SGLang to the last pre-rename version if you need time to migrate

Example fix

# before
from sglang.srt.layers.attention.nsa_backend import NSABackend
# after
from sglang.srt.layers.attention.dsa_backend import DSABackend
Defensive patterns

Strategy: validation

Validate before calling

null

Prevention

When it happens

Trigger: `from sglang.srt.layers.attention.nsa_backend import ...` — e.g. importing NSABackend/backend selection helpers — or `--attention-backend nsa` style code paths that import the module by name.

Common situations: Selecting the sparse attention backend with code or CLI flags referencing the old nsa_backend module after an SGLang upgrade.

Related errors


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