Repository navigation
[Spec] Support FlashInfer CUDA graph for EAGLE draft-extend - #28782
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds support for the FlashInfer attention backend in the Eagle draft-extend speculative execution path, enabling CUDA graph capture and replay by using a fixed query-output (qo) layout. It also optimizes performance by passing host-side prefix lengths (extend_prefix_lens_cpu) to avoid device-to-host synchronization. However, the review highlights a potential runtime crash: the update_sliding_window and update_cross_attention methods in FlashInferIndicesUpdaterPrefill need to be updated to accept the new extend_prefix_lens_cpu parameter to prevent TypeError exceptions when those features are active.
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.
|
/rerun-test test_spec_eagle_topk.py test_spec_eagle.py test_bench_serving_1gpu_large.py |
|
Results for 🚀 🚀 |
|
Results for 🚀 🚀 |
|
/rerun-test test_spec_eagle_topk.py test_spec_eagle.py |
|
Results for 🚀 |
Summary
FlashInferAttnBackendto the draft-extend graph whitelist), replacing eager per-layer launches.Changes
is_draft_extend_v2()branches to_prepare_cuda_graph_metadata/init_forward_metadata_out_graphso the draft-extend forward replays as a causal paged-prefill graph.EagleDraftExtendInput.generate_attn_arg_prefilluses a constantnum_draft_tokensqo layout (required for graph capture/replay), matching the padded draft-extend input.extend_prefix_lens_cpuintoFlashInferIndicesUpdaterPrefill.update, replacingpaged_kernel_lens.sum().item()with a host-side sum.Notes
speculative_token_map) falls back to eager: the draft-extend graph buffers are sized to the full draft vocab and are incompatible with the reduced (hot) vocab head.CI States
Latest PR Test (Base): ❌ Run #27916144655
Latest PR Test (Extra): 🚫 Run #27916144559