Skip to content

dflash piecewise cuda graphs support - #27468

Merged
ch-wan merged 3 commits into
mainfrom
dcw02/dflash-pcg-support
Jun 9, 2026
Merged

ch-wan merged 3 commits into
mainfrom
dcw02/dflash-pcg-support

Conversation

@dcw02

@dcw02 dcw02 commented Jun 7, 2026

Copy link
Copy Markdown
Collaborator

split off from #23000 adds piecewise cuda graphs support to dflash speculative decoding


CI States

Latest PR Test (Base): 🚫 Run #27217067169
Latest PR Test (Extra): ❌ Run #27217065984

@dcw02
dcw02 requested a review from hebiao064 as a code owner June 7, 2026 02:59
@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!

@Qiaolin-Yu Qiaolin-Yu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. could you add a related test?

@dcw02

dcw02 commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator Author

/rerun-test test/registered/piecewise_cuda_graph/test_pcg_with_speculative_decoding_dflash.py

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Results for /rerun-test test/registered/piecewise_cuda_graph/test_pcg_with_speculative_decoding_dflash.py:

🚀 1-gpu-5090 (1 test): ✅ View workflow run

cd test/ && python3 registered/piecewise_cuda_graph/test_pcg_with_speculative_decoding_dflash.py

@ch-wan
ch-wan merged commit 4455abd into main Jun 9, 2026
132 of 157 checks passed
@ch-wan
ch-wan deleted the dcw02/dflash-pcg-support branch June 9, 2026 22:44
Oasis-Git added a commit to Oasis-Git/sglang that referenced this pull request Jun 9, 2026
Three conflicts resolved + four-site API-migration port:

1. piecewise_cuda_graph_runner.py (deleted in HEAD, modified in main).
   Accept the deletion (cg-refactor's unified
   runner/prefill_cuda_graph_runner.py replaces it). Port main's
   sgl-project#27468 dflash-aux-hidden-states change to the new runner:
   capture_hidden_mode = FULL when spec_algorithm.is_dflash(), and
   use self.capture_hidden_mode (not NULL) in capture_prepare so
   dflash spec captures with the right variant.

2. frozen_kv_mtp_worker.py (deleted in main, modified in HEAD).
   Accept main's deletion (V1 -> V2 worker migration, sgl-project#27607). Apply
   the four cuda_graph_config API migration sites that cg-refactor
   had in V1 to V2 (frozen_kv_mtp_worker_v2.py):
   - backup_disable_cuda_graph -> backup_decode_mode (using new
     cuda_graph_config.decode.backend field)
   - server_args.disable_cuda_graph = True ->
     server_args.cuda_graph_config.decode.backend = Backend.DISABLED
   - matching restoration on draft_model_runner.server_args
   - init_cuda_graphs early-exit:
     self.server_args.disable_cuda_graph ->
     check_cuda_graph_backend(Phase.DECODE, Backend.DISABLED)

3. test/registered/cuda_graph/piecewise/
   test_pcg_with_speculative_decoding_dflash.py (file location).
   Accept at the cg-refactor-renamed location (new test/registered/
   cuda_graph/piecewise/ tree, not the legacy
   test/registered/piecewise_cuda_graph/).

Audited the auto-merged code-side files (scheduler.py,
schedule_batch.py, memory_pool.py, cuda_graph_buffer_registry.py,
arg_groups/speculative_hook.py, spec_info.py,
speculative_draft_runner.py) for unused-arg artifacts introduced by
the merge. None found — added kwargs (e.g. mamba_indices on
DSATokenToKVPool.get_cpu_copy/load_cpu_copy, padding_policy on
positions/mrope_positions GraphSlots) are all referenced at the
call sites and in the function bodies.

Sanity-checked imports on touched files (frozen_kv_mtp_worker_v2,
prefill_cuda_graph_runner) and AST-parsed cleanly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Chronostasys pushed a commit to MindLab-Research/sglang that referenced this pull request Aug 24, 2026
jakki-amd pushed a commit to jakki-amd/sglang that referenced this pull request Sep 9, 2026
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.

3 participants