Skip to content

[BCG][6/N] Allow prefill breakable CUDA graph for the Kimi archs - #34245

Merged
Oasis-Git merged 3 commits into
sgl-project:mainfrom
Oasis-Git:fix/kimi-bcg-multimodal-allowlist
Aug 16, 2026
Merged

Oasis-Git merged 3 commits into
sgl-project:mainfrom
Oasis-Git:fix/kimi-bcg-multimodal-allowlist

Conversation

@Oasis-Git

@Oasis-Git Oasis-Git commented Aug 10, 2026 •

Copy link
Copy Markdown
Collaborator

Kimi configs always construct a vision_config (KimiK3Config defaults it to KimiK3VisionConfig() when absent), so ModelConfig.is_multimodal is True via the has_multimodal_subconfig sniff even when serving text only -- neither the arch name nor multimodal_model_archs is involved. The generic "multimodal model" rule in _disable_breakable_cudagraph_if_incompatible then forced prefill.backend to DISABLED on the default path.

This only ever showed up on the default path: _apply_cuda_graph_compatibility returns early when the prefill backend is explicitly locked, so validation runs using --cuda-graph-backend-prefill breakable bypassed the rule and looked fine. With #33661 making MLA fully supported under BCG (and dropping the per-arch MLA opt-in list), this multimodal rule was the last thing keeping Kimi off BCG.

Opt both Kimi archs into the breakable allowlist, and give the tc_piecewise upgrade an explicit precedence rule. That upgrade runs before the disable rules and consulted only the piecewise allowlist, so for any arch on both lists it silently won and breakable membership was dead -- K2.5 is on both. Preferring breakable there keeps K2.5 on the piecewise allowlist (it is still piecewise-validated, and is_piecewise_cuda_graph_disabled_model stays False) while actually resolving to breakable.

Capturing is safe for the same reason it is for the other allowlisted archs: can_replay_locally rejects any batch carrying input_embeds/replace_embeds, so image-carrying batches fall back to eager and only text-only prefill replays.

The tc_piecewise upgrade test builds its model_config as a SimpleNamespace; add the field the new condition reads.

Motivation

Modifications

Accuracy Tests

Speed Tests and Profiling

Checklist

Review and Merge Process

  1. Ping Merge Oncalls to start the process. See the PR Merge Process.
  2. Get approvals from CODEOWNERS and other reviewers.
  3. Trigger CI tests with comments or contact authorized users to do so.
    • Common commands include /tag-and-rerun-ci, /tag-run-ci-label, /rerun-failed-ci
  4. After green CI and required approvals, ask Merge Oncalls or people with Write permission to merge the PR.

CI States

Latest PR Test (Base): ✅ Run #31928447120
Latest PR Test (Extra): ❌ Run #31928447030

Kimi configs always construct a vision_config (KimiK3Config defaults it to
KimiK3VisionConfig() when absent), so ModelConfig.is_multimodal is True via
the has_multimodal_subconfig sniff even when serving text only -- neither
the arch name nor multimodal_model_archs is involved. The generic "multimodal
model" rule in _disable_breakable_cudagraph_if_incompatible then forced
prefill.backend to DISABLED on the default path.

This only ever showed up on the default path: _apply_cuda_graph_compatibility
returns early when the prefill backend is explicitly locked, so validation runs
using --cuda-graph-backend-prefill breakable bypassed the rule and looked fine.
With sgl-project#33661 making MLA fully supported under BCG (and dropping the per-arch MLA
opt-in list), this multimodal rule was the last thing keeping Kimi off BCG.

Opt both Kimi archs into the breakable allowlist, and give the tc_piecewise
upgrade an explicit precedence rule. That upgrade runs before the disable rules
and consulted only the piecewise allowlist, so for any arch on both lists it
silently won and breakable membership was dead -- K2.5 is on both. Preferring
breakable there keeps K2.5 on the piecewise allowlist (it is still
piecewise-validated, and is_piecewise_cuda_graph_disabled_model stays False)
while actually resolving to breakable.

Capturing is safe for the same reason it is for the other allowlisted archs:
can_replay_locally rejects any batch carrying input_embeds/replace_embeds, so
image-carrying batches fall back to eager and only text-only prefill replays.

The tc_piecewise upgrade test builds its model_config as a SimpleNamespace;
add the field the new condition reads.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@github-actions github-actions Bot added the Multi-modal multi-modal language model label Aug 10, 2026
@Oasis-Git Oasis-Git added run-ci CI: run the baseline test suite on this PR run-ci-extra CI: also run the extra suite (requires run-ci) bypass-fastfail labels Aug 10, 2026
@Oasis-Git

Copy link
Copy Markdown
Collaborator Author

/rerun-failed-ci

@Oasis-Git

Copy link
Copy Markdown
Collaborator Author

# Conflicts:
#	python/sglang/srt/configs/model_config.py
@Oasis-Git

Copy link
Copy Markdown
Collaborator Author

@Oasis-Git

Copy link
Copy Markdown
Collaborator Author

@Oasis-Git
Oasis-Git merged commit a508d60 into sgl-project:main Aug 16, 2026
303 of 328 checks passed
saturn-acc pushed a commit to saturn-acc/sglang that referenced this pull request Aug 16, 2026
danielchristiancazares pushed a commit to danielchristiancazares/sglang that referenced this pull request Aug 17, 2026
@hongqing1986

Copy link
Copy Markdown

Does DeepSeek have the same issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bypass-fastfail Multi-modal multi-modal language model run-ci CI: run the baseline test suite on this PR run-ci-extra CI: also run the extra suite (requires run-ci)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants