sgl-project/sglang · warning · DeprecationWarning

sglang.srt.layers.attention.nsa.quant_k_cache is deprecated;

Error message

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

What it means

DeprecationWarning from a compat shim: nsa.quant_k_cache moved to sglang.kernels.ops.attention.dsa.quant_k_cache. Importing the old module re-exports the new kernel module and warns.

Source

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

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

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

View on GitHub (pinned to 0132848349)

Solutions

  1. Import from sglang.kernels.ops.attention.dsa.quant_k_cache
  2. Update any nsa/__init__.py re-exports in your own packages
  3. Silence with warnings.filterwarnings only as a temporary measure

Example fix

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

Strategy: validation

Prevention

When it happens

Trigger: `import sglang.srt.layers.attention.nsa.quant_k_cache` or from-imports of the quant_k_cache kernels via the nsa path.

Common situations: K-cache quantization helper code referencing the pre-rename NSA kernel location.

Related errors


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