[Kernel] Migrate DSA + DSV4 attention kernels to sglang.kernels (RFC #29630, Phase 2.5, 5/7) (#30792)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Xiaoyu Zhang
2026-07-15 11:11:22 +08:00
committed by GitHub
co-authored by Claude Fable 5
parent 4ae9cc3c81
commit ba5be86d42
60 changed files with 663 additions and 583 deletions
@@ -1145,7 +1145,7 @@ def dsa_impl_capability(impl: str) -> tuple[bool, str]:
if impl == "tilelang":
try:
from sglang.srt.layers.attention.dsa.tilelang_kernel import ( # noqa: F401
from sglang.kernels.ops.attention.dsa.tilelang_kernel import ( # noqa: F401
tilelang_sparse_fwd,
)
except ImportError as exc:
@@ -19,12 +19,12 @@ from typing import Any
import torch
from torch import nn
from sglang.kernels.ops.attention.dsv4.quant_k_cache import (
quant_to_nope_fp8_rope_bf16_pack_triton,
)
from sglang.srt.distributed.parallel_state_wrapper import ParallelState
from sglang.srt.environ import envs
from sglang.srt.layers.attention.attention_registry import ATTENTION_BACKENDS
from sglang.srt.layers.attention.dsv4.quant_k_cache import (
quant_to_nope_fp8_rope_bf16_pack_triton,
)
from sglang.srt.layers.radix_attention import RadixAttention
from sglang.srt.mem_cache.deepseek_v4_memory_pool import DeepSeekV4TokenToKVPool
from sglang.srt.mem_cache.memory_pool import ReqToTokenPool