Step-by-step tutorial for adding a new lightweight JIT CUDA kernel to sglang.kernels JIT infrastructure and public operator groups
日本語の概要は準備中です。原文の説明を表示しています。
Apply the SGLang kernels RFC when adding, moving, splitting, or reviewing kernel APIs, registry metadata, kernel tests, benchmarks, and model-specific implementations. Use with add-jit-kernel, add-sgl-kernel, and write-sglang-test for placement and migration checks.
インストールする前に、エージェントに与えられる指示の中身を確認できます。
Read python/sglang/kernels/README.md and test/README.md before choosing a
location. RFC #29630
establishes the namespace; subsequent migrations #32148 and #40922 clarify
logical grouping and remove the old _jit_ filename prefix.
sglang.kernels.ops.<group>. Runtime
and integration tests import from that namespace, including its submodules.
The sgl_kernel wheel retains its own public API and packaging tests.gemm, expert
routing in moe, attention index selection in attention, sampling in
sampling, normalization in layernorm. A quantized GEMM is still a GEMM;
quantization alone belongs in quantization.ops/. Propose a new logical group only for a distinct responsibility,
and update ops._GROUPS, documentation, and tests together.kernels/jit; operator
wrappers call it from their logical group. Keep process groups, communicator
state, model dispatch, and buffer ownership in srt. K3-specific adapters in
srt/layers/communication/ need not pretend to be generic interfaces.Add lazy KernelSpec metadata in the owning group's __init__.py, or use the
existing BaseFusedOp registration when the operation has interchangeable
backends. Group imports must not import GPU implementations or compile kernels.
Use <group>.<name> for the op id and module:callable for the target. Preserve
existing backend dispatch and describe actual device/architecture restrictions
with CapabilityRequirement; JIT/AOT are not device types. Input shape/dtype
checks remain part of the entry point's contract. Registering a torch custom op
does not register it in the SGLang kernel inventory. Predicates, private JIT
factories, reference helpers, and runtime classes are not separate kernel APIs.
test/registered/kernels/ops/<group>/.test/registered/kernels/benchmark/<group>/.test/registered/unit/kernels/.test/registered/unit/<subsystem>/, following the tested
runtime module. A CUDA allocation does not make a runtime test a kernel test.test/manual/kernels/; do not leave
standalone test/benchmark entry points in production operator modules.sglang.test.kernels. Preserve vendored upstream trees
and AOT wheel packaging boundaries instead of reorganizing them incidentally.For a move/split, preserve assertions, parametrization, fixtures, platform skips,
execution entry points, and CI stages/runners. Apportion existing time estimates
across split files; do not duplicate the original budget for every output file
or silently drop a registration. Follow write-sglang-test for CI registration.
mechanical-refactor-verify to reproduce moves, and compare test inventories
and CI registration coverage before/after. Only delete an experimental path
after checking its call sites, flags, source, and dedicated tests together.Do not infer violations solely from a model name inside a group, a missing
_jit_ prefix, use of a runtime utility, or absence of BaseFusedOp inheritance.
まだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
Step-by-step tutorial for adding a new lightweight JIT CUDA kernel to sglang.kernels JIT infrastructure and public operator groups
日本語の概要は準備中です。原文の説明を表示しています。
Step-by-step tutorial for adding a heavyweight AOT CUDA/C++ kernel to sgl-kernel (including tests & benchmarks)
日本語の概要は準備中です。原文の説明を表示しています。
Start and persistently pursue a goal to babysit an SGLang pull request until selected GitHub Actions workflows pass on the latest PR head. Use when asked to monitor, babysit, retry, or fix PR CI for lint.yml, pr-test.yml, pr-test-extra.yml, AMD, or other named workflows; classify failures as PR-related versus flaky or infrastructural, auto-fix and push only small clean fixes, rerun failed jobs only up to 10 times, and ignore unselected workflows.
日本語の概要は準備中です。原文の説明を表示しています。
Audit the existing test tree and CI configuration for improvements, using a catalog of patterns previously applied in this repo. Use when asked to audit tests or CI, shrink CI time or cost, find redundant or misplaced tests, clean up a test group, or review whether a CI change follows established practice.
日本語の概要は準備中です。原文の説明を表示しています。
Guide to SGLang CI workflow orchestration — stage ordering, fail-fast, gating, partitioning, execution modes, and debugging CI failures. Use when modifying CI workflows, adding stages, debugging CI pipeline issues, or understanding how tests are dispatched and gated across stages.
日本語の概要は準備中です。原文の説明を表示しています。
Audit SGLang startup logs, save evidence, and propose cleanup for user review. With no arguments, run Qwen3-8B at TP1 and TP2 plus gpt-oss-20b at TP1.
日本語の概要は準備中です。原文の説明を表示しています。