[Kernel] Reclassify kernel tests by ops group + move helpers out of the package (RFC #29630) - #32128
Merged
Merged
Conversation
…ernels/ops/ (RFC sgl-project#29630) Follow-up to RFC sgl-project#29630: organize all kernel tests to mirror the sglang.kernels.ops.<group> structure, and get the last test files out of the sglang package. - Move test/registered/jit/ (102) + test/registered/kernels/ (21) test & benchmark files into test/registered/kernels/ops/<group>/ (tests) and .../<group>/benchmark/ (benches), classified by the operator each exercises (attention/moe/layernorm/quantization/kvcache/gemm/diffusion/kv_canary/ speculative/communication/mamba/activation/embeddings/model). - Relocate shared test helpers out of the package's odd python/sglang/kernels/jit/tests/ folder into a proper support package python/sglang/kernels/testing/ (utils, kv_canary/, deepseek_v4/); rewrite all sglang.kernels.jit.tests imports -> sglang.kernels.testing. - Register the 6 previously-orphaned in-package tests (minimax_m3 x2, sconv metadata x2, moe preprocess/topk_sigmoid) that were never run by CI: CUDA ones -> base-b-kernel-unit; ROCm-only minimax_m3 ones -> jit-kernel-unit (amd). - Rename colliding test_sigmoid_gate_mul.py (broadcast variant) -> test_sigmoid_gate_mul_broadcast.py. CI discovery is recursive over test/registered/** and keyed on register_*_ci stage, so these moves don't change which suite each test runs in. python/sglang/ now has zero CI-registered tests. Validated: registry-validation + no-registered-tests-in-package hooks pass, testing package imports, namespace stays metadata-only, pre-commit clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
BBuf
requested review from
DarkSharpness,
HydraQYH,
celve and
yuan-luo
as code owners
July 23, 2026 01:05
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
…-filters to kernels/ops - Move test/registered/jit/benchmark/diffusion/diffusion_nvfp4_shapes.json (a non-.py data fixture the earlier .py-only move missed) into the nvfp4 bench's new dir; bench loads it via Path(__file__).parent / "...json". - Repoint stale CI change-filters test/registered/jit/** -> test/registered/kernels/ops/** (and the diffusion-specific globs) in pr-test-amd, pr-test-amd-rocm720, _pr-test-check-changes, so editing a moved test/bench still triggers its suite. test/registered/jit/ now fully empty. Benchmarks themselves keep running unchanged: run_suite.py discovers recursively over test/registered/** keyed on register_*_ci (path-independent). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
BBuf
requested review from
Fridge003,
HaiShaw,
Kangyan-Zhou,
bingxche,
ispobock and
merrymercy
as code owners
July 23, 2026 01:17
…hmark/<group>/ Per review: keep benchmarks out of the ops/ test dirs, but still classified by group. Move test/registered/kernels/ops/<group>/benchmark/bench_*.py -> test/registered/kernels/benchmark/<group>/ (57 benches + the nvfp4 shapes JSON fixture). Tests stay in test/registered/kernels/ops/<group>/. Benchmarks stay under test/registered/ (NOT the package): they are CI-registered and run_suite.py only globs test/registered/**, plus the check-no-registered-tests-in-package hook forbids register_*_ci inside the wheel. So this is the closest layout to "benchmarks under a jit-style dir" that keeps them runnable in CI. CI change-filters updated: general test path -> test/registered/kernels/** (covers both ops/ tests and benchmark/ benches); diffusion bench filter -> test/registered/kernels/benchmark/diffusion/**. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…runtime kernels package) The shared test-support helpers do not belong under the runtime `kernels/` package. Move python/sglang/kernels/testing/ -> python/sglang/test/kernels/ (utils, kv_canary/, deepseek_v4/), the established in-package test-support namespace (alongside test_utils, ci_register, runners, mock_model, ...), and rewrite sglang.kernels.testing -> sglang.test.kernels imports. Kept separate from the existing srt-level sglang/test/kv_canary/ (e2e fixtures): these are the kernel-level fuzz/oracle helpers, so they live under sglang/test/kernels/kv_canary/ mirroring the kernel test tree test/registered/kernels/. Still an importable installed package (required: test/registered/ tests import it by absolute path). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…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>
The newly-registered test_minimax_m3_rmsnorm.py (register_amd_ci) lacked the `if __name__ == "__main__":` entry that run_suite.py's collection requires for registered pytest-style tests (otherwise `python3 file.py -f` silently skips). Surfaced by stage-a-unit-test-mlx collection. Add the standard `sys.exit(pytest.main([__file__, "-v"]))` block. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
xinguozhu-2026
pushed a commit
to xinguozhu-2026/sglang
that referenced
this pull request
Jul 23, 2026
…he package (RFC sgl-project#29630) (sgl-project#32128) Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jul 24, 2026
chuyeh
added a commit
to chuyeh/sglang
that referenced
this pull request
Jul 29, 2026
pr-test-amd-rocm724.yml was branched from pr-test-amd-rocm720.yml before the kernel module reorganization, and being a separate file it does not inherit later template fixes. Carry over the two that diverged: - Point the jit_kernel and multimodal_gen path filters at sglang/kernels and test/registered/kernels (sgl-project#32072, sgl-project#32128). The old jit_kernel paths no longer exist, so those filters could never match and the jobs would be skipped in filtered mode without any error. - Split stage-c-test-large-8-gpu-amd-mi35x across 3 partitions instead of 2, matching sgl-project#24651. The suite grew, and two partitions risk exceeding the 60-minute timeout. Co-authored-by: Cursor <cursoragent@cursor.com>
Zhylkaaa
pushed a commit
to Zhylkaaa/sglang
that referenced
this pull request
Jul 29, 2026
…he package (RFC sgl-project#29630) (sgl-project#32128) Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
jinzhenfan
pushed a commit
to jinzhenfan/sglang
that referenced
this pull request
Jul 29, 2026
…he package (RFC sgl-project#29630) (sgl-project#32128) Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jul 30, 2026
jakki-amd
pushed a commit
to jakki-amd/sglang
that referenced
this pull request
Sep 9, 2026
…he package (RFC sgl-project#29630) (sgl-project#32128) Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Atituiset
pushed a commit
to Atituiset/sglang
that referenced
this pull request
Sep 10, 2026
…he package (RFC sgl-project#29630) (sgl-project#32128) Co-authored-by: Claude Opus 4.8 <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.
Summary
Follow-up to RFC #29630. Organizes all kernel tests + benchmarks to mirror
sglang.kernels.ops.<group>, keeps tests and benchmarks separate, and gets the last test files out of thesglangpackage.Final layout
What changed
test/registered/jit/(102) +test/registered/kernels/(21) intotest/registered/kernels/ops/<group>/(tests) andtest/registered/kernels/benchmark/<group>/(benchmarks), classified by the operator each exercises, primarily by itssglang.kernels.ops.<group>imports. Tests and benchmarks are kept in separate trees.python/sglang/kernels/jit/tests/folder → proper support packagepython/sglang/kernels/testing/(utils.py,kv_canary/,deepseek_v4/); rewrote allsglang.kernels.jit.tests→sglang.kernels.testingimports.minimax_m3_{mxfp8,rmsnorm},sconv_{decode,extend}_metadata,moe_{preprocess,topk_sigmoid}had test functions but no CI registration (never ran). Addedregister_*_ci: CUDA →base-b-kernel-unit; ROCm-onlyminimax_m3→jit-kernel-unit(amd).test_sigmoid_gate_mul.py(base vs broadcast); broadcast one renamedtest_sigmoid_gate_mul_broadcast.py.diffusion_nvfp4_shapes.json) alongside its bench.test/registered/jit/**→test/registered/kernels/**(covers ops/ tests + benchmark/ benches), diffusion bench filter →test/registered/kernels/benchmark/diffusion/**.Why it's safe
Benchmarks and tests are both CI-registered and stay under
test/registered/. CI discovery is a recursive glob overtest/registered/**keyed on each file'sregister_*_ci(stage=...)— path-independent — so nothing changes about which suite each test/benchmark runs in. (Registered files cannot live in the package:run_suite.pydoesn't glob it, and thecheck-no-registered-tests-in-packagehook forbids it.)python/sglang/now has zero CI-registered tests.Validated:
validate registered test CI registries+reject CI-registered tests inside the sglang packagehooks pass,sglang.kernels.testingimports,import sglang.kernels.opsstays metadata-only, pre-commit clean. Almost entirelygit mvrenames.CI States
Latest PR Test (Base): ⏳ Run #29973449279
Latest PR Test (Extra): ⏳ Run #29977423820