[Kernel] Phase 4 batch-3: migrate tangled JIT subsystems + new groups into kernels.ops (RFC #29630) - #32045
Merged
Merged
Conversation
… new groups (RFC sgl-project#29630) Moves the clean single-file operators and non-colliding subdirs (no shims, delete+rewrite): 19 attention ops (flash_attention*, concat_mla, cutedsl_gdn/kda/ paged_mqa, rope, fused_qknorm_rope, hadamard, clamp_position, add_constant, mla_kv_pack_quantize_fp8, ...), 8 moe ops, timestep_embedding, flash_attn/ -> attention, new groups lplb/ and kv_canary/, dsv32/ -> quantization. 161 call sites rewritten. Invariant CLEAN; tests pass; lint clean. Stage-2 (dsa/dsv4/trtllm_lora_temp __init__ merges, diffusion/ nested subdir, minimax_m3 & triton splits, inkling -> new model group) follows on this branch. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ups (RFC sgl-project#29630) - dsa/, dsv4/ -> kernels.ops.attention (merged into existing Phase-2.5 dirs) - trtllm_lora_temp/ (+ its self-contained data/csrc) -> kernels.ops.moe - diffusion/ (+ nested cutedsl/flydsl/triton) -> kernels.ops.diffusion - minimax_m3 split: rmsnorm->layernorm, qk_norm_rope->attention, swiglu->moe - triton/ split: gdn_fused_proj->attention, hash_topk/sigmoid_gate_mul->moe - inkling_* -> new kernels.ops.model.inkling group - new groups lplb/, kv_canary/ registered in _GROUPS All refs rewritten (no shims). Invariant CLEAN; 68 tests pass; lint clean.
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
BBuf
requested review from
1am9trash,
Fridge003,
HaiShaw,
Ying1123,
alphabetc1,
ch-wan,
fzyzcjy,
hanming-lu,
hnyls2002,
hubertlu-tw,
hzh0425,
ispobock,
jybsuper,
kkHuang-amd,
lifuhuang,
merrymercy,
mickqian,
xiezhq-hermann,
yhyang201,
yizhang2077,
yuan-luo and
yushengsu-thu
as code owners
July 22, 2026 10:19
Collaborator
Author
This was referenced Jul 22, 2026
mattteochen
added a commit
to mattteochen/sglang
that referenced
this pull request
Jul 22, 2026
Resolve the migration conflict from sgl-project#32045 (jit_kernel.dsv4 -> kernels.ops.attention.dsv4): - Port the fused C128 cleanup (C128DraftCleanup + fused kernel) onto the relocated kernels/ops/attention/dsv4/c128_cleanup.py (rename auto-detected) and export C128DraftCleanup from the new package __init__. - Resolve the deepseek_v4_memory_pool import block to the new path while keeping the fused-cleanup construction and dispatch. - Repoint the new unit test and benchmark to the new import path. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
BBuf
added a commit
to BBuf/sglang
that referenced
this pull request
Jul 23, 2026
…yout - Add the jit/ subpackage (shared JIT build/runtime infra) to the Layout. - All 19 operator groups are populated; drop the stale "reserved placeholders / implementations not moved yet" wording (migration complete via sgl-project#31666/sgl-project#32015/ sgl-project#32045/sgl-project#32072). - Note sglang.jit_kernel removed; ops live at kernels.ops.<group>._jit_<op>; tests/benchmarks under test/registered/kernels/{ops,benchmark}/<group>/; shared test helpers in sglang.test.kernels. - Fix the fused-op parity test path (now under ops/layernorm/). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
whybeyoung
pushed a commit
to stepinto/sglang
that referenced
this pull request
Jul 27, 2026
…gl-project#30924) A hard 'git revert 8bb0d8d' fails: later PRs (sgl-project#32072/sgl-project#32045/sgl-project#32015) finalized the sglang.jit_kernel -> sglang.kernels namespace migration, so the paths sgl-project#30924 wrote to no longer exist. Instead, short-circuit the runtime dispatcher (_run_per_token_group_quant_8bit_kernel) to always route the CUDA path to the deprecated-but-still-present v2 JIT kernel (per_token_group_quant_8bit_v2), which achieves the same behavioral revert without touching moved files. Suspected root cause on Hopper (H20): - PR sgl-project#30924 author's own note: 'flat load tiling fixed at 32B/lane (Hopper regression fix)' -- meaning the new kernel had a Hopper regression they tried to fix, but 66 non-bit-exact-vs-AOT cases remain outside CI coverage. - Every activation quant on GLM 5.2 NVFP4 goes through this dispatcher; a tiny numerical drift in the new kernel compounds through the MoE and shows up as low MTP draft accept rate. Scope of change: - fp8_kernel.py _run_per_token_group_quant_8bit_kernel: CUDA + group_size in {16,32,64,128} -> v2 kernel (v2 does not support group_size=256, so fall through to the new kernel there). - MUSA path unchanged (already AOT v2). - deep_gemm._varlen_deep_gemm_silu_mul_quant bypasses this dispatcher and calls the new per_token_group_quant() directly; NOT covered by this revert. Only affects users of the EP-MoE fused varlen path (--enable-ep-moe with masked schedule); plain TP MoE decoders (the reproducer in PR sgl-project#32209) are fully covered.
Zhylkaaa
pushed a commit
to Zhylkaaa/sglang
that referenced
this pull request
Jul 29, 2026
… into kernels.ops (RFC sgl-project#29630) (sgl-project#32045) Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jinzhenfan
pushed a commit
to jinzhenfan/sglang
that referenced
this pull request
Jul 29, 2026
… into kernels.ops (RFC sgl-project#29630) (sgl-project#32045) Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
5 tasks
OrangeRedeng
pushed a commit
to OrangeRedeng/sglang
that referenced
this pull request
Aug 24, 2026
… into kernels.ops (RFC sgl-project#29630) (sgl-project#32045) Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jakki-amd
pushed a commit
to jakki-amd/sglang
that referenced
this pull request
Sep 9, 2026
… into kernels.ops (RFC sgl-project#29630) (sgl-project#32045) Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Atituiset
pushed a commit
to Atituiset/sglang
that referenced
this pull request
Sep 10, 2026
… into kernels.ops (RFC sgl-project#29630) (sgl-project#32045) Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RFC #29630 Phase 4 — batch-3 (tangled subsystems + new groups + splits, no shims: delete + rewrite call sites).
Stage 1 — clean moves: 19 attention ops (flash_attention{,_v3,_v4}, concat_mla, cutedsl_gdn/kda/paged_mqa, rope, fused_qknorm_rope/minimax_qknorm_rope, hadamard, clamp_position, add_constant, mla_kv_pack_quantize_fp8, ...), 8 moe ops, timestep_embedding;
flash_attn/→ attention; new groupslplb/,kv_canary/;dsv32/→ quantization.Stage 2 — tangled:
dsa/,dsv4/→kernels.ops.attention(merged into existing Phase-2.5 dirs,__init__re-exports merged)trtllm_lora_temp/(+ its self-containeddata/csrc+data/include) →kernels.ops.moediffusion/(+ nestedcutedsl/flydsl/triton) →kernels.ops.diffusionkernels.ops.model.inklinggroupAll
sglang.jit_kernel.*refs rewritten to the new paths (268 files across both stages);lplb/kv_canary/modeladded to_GROUPS. Namespace import invariant CLEAN; 68 CPU kernels tests pass; lint clean.After this,
jit_kernel/holds only the 8 batch-1 compat shims + build infra (csrc/include/main) + benchmark/tests — handled by the structural finale + a shim-cleanup PR.🤖 Generated with Claude Code
CI States
Latest PR Test (Base): ⏳ Run #29923048180
Latest PR Test (Extra): ⏳ Run #29923047574