sgl-project/sglang · warning · DeprecationWarning

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

Error message

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

What it means

Deprecation warning emitted at import time by a backward-compatibility shim: sglang.srt.layers.attention.nsa.dequant_k_cache has moved to sglang.kernels.ops.attention.dsa.dequant_k_cache (NSA was renamed/rehomed to DSA under the sglang.kernels package). The old module still works by star-re-exporting the new one but will be removed in a future release.

Source

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

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

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

View on GitHub (pinned to 0132848349)

Solutions

  1. Change imports to sglang.kernels.ops.attention.dsa.dequant_k_cache
  2. If third-party code imports it, patch that code or pin an older SGLang version
  3. Run with -W error::DeprecationWarning in CI to catch remaining old imports

Example fix

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

Strategy: validation

Validate before calling

import warnings
with warnings.catch_warnings():
    warnings.simplefilter("ignore", DeprecationWarning)
    import sglang.srt.layers.attention.nsa.dequant_k_cache  # temporary

Prevention

When it happens

Trigger: Any `import sglang.srt.layers.attention.nsa.dequant_k_cache` (direct or via `from ...nsa.dequant_k_cache import ...`, or an old `nsa/__init__.py` importing it). It fires once at first import of the shim module.

Common situations: Code written against older SGLang using the nsa namespace; stale checkpoints of model/integration code importing nsa kernels after upgrading SGLang.

Related errors


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