Skip to content

fix(ci): repair path filters regressed by #21482#23201

Merged
Kangyan-Zhou merged 1 commit intosgl-project:mainfrom
Kangyan-Zhou:fix-sgl-kernel-path-filter
Apr 20, 2026
Merged

fix(ci): repair path filters regressed by #21482#23201
Kangyan-Zhou merged 1 commit intosgl-project:mainfrom
Kangyan-Zhou:fix-sgl-kernel-path-filter

Conversation

@Kangyan-Zhou
Copy link
Copy Markdown
Collaborator

@Kangyan-Zhou Kangyan-Zhou commented Apr 20, 2026

Summary

PR #21482 ("Skip ci for .md files", merged 2026-03-28) introduced two different negation styles in the same change. It used the correct basename-level form for main_package and test:

"python/sglang/!(multimodal_gen)/**/!(*.md)"
"test/**/!(*.md)"

but used a broken extension-level form for sgl_kernel and multimodal_gen:

"sgl-kernel/**/*.!(md|txt)"
"python/sglang/multimodal_gen/**/*.!(md|ipynb)"

The extension-level form has two silent false-negative bugs:

  1. Extensionless files don't match. The negation sits inside the extension (.!(md|txt)), so the filename must contain a literal .. Files like sgl-kernel/Dockerfile, sgl-kernel/Makefile, sgl-kernel/LICENSE, and (in multimodal_gen) any Dockerfile/Makefile/LICENSE never trip the filter. This caused [Dependency] Upgrade to Torch 2.11.0 #21247 (torch 2.11 bump) to skip sgl-kernel-build-wheels and hit an ABI mismatch against the pre-built PyPI sglang-kernel wheel (undefined symbol: _ZN3c104cuda29c10_cuda_check_implementationEiPKcS2_ib).
  2. Blanket *.txt exclusion swallows CMakeLists.txt. sgl-kernel/CMakeLists.txt and sgl-kernel/csrc/cpu/CMakeLists.txt control the build (Triton tag, include paths, compile flags) and should absolutely trigger a rebuild. The exclusion was almost certainly intended only for THIRDPARTYNOTICES.txt.

Fix: rewrite the two broken filters at the basename level, matching the style already used for main_package / test:

sgl_kernel:
  - "sgl-kernel/**/!(*.md|THIRDPARTYNOTICES.txt|LICENSE)"
multimodal_gen:
  - "python/sglang/multimodal_gen/**/!(*.md|*.ipynb)"

A single extglob also sidesteps the dorny/paths-filter multi-! ordering bug that would otherwise force predicate-quantifier: 'every' and break OR-semantics with the other include patterns (issue #260). Keeping the negation intra-pattern also avoids any cross-filter side-effects in the same step.

Applied across all workflows that used the broken pattern:

  • sgl_kernel filter: pr-test.yml, pr-test-amd.yml, pr-test-amd-rocm720.yml, pr-test-xeon.yml, pr-test-xpu.yml (5 files).
  • multimodal_gen filter: pr-test.yml, pr-test-npu.yml, pr-test-amd.yml, pr-test-amd-rocm720.yml (4 files; pr-test.yml and pr-test-amd*.yml intersect the sgl_kernel set).

Test plan

Verified locally with picomatch@2.3.1 (the version dorny/paths-filter pins) invoked with {dot: true} (matching dorny/paths-filter/src/filter.ts:16). The test script reads the patterns straight from the committed workflow files, confirms all 5 sgl_kernel: and 4 multimodal_gen: blocks collapsed to the same two unique strings, and runs 19 + 13 = 32 cases — all pass.

sgl_kernel filter

File Old pattern New pattern Notes
sgl-kernel/Dockerfile skip ❌ match ✓ fixes #21247
sgl-kernel/Makefile skip ❌ match ✓
sgl-kernel/CMakeLists.txt skip ❌ match ✓ fixes latent build bug
sgl-kernel/csrc/cpu/CMakeLists.txt skip ❌ match ✓ nested CMakeLists.txt
sgl-kernel/LICENSE match ❌ skip ✓ legal; no rebuild needed
sgl-kernel/3rdparty/fmt/LICENSE skip nested LICENSE (hypothetical vendored code)
sgl-kernel/README.md, docs/guide.md skip skip preserved (incl. nested)
sgl-kernel/THIRDPARTYNOTICES.txt skip skip preserved
sgl-kernel/.gitignore, csrc/.clang-format match match dotfiles still match
sgl-kernel/build.sh, pyproject.toml, *.cu, *.py, *.cmake match match preserved

multimodal_gen filter

File Old pattern New pattern
python/sglang/multimodal_gen/Dockerfile skip ❌ match ✓
python/sglang/multimodal_gen/Makefile skip ❌ match ✓
python/sglang/multimodal_gen/LICENSE skip ❌ match ✓
python/sglang/multimodal_gen/README.md skip skip
python/sglang/multimodal_gen/apps/webui/README.md skip skip
python/sglang/multimodal_gen/.claude/CLAUDE.md skip skip
python/sglang/multimodal_gen/notebook.ipynb skip skip
python/sglang/multimodal_gen/nested/dir/tutorial.ipynb skip skip
python/sglang/multimodal_gen/foo.py, pyproject.toml, apps/webui/foo.tsx match match

Reproducer:

mkdir -p /tmp/dorny-test && cd /tmp/dorny-test
npm init -y && npm install picomatch@^2.3.1
node -e "console.log(require('picomatch')('sgl-kernel/**/!(*.md|THIRDPARTYNOTICES.txt|LICENSE)', {dot:true})('sgl-kernel/CMakeLists.txt'))"
# → true  (false with the old pattern)

Notes

  • Exclusion scope. The basename-level excludes (LICENSE, THIRDPARTYNOTICES.txt, *.md, *.ipynb) apply at any depth under sgl-kernel/ or python/sglang/multimodal_gen/, not just top-level. Today the repo only has top-level occurrences, so this is observationally identical. If vendored code were ever added under e.g. sgl-kernel/3rdparty/<lib>/LICENSE, that would also be excluded — which is arguably the right behavior (vendored license metadata shouldn't trigger kernel rebuilds).
  • Out of scope. This PR deliberately keeps the denylist style inherited from Skip ci for .md files #21482. A follow-up could switch sgl_kernel to an explicit allowlist of build-relevant extensions (.py, .cu, .cuh, .cpp, .h, .hpp, .sh, .toml, .cmake, .yml) plus explicit files (CMakeLists.txt, Dockerfile, Makefile). Trade-off is different (new build-relevant extensions would need explicit adds), so saving that for a separate discussion.

Checks

  • pre-commit run clean on the six touched files
  • Local picomatch tests read patterns directly from the six committed workflow files; 32 cases (19 sgl_kernel + 13 multimodal_gen) all pass, including nested files, dotfiles, hypothetical vendored LICENSE, and in-repo .claude/CLAUDE.md
  • Grepped entire .github/ tree for remaining extension-level negation patterns — none left
  • CI on this PR triggers sgl-kernel-build-wheels because the change touches workflow files (confirms filter is re-exercised end-to-end)

🤖 Generated with Claude Code

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@github-actions github-actions Bot added the amd label Apr 20, 2026
@Kangyan-Zhou Kangyan-Zhou force-pushed the fix-sgl-kernel-path-filter branch from c62ad4b to 9a45487 Compare April 20, 2026 03:08
@Kangyan-Zhou Kangyan-Zhou changed the title fix(ci): match extensionless files in sgl-kernel path filter fix(ci): match extensionless and CMakeLists.txt files in sgl-kernel path filter Apr 20, 2026
PR sgl-project#21482 ("Skip ci for .md files", merged 2026-03-28) introduced two
different negation styles in the same change. It used the correct
basename-level form for `main_package` and `test`:
    "python/sglang/!(multimodal_gen)/**/!(*.md)"
    "test/**/!(*.md)"
but used a broken extension-level form for `sgl_kernel` and
`multimodal_gen`:
    "sgl-kernel/**/*.!(md|txt)"
    "python/sglang/multimodal_gen/**/*.!(md|ipynb)"

The extension-level form has two silent false-negative bugs:

1. Extensionless files don't match. The negation sits inside the
   extension (`.!(md|txt)`), so the filename must contain a literal `.`.
   Files like `sgl-kernel/Dockerfile`, `sgl-kernel/Makefile`, and
   `sgl-kernel/LICENSE` never trip the filter. This is what caused
   sgl-project#21247 (torch 2.11 bump) to skip `sgl-kernel-build-wheels` and hit
   an ABI mismatch against the pre-built PyPI sglang-kernel wheel.

2. The blanket `*.txt` exclusion swallows `sgl-kernel/CMakeLists.txt`
   and `sgl-kernel/csrc/cpu/CMakeLists.txt`, which control the build
   (Triton tag, include paths, compile flags) and must trigger a
   rebuild. The exclusion was almost certainly intended only for
   `THIRDPARTYNOTICES.txt`.

Rewrite the two broken filters at the basename level, matching the
style already used for `main_package` / `test`:

    sgl_kernel:
      - "sgl-kernel/**/!(*.md|THIRDPARTYNOTICES.txt|LICENSE)"
    multimodal_gen:
      - "python/sglang/multimodal_gen/**/!(*.md|*.ipynb)"

A single extglob also sidesteps the dorny/paths-filter multi-`!`
ordering bug (dorny/paths-filter#113, sgl-project#260) that would otherwise force
predicate-quantifier: 'every' and break OR-semantics with the other
include patterns.

Applied across all workflows that used the broken pattern:
- sgl_kernel filter: pr-test, pr-test-amd, pr-test-amd-rocm720,
  pr-test-xeon, pr-test-xpu (5 files).
- multimodal_gen filter: pr-test, pr-test-npu, pr-test-amd,
  pr-test-amd-rocm720 (4 files; pr-test.yml and pr-test-amd.yml
  intersect the sgl_kernel set).

Verified locally with picomatch@2.3.1 (the version dorny pins, invoked
with {dot: true} as in dorny/paths-filter/src/filter.ts). All cases
pass:

  sgl-kernel/Dockerfile                   old: skip  -> new: match
  sgl-kernel/Makefile                     old: skip  -> new: match
  sgl-kernel/CMakeLists.txt               old: skip  -> new: match
  sgl-kernel/csrc/cpu/CMakeLists.txt      old: skip  -> new: match
  sgl-kernel/LICENSE                      old: match -> new: skip
  sgl-kernel/THIRDPARTYNOTICES.txt        old: skip  -> new: skip (preserved)
  sgl-kernel/README.md                    old: skip  -> new: skip (preserved)
  sgl-kernel/{*.py,*.cu,*.toml,*.sh,*.cmake}  match (unchanged)

  python/sglang/multimodal_gen/Dockerfile old: skip  -> new: match
  python/sglang/multimodal_gen/Makefile   old: skip  -> new: match
  python/sglang/multimodal_gen/LICENSE    old: skip  -> new: match
  python/sglang/multimodal_gen/README.md  old: skip  -> new: skip (preserved)
  python/sglang/multimodal_gen/*.ipynb    old: skip  -> new: skip (preserved)
  python/sglang/multimodal_gen/*.py       match (unchanged)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Kangyan-Zhou Kangyan-Zhou force-pushed the fix-sgl-kernel-path-filter branch from 9a45487 to fb28953 Compare April 20, 2026 03:13
@github-actions github-actions Bot added the npu label Apr 20, 2026
@Kangyan-Zhou Kangyan-Zhou changed the title fix(ci): match extensionless and CMakeLists.txt files in sgl-kernel path filter fix(ci): repair path filters regressed by #21482 Apr 20, 2026
@Kangyan-Zhou Kangyan-Zhou merged commit 1d25280 into sgl-project:main Apr 20, 2026
54 of 61 checks passed
zhangying098 pushed a commit to zhangying098/sglang that referenced this pull request Apr 23, 2026
…ect#23201)

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
kyx1999 pushed a commit to KMSorSMS/sglang that referenced this pull request Apr 27, 2026
…ect#23201)

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant