[Kernel] Migrate top-level srt/layers stray kernels to sglang.kernels (RFC #29630, Phase 2.5, 3/7) (#30787)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Xiaoyu Zhang
2026-07-14 09:20:59 +08:00
committed by GitHub
co-authored by Claude Fable 5
parent e489685509
commit e9ef06c560
37 changed files with 269 additions and 177 deletions
@@ -3,7 +3,7 @@ import itertools
import pytest
import torch
from sglang.srt.layers.elementwise import fused_gate_sigmoid_mul_add
from sglang.kernels.ops.layernorm.elementwise import fused_gate_sigmoid_mul_add
DTYPES = [torch.float16, torch.bfloat16]
TOKEN_COUNTS = [1, 2, 4, 8, 16, 64, 512, 1024, 2048, 4096, 8192]
+1 -1
View File
@@ -3,7 +3,7 @@ import itertools
import pytest
import torch
from sglang.srt.layers.elementwise import fused_sigmoid_mul
from sglang.kernels.ops.layernorm.elementwise import fused_sigmoid_mul
DTYPES = [torch.float16, torch.bfloat16]
TOKEN_COUNTS = [1, 2, 4, 8, 16, 64, 512, 1024, 2048, 4096, 8192]
@@ -11,14 +11,14 @@ from sglang.jit_kernel.dsv4 import (
fused_q_indexer_rope_hadamard_fp4_quant,
)
from sglang.jit_kernel.hadamard import hadamard_transform
from sglang.kernels.ops.attention.deepseek_v4_rope import (
apply_rotary_emb_triton,
precompute_freqs_cis,
)
from sglang.srt.layers.attention.dsv4.fp4_indexer import (
quantize_fp4_indexer_tensor,
store_fp4_index_k_cache,
)
from sglang.srt.layers.deepseek_v4_rope import (
apply_rotary_emb_triton,
precompute_freqs_cis,
)
from sglang.test.ci.ci_register import register_cuda_ci
register_cuda_ci(est_time=60, stage="base-b-kernel-unit", runner_config="1-gpu-large")
@@ -26,7 +26,7 @@ pytestmark = pytest.mark.skipif(
@pytest.fixture(scope="module")
def fused_routing():
from sglang.srt.layers.gemma4_fused_ops import gemma4_fused_routing
from sglang.kernels.ops.layernorm.gemma4_fused_ops import gemma4_fused_routing
return gemma4_fused_routing
+2 -2
View File
@@ -1,8 +1,8 @@
import pytest
import torch
import sglang.srt.layers.mhc as mhc
from sglang.srt.layers.mhc import mhc_fused_post_pre, mhc_post, mhc_pre
import sglang.kernels.ops.layernorm.mhc as mhc
from sglang.kernels.ops.layernorm.mhc import mhc_fused_post_pre, mhc_post, mhc_pre
from sglang.test.ci.ci_register import register_cuda_ci
register_cuda_ci(est_time=30, stage="base-b", runner_config="1-gpu-large")