Skip to content

Support EAGLE/MTP with HybridAttnBackend - #32268

Closed
akhilg-nv wants to merge 1 commit into
sgl-project:mainfrom
akhilg-nv:mtp_hybrid
Closed

akhilg-nv wants to merge 1 commit into
sgl-project:mainfrom
akhilg-nv:mtp_hybrid

Conversation

@akhilg-nv

@akhilg-nv akhilg-nv commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Enables EAGLE/MTP style speculative decoding to work with mixed prefill and decode backends (HybridAttnBackend)

Agent generated summary:

Before: any --prefill-attention-backend X --decode-attention-backend Y + EAGLE-family spec decoding crashed on the first speculative batch (found while using the split-backend workaround for the bug above):

  File ".../speculative/eagle_worker_common.py", line 356, in build_eagle_verify_input
      seq_lens_sum = batch.seq_lens.shape[0] * max_context_len
  TypeError: unsupported operand type(s) for *: 'int' and 'NoneType'

Root cause: eagle-v2 reads max_context_len + two verify-buffer hooks directly off model_runner.attn_backend; every concrete backend implements them, HybridAttnBackend implemented none — so it crashes here, and (more insidiously) the base-class no-op update_verify_buffers_to_fill_after_draft would leave stale tree-mask buffers during graph replay.

Modifications

Fix/After: mirror max_context_len and delegate both hooks to the spec-verify sub-backend. This fix is backend-agnostic, enabling all hybrid combos.

Accuracy Tests

Validated at full scale: GPQA 198x8 = 0.721 (FA3+MTP reference 0.734, within repeat noise), acceptance 2.45/0.48 vs 2.37/0.46 (see MTP data reported in #23112).

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 #30060442180
Latest PR Test (Extra): ❌ Run #30060442015

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@nvpohanh

nvpohanh commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

@akhilg-nv could you fix the conflicts? thanks!

@akhilg-nv

Copy link
Copy Markdown
Contributor Author

Closing: #32690 fixes the missing attn_backend.max_context_len and #32920 includes the fixes for handling the verify mask with HybridAttnBackend.

@akhilg-nv akhilg-nv closed this Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants