sgl-project/sglang · warning · DeprecationWarning

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

Error message

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

What it means

Import-time DeprecationWarning: the NSA triton kernel module moved to sglang.kernels.ops.attention.dsa.triton_kernel. The shim re-exports everything, so kernels keep working until the shim is removed.

Source

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

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

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

View on GitHub (pinned to 0132848349)

Solutions

  1. Update to sglang.kernels.ops.attention.dsa.triton_kernel
  2. Fix re-exports in downstream forks/plugins
  3. Run tests with warnings-as-errors to catch stragglers

Example fix

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

Strategy: validation

Prevention

When it happens

Trigger: Importing sglang.srt.layers.attention.nsa.triton_kernel or Triton DSA/NSA kernel helpers through the nsa namespace.

Common situations: Triton-based sparse attention code using old import paths after the NSA→DSA refactor in SGLang.

Related errors


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