[Kernel] RFC #29630 finale: retire sglang.jit_kernel into sglang.kernels (#32072)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Xiaoyu Zhang
2026-07-23 08:35:09 +08:00
committed by GitHub
co-authored by Claude Opus 4.8
parent 8ce68370b5
commit 99f636a86f
354 changed files with 889 additions and 875 deletions
+3 -1
View File
@@ -8,7 +8,9 @@ import torch
import triton
from sgl_kernel import fp8_scaled_mm as sgl_scaled_mm
from sglang.jit_kernel.per_tensor_quant_fp8 import per_tensor_quant_fp8
from sglang.kernels.ops.quantization._jit_per_tensor_quant_fp8 import (
per_tensor_quant_fp8,
)
from sglang.utils import is_in_ci
# Optional vLLM import
@@ -18,7 +18,9 @@ import torch
import triton
from sgl_kernel import fp8_scaled_mm as sgl_scaled_mm
from sglang.jit_kernel.per_tensor_quant_fp8 import per_tensor_quant_fp8
from sglang.kernels.ops.quantization._jit_per_tensor_quant_fp8 import (
per_tensor_quant_fp8,
)
from sglang.utils import is_in_ci
IS_CI = is_in_ci()
@@ -8,7 +8,9 @@ import torch
import triton
import triton.testing
from sglang.jit_kernel.per_tensor_quant_fp8 import per_tensor_quant_fp8
from sglang.kernels.ops.quantization._jit_per_tensor_quant_fp8 import (
per_tensor_quant_fp8,
)
from sglang.utils import is_in_ci
# Optional imports
+1 -1
View File
@@ -174,7 +174,7 @@ TORCH_LIBRARY_FRAGMENT(sgl_kernel, m) {
// moe_fused_gate / kimi_k2_moe_fused_gate (AOT) retired: the CUDA gate/topk path
// now routes through the unified Triton router
// (python/sglang/jit_kernel/moe_fused_gate.py).
// (python/sglang/kernels/ops/moe/moe_fused_gate.py).
m.def(
"fp8_blockwise_scaled_grouped_mm(Tensor output, Tensor a_ptrs, Tensor b_ptrs, Tensor out_ptrs, Tensor "
@@ -14,7 +14,7 @@ limitations under the License.
==============================================================================*/
// DeepSeek-V4 fused norm + RoPE kernels, ported from JIT kernel
// python/sglang/jit_kernel/csrc/deepseek_v4/main_norm_rope.cuh
// python/sglang/kernels/jit/csrc/deepseek_v4/main_norm_rope.cuh
// to sgl-kernel AOT compilation with CUDA + HIP (ROCm) support.
#ifndef USE_ROCM
+1 -1
View File
@@ -106,7 +106,7 @@ def moe_sum(
# moe_fused_gate / kimi_k2_moe_fused_gate (AOT gate kernels) retired — the gate/topk
# path is consolidated onto the unified Triton router in
# python/sglang/jit_kernel/moe_fused_gate.py (sglang issue #26771).
# python/sglang/kernels/ops/moe/moe_fused_gate.py (sglang issue #26771).
def fp8_blockwise_scaled_grouped_mm(
@@ -3,8 +3,10 @@ from typing import Optional, Tuple, Union
import torch
from sglang.jit_kernel.rope import FusedSetKVBufferArg as _JitFusedSetKVBufferArg
from sglang.jit_kernel.rope import (
from sglang.kernels.ops.attention.rope import (
FusedSetKVBufferArg as _JitFusedSetKVBufferArg,
)
from sglang.kernels.ops.attention.rope import (
apply_rope_with_cos_sin_cache_inplace as _jit_apply_rope_with_cos_sin_cache_inplace,
)
+3 -1
View File
@@ -5,7 +5,9 @@ import torch
from sgl_kernel import cutlass_w4a8_moe_mm
from utils import is_hopper
from sglang.jit_kernel.per_tensor_quant_fp8 import per_tensor_quant_fp8
from sglang.kernels.ops.quantization._jit_per_tensor_quant_fp8 import (
per_tensor_quant_fp8,
)
def pack_int4_values_to_int8(int4_values_interleaved: torch.Tensor) -> torch.Tensor: