Skip to content

[CI] Keep diffusion-only kernels and tests out of the srt stages - #42706

Merged
mickqian merged 2 commits into
sgl-project:mainfrom
niehen6174:ci/exclude-diffusion-from-main-package
Oct 7, 2026
Merged

mickqian merged 2 commits into
sgl-project:mainfrom
niehen6174:ci/exclude-diffusion-from-main-package

Conversation

@niehen6174

@niehen6174 niehen6174 commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation

main_package in _pr-test-check-changes.yml matches every file under python/sglang/kernels/ and test/, so a diffusion PR that only touches diffusion kernels or diffusion tests runs the whole srt pipeline (base-a, base-b, base-c). Those PRs then fail or stall on srt tests they cannot affect. Examples from the last two days:

PR Diffusion-only paths it touched What blocked it in srt stages
#41906 kernels/ops/diffusion/, test/registered/kernels/ops/diffusion/ test_multi_lora_backend (base-b), base-c-test-8-gpu-b300 queued
#41830 kernels/ops/diffusion/, test/registered/kernels/ops/diffusion/ test_multi_lora_backend (base-b)
#36318 kernels/ops/diffusion/attention/ test_multi_lora_backend (base-b), base-c-test-8-gpu-b300 queued
#41894 test/registered/unit/diffusion/ test_disaggregation_dp_attention on H20 (base-c), base-c-test-8-gpu-b300 queued
#41819 test/registered/unit/diffusion/ test_multi_lora_backend (base-b)

Most of these paths are already listed under multimodal_gen, and all of them are under jit_kernel where relevant, so the diffusion CI and the kernel unit tests still run for them.

Modifications

  1. main_package no longer matches diffusion-only paths. dorny/paths-filter counts a file if it matches any pattern, so a subdirectory cannot be excluded with a ! pattern; instead the two catch-all globs (kernels/!(aot)/** and test/**) are rewritten level by level to skip:

    • python/sglang/kernels/ops/diffusion/**
    • python/sglang/kernels/jit/csrc/diffusion/**
    • test/registered/kernels/ops/diffusion/**
    • test/registered/kernels/benchmark/diffusion/**
    • test/registered/unit/diffusion/**
    • test/registered/e2e/diffusion/**

    python/sglang/kernels/ops/diffusion/common/** stays in main_package: srt reaches it through kda_kernels/layernorm_modulate_triton.py (used by srt/layers/attention/linear/kernels/kda_flashinfer.py). kda_kernels/ (including kda_kernels/csrc/diffusion/) is shared with srt and is unchanged.

  2. multimodal_gen gains the two diffusion paths it was missing: python/sglang/kernels/jit/csrc/diffusion/** and test/registered/e2e/diffusion/**, so every path dropped from main_package still starts the diffusion CI.

Only pr-test.yml and pr-test-extra.yml are affected on PRs. The nightly and weekly workflows that reuse this job force run_all_tests. pr-test-amd.yml has its own filter and is out of scope here.

Trade-offs

  • kernels/ops/diffusion/__init__.py is excluded, although srt imports it. sglang/kernels/ops/__init__.py eagerly imports every operator group, so any of the ~320 srt files that import sglang.kernels.ops.* executes the diffusion facade. Importing sglang.kernels.ops loads only that one module (sglang.kernels.ops.diffusion); its implementations are resolved lazily (PEP 562). An import-time break in this file is still caught before merge: the 39 test files under test/registered/kernels/ops/diffusion/ registered in base-b-kernel-unit all import sglang.kernels.ops, and that stage runs through jit_kernel for any change under python/sglang/kernels/; the diffusion CI imports it as well. Keeping the file in main_package would have kept most diffusion kernel PRs on the srt pipeline: 20 of the 28 commits that touched kernels/ops/diffusion/ since Sep 5 also touched this __init__.py.
  • test/registered/kernels/ops/diffusion/test_sites.py is registered in base-a-test-cpu, which is gated by main_package. A diffusion-only PR no longer runs it at PR time. It still runs on scheduled and full runs.

Accuracy Tests

N/A, CI configuration only.

Verification

The main_package, multimodal_gen and jit_kernel filters, before and after this change, were evaluated with picomatch using the options dorny/paths-filter@v3 passes ({dot: true}), over all tracked files (10,131):

Check Result
Files that leave main_package 176, all under a diffusion/ directory
Files under kernels/ops/diffusion/common/ that leave it 0
Files that newly enter main_package 3: test/README.md, test/registered/README.md, test/registered/unit/README.md
Files that leave main_package and match neither multimodal_gen nor jit_kernel 0

Replaying the changed-file lists of recent PRs:

PR main_package multimodal_gen jit_kernel
#41906, #41830, #36318, #41894 (diffusion kernels/tests) true -> false true -> true true
#41819 (diffusion unit tests) true -> false true -> true false
#41839 (touches python/pyproject.toml) true -> true true -> true true
#42391 (touches shared kda_kernels/) true -> true true -> true true
#42348 (srt-only) true -> true false -> false false

Checked that srt does not use the excluded paths: no Python import of kernels.ops.diffusion outside diffusion code except ops/diffusion/common (kept); kda_kernels resolves its diffusion/*.cuh sources from kda_kernels/csrc/, not jit/csrc/diffusion/; no C++/CUDA #include of diffusion headers outside the diffusion directories.

actionlint and pre-commit pass on the changed workflow.

Checklist


CI States

Latest PR Test (Base): ✅ Run #37476871067
Latest PR Test (Extra): ❌ Run #37476870754
Latest PR Test (AMD ROCm 10): ➖ No AMD PR run found for this commit.

main_package matched every file under python/sglang/kernels/ and test/, so a
diffusion PR that only touched kernels/ops/diffusion, jit/csrc/diffusion or a
diffusion test directory ran the whole srt pipeline (base-a/b/c) and could
fail on unrelated srt tests or wait on runners srt-only stages need.

Exclude those diffusion-only paths from main_package. They stay covered by
multimodal_gen and jit_kernel, which already listed most of them; add the two
that multimodal_gen was missing (jit/csrc/diffusion, test/registered/e2e/
diffusion). kernels/ops/diffusion/common stays in main_package because srt
reaches it through kda_kernels.
@niehen6174

Copy link
Copy Markdown
Collaborator Author

/tag-and-rerun-ci

@github-actions github-actions Bot added the run-ci CI: run the baseline test suite on this PR label Oct 6, 2026
@mickqian
mickqian merged commit 492dbd0 into sgl-project:main Oct 7, 2026
134 of 138 checks passed
mickqian pushed a commit that referenced this pull request Oct 7, 2026
Picks up #42958, which warms CI cases up at the request's quality level.
Without it the LTX-2 two-stage cases on the 2-GPU partition run their timed
request on a path warmup never touched and exceed their refinement limits;
main itself fails the same way.

The two streamed-encode tests move to python/sglang/multimodal_gen/test/unit/
with the rest of the diffusion unit tests (#42706), dropping their
register_cuda_ci call as the moved files did: that directory is collected
whole, so new files need no registration.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-ci CI: run the baseline test suite on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants