[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
-5
View File
@@ -1,5 +0,0 @@
"""Compatibility shim (RFC #29630 Phase 4) -> sglang.kernels.ops.activation._jit_activation."""
from sglang.kernels.ops.activation import _jit_activation as _impl
globals().update({k: getattr(_impl, k) for k in dir(_impl) if not k.startswith("__")})
@@ -1,5 +0,0 @@
"""Compatibility shim (RFC #29630 Phase 4) -> sglang.kernels.ops.gemm._jit_dsv3_fused_a_gemm."""
from sglang.kernels.ops.gemm import _jit_dsv3_fused_a_gemm as _impl
globals().update({k: getattr(_impl, k) for k in dir(_impl) if not k.startswith("__")})
@@ -1,5 +0,0 @@
"""Compatibility shim (RFC #29630 Phase 4) -> sglang.kernels.ops.gemm._jit_dsv3_router_gemm."""
from sglang.kernels.ops.gemm import _jit_dsv3_router_gemm as _impl
globals().update({k: getattr(_impl, k) for k in dir(_impl) if not k.startswith("__")})
-5
View File
@@ -1,5 +0,0 @@
"""Compatibility shim (RFC #29630 Phase 4) -> sglang.kernels.ops.layernorm._jit_norm."""
from sglang.kernels.ops.layernorm import _jit_norm as _impl
globals().update({k: getattr(_impl, k) for k in dir(_impl) if not k.startswith("__")})
@@ -1,5 +0,0 @@
"""Compatibility shim (RFC #29630 Phase 4) -> sglang.kernels.ops.quantization._jit_per_tensor_quant_fp8."""
from sglang.kernels.ops.quantization import _jit_per_tensor_quant_fp8 as _impl
globals().update({k: getattr(_impl, k) for k in dir(_impl) if not k.startswith("__")})
@@ -1,5 +0,0 @@
"""Compatibility shim (RFC #29630 Phase 4) -> sglang.kernels.ops.quantization._jit_per_token_group_quant."""
from sglang.kernels.ops.quantization import _jit_per_token_group_quant as _impl
globals().update({k: getattr(_impl, k) for k in dir(_impl) if not k.startswith("__")})
@@ -1,5 +0,0 @@
"""Compatibility shim (RFC #29630 Phase 4) -> sglang.kernels.ops.quantization._jit_per_token_group_quant_8bit_v2."""
from sglang.kernels.ops.quantization import _jit_per_token_group_quant_8bit_v2 as _impl
globals().update({k: getattr(_impl, k) for k in dir(_impl) if not k.startswith("__")})
@@ -1,5 +0,0 @@
"""Compatibility shim (RFC #29630 Phase 4) -> sglang.kernels.ops.kvcache._jit_set_mla_kv_buffer."""
from sglang.kernels.ops.kvcache import _jit_set_mla_kv_buffer as _impl
globals().update({k: getattr(_impl, k) for k in dir(_impl) if not k.startswith("__")})
+3 -3
View File
@@ -26,7 +26,7 @@ Groups populated in this phase: `activation`, `gemm`, `kvcache`, `layernorm`,
`moe`, `quantization`. The remaining groups (`attention`, `communication`,
`diffusion`, `grammar`, `mamba`, `memory`, `sampling`, `spatial`,
`speculative`) are reserved package placeholders whose implementations still
live in `sglang.jit_kernel` / `sgl_kernel` / `triton_ops` and will migrate in
live in `sglang.kernels.jit` / `sgl_kernel` / `triton_ops` and will migrate in
later phases.
## How it works
@@ -104,7 +104,7 @@ What this buys (see the
> SGLang runtime code and tests should import callable kernels from
> `sglang.kernels.ops.*`.
Implementation work can still happen in `sglang.jit_kernel` or `sgl_kernel`.
Implementation work can still happen in `sglang.kernels.jit` or `sgl_kernel`.
When a PR adds a new callable kernel, add a `sglang.kernels.ops.*` entry point
for it, and avoid growing `sglang.jit_kernel` as a long-term public operator
for it, and avoid growing `sglang.kernels.jit` as a long-term public operator
namespace.
+2 -2
View File
@@ -7,7 +7,7 @@ SGLang runtime code and tests should import callable kernels from
from sglang.kernels.ops.activation import silu_and_mul
from sglang.kernels.ops.kvcache import reshape_and_cache_flash
Implementations still live in ``sglang.jit_kernel`` (JIT CUDA), the
Implementations still live in ``sglang.kernels.jit`` (JIT CUDA), the
``sgl_kernel`` wheel (AOT CUDA/C++), Triton op modules, etc. The ``ops.*``
functions are thin wrappers that forward to a chosen backend; the
:data:`~sglang.kernels.registry.registry` provides an inventory of every
@@ -18,7 +18,7 @@ with a required pure-``torch`` ``forward_native`` reference and a
``SGLANG_FORCE_FUSED_OP_BACKEND`` global switch.
Importing this package (and any ``ops.*`` group) does not import a kernel
backend (``sgl_kernel`` / ``sglang.jit_kernel``) or trigger JIT compilation:
backend (``sgl_kernel`` / ``sglang.kernels.jit``) or trigger JIT compilation:
registration is metadata-only and backends are imported lazily on first call.
This keeps the namespace usable for inventory tooling on a CPU-only box.
"""
+1 -1
View File
@@ -28,7 +28,7 @@ implementations with a single switch.
Like the rest of ``sglang.kernels``, importing this module (and instantiating
subclasses) never imports a kernel backend (``sgl_kernel`` /
``sglang.jit_kernel``) or triggers JIT compilation; backends are imported
``sglang.kernels.jit``) or triggers JIT compilation; backends are imported
lazily inside the ``forward_<backend>`` methods.
"""
+1 -1
View File
@@ -1,6 +1,6 @@
"""Internal JIT home under ``sglang.kernels`` (RFC #29630).
Mirrors the legacy ``sglang.jit_kernel`` tree; shared build/runtime
Mirrors the legacy ``sglang.kernels.jit`` tree; shared build/runtime
infrastructure lives in :mod:`sglang.kernels.jit.utils`. csrc / include /
operators migrate here in later phases.
"""
@@ -1,6 +1,6 @@
/*
* Fused metadata copy kernel for DSA backend CUDA graph replay.
* JIT-compiled version for python/sglang/jit_kernel.
* JIT-compiled version for python/sglang/kernels/jit.
*
* OVERVIEW:
* This kernel fuses multiple tensor copy operations (cache_seqlens, cu_seqlens_k,

Some files were not shown because too many files have changed in this diff Show More