[Spec] Extract shared draft worker construction and generalize draft sampler capture - #30857
Conversation
|
/rerun-test test_dflash.py test_basic_sanity_dflash.py |
|
Results for 🚀 |
There was a problem hiding this comment.
Code Review
This pull request refactors the speculative decoding draft worker setup by extracting common utilities into a new draft_worker_common.py module and generalizing the tail capture process using a list of hooks (capture_tail_hooks) in the model runner. It also adds a CUDA device check for DFLASH speculative decoding and extracts target probability building logic in dflash_utils.py. The review feedback highlights several improvement opportunities: wrapping the draft worker initialization in a try...finally block to guarantee the restoration of global server arguments, using the idiomatic is_hip() helper instead of torch.version.hip, and resetting or assigning capture_tail_hooks instead of appending to prevent duplicate hook accumulation if CUDA graphs are initialized multiple times.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
/tag-and-rerun-ci extra |
|
/rerun-test test_pcg_with_speculative_decoding_dflash.py test_kimi_k26_nvfp4_dflash.py test_gemma4_dflash_31b_extra.py |
|
Results for 🚀 🚀 🚀 |
|
Latest PR Test (Base): ✅ Run #29149096757 |
|
/rerun-test test_kimi_k26_nvfp4_dflash.py |
|
Results for 🚀 |
Conflicts resolved: - decode_cuda_graph_runner.py: kept the PP-proxy input-buffer refresh, adopted upstream's is_dflash_family()/is_ragged condition (sgl-project#30261), and renamed num_tokens_per_bs -> num_tokens_per_req in the PP proxy output slice (sgl-project#30977). - eagle_worker_v2.py: dropped the local _get_plan_stream (extracted to a shared get_plan_stream upstream, sgl-project#31008/sgl-project#30857) and re-applied the pp_proxy_tensors parameter on the deduplicated forward_batch_generation signature. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Behavior-preserving DFLASH refactor, one logical change per commit:
Verification: full test_dflash.py run has an identical pass/fail signature to the main baseline on the same machine (48 passed; the same 3 pre-existing environment-specific failures on both).
CI States
Latest PR Test (Base): ❌ Run #29162877753
Latest PR Test (Extra): 🚫 Run #29162877678