Skip to content

[rl] SGLang generator: full prefill CUDA graphs for linear attention (GDN, KDA) models - #6200

Draft
acisseJZhong wants to merge 1 commit into
mainfrom
sglang-linear-attn-full-prefill-graph
Draft

acisseJZhong wants to merge 1 commit into
mainfrom
sglang-linear-attn-full-prefill-graph

Conversation

@acisseJZhong

@acisseJZhong acisseJZhong commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Depends on sgl-project/sglang#51225 (pinned sglang_commit must be bumped after it lands).

Summary (human-written)

What changed

GDN/KDA models can now use the default SGLangEngine.Config(cuda_graph="full"). Previously they raised and had to use "breakable".

Performance

Median prefill step on a multi-turn workload (32 sessions × 4 turns on cached prefixes), GB300:

Model Eager prefill Breakable Full (this PR) Full vs breakable
Qwen3.5-0.8B, TP 1 64.8 ms 28.6 ms 4.5 ms 6.4×
Qwen3.5-9B, TP 2 104.1 ms 36.0 ms 7.6 ms 4.7×

Workload wall time: 0.8B 1.59 s → 0.89 s; 9B 2.07 s → 1.34 s.

The gain shrinks as prefill batches grow and become GPU-bound. Qwen3.5-27B, 1x GB300, median prefill step; the last row is the sgl-project/sglang#48593 setup (100 multi-turn requests):

Prefill batch Eager Breakable Full Full vs breakable
bs 4, ~355 tokens 173.8 ms 88.2 ms 21.9 ms 4.0×
bs 25, ~2K tokens 211.7 ms 90.5 ms 80.6 ms 1.1×
bs 100, ~13.7K tokens 509 ms 490 ms 492 ms 1.0×

Testing (GB300)

Test Result
TestSGLangBitwiseParityGDN (Qwen3.5 debug, TP 2), full 6/6 passed, SGLang logprobs bitwise equal to trainer
TestSGLangBitwiseParityKDA (Kimi K3 debug), full 6/6 passed
8-step GRPO, Qwen3.5-0.8B, alphabet sort (FSDP 2 + 2 generators at TP 1) 8/8 steps completed; all 152 prefill steps replayed full graphs

This branch has not been deployed

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

Labels

ciflow/rl CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant