Skip to content

[None][fix] Share Eagle3 draft KV layers in aggregated serving, not only under attention DP - #17548

Draft
zheyuf wants to merge 1 commit into
NVIDIA:feat/m3_with_msafrom
zheyuf:feat/share-draft-kv-in-agg
Draft

[None][fix] Share Eagle3 draft KV layers in aggregated serving, not only under attention DP#17548
zheyuf wants to merge 1 commit into
NVIDIA:feat/m3_with_msafrom
zheyuf:feat/share-draft-kv-in-agg

Conversation

@zheyuf

@zheyuf zheyuf commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Description

One-model speculative decoding places the drafter's KV either in the target
manager's blocks (shared) or in a separate draft KV cache manager.
Today that choice is gated on attention DP:

if self._mapping.enable_attention_dp and getattr(cls, 'supports_shared_draft_layers', True):
    return False  # shared
return should_use_separate_draft_kv_cache(self._speculative_config)

The gate reflects the layout existing deployments were validated with, not a
technical requirement. The consequence is that aggregated serving with
attention DP off takes the separate manager for every model
using
Eagle3-one-model / MTP one-model.

Why that costs acceptance

When the target reuses a prefix it does not recompute those tokens. The
drafter therefore never gets a chance to compute its own KV for them either,
and it enters generation blind over the reused span — its drafts are rejected
until it regrows the state. Sharing the layers removes the failure mode
structurally: one set of blocks, one lifetime, one reuse decision.

Measurement

Controlled warm/cold probe: 32 x 1684-token prompts sent twice in the same
process
. Round 2 hits the prefix cache, so the two rounds have identical
prompts and identical work and differ only in where the drafter's prefix KV
comes from. MiniMax-M3 NVFP4 target, TP4/EP4, Eagle3 draft_len 3, greedy.

arm cold AL warm AL delta
separate manager, 4-KV-head Eagle3 head 3.458 3.195 −0.263
separate manager, 64-KV-head Eagle3 head 3.555 3.282 −0.273
shared layers, 4-KV-head head 3.553 3.617 +0.064
shared layers, 64-KV-head head 3.603 3.596 −0.007
reuse disabled (control), both heads ±0.02

Two Eagle3 heads that differ only in num_key_value_heads (64 vs 4) lose the
same ~7.5%, so this is a property of the separate-manager path rather than of
a particular drafter. The reuse-disabled control rules out a systematic
round-2 effect.

Scope

  • Models keep the ability to opt out through supports_shared_draft_layers;
    MiniMax-M3 uses that to keep the separate manager for its coalesced
    index-K pool.
  • Disaggregated serving already forced sharing (the nvbugs/5807902 WAR), so
    this only changes the aggregated non-DP path.
  • Sharing has been exercised in CI on the attention-DP path since it was
    introduced; this widens which configurations reach it.

Draft — what still needs doing before this leaves draft

  • Confirm on a second model family (a Llama/Qwen Eagle3 or an MTP model)
    that aggregated non-DP acceptance improves and nothing regresses.
  • Memory review: the draft layers now allocate from the target's pool
    instead of their own budget split; check _split_kv_cache_budget_for_draft
    is not left double-counting for the shared path.
  • CI: an aggregated non-DP acceptance point, so the regression cannot come
    back silently.

PR Checklist

  • PR title follows the [JIRA/NVBUG/None][type] format
  • Commits are signed off (DCO)
  • CI (/bot run)

…nly under attention DP

One-model speculative decoding puts the drafter's KV either in the target
manager's blocks (shared) or in a separate draft manager. The choice was
gated on attention DP, which reflected the layout existing deployments had
been validated with rather than a technical requirement -- so aggregated
serving with attention DP off took the separate manager for every model.

That path silently costs acceptance whenever prefix reuse fires. When the
target reuses a prefix it does not recompute those tokens, so the drafter
never gets a chance to compute its own KV for them either; it enters
generation blind over the reused span and its drafts are rejected until it
regrows the state.

Measured with a controlled warm/cold probe (32 x 1684-token prompts sent
twice in one process; round 2 hits the prefix cache, so the two rounds
differ only in where the drafter's prefix KV comes from):

  arm                          cold    warm    delta
  separate manager, 4 KV heads 3.458   3.195   -0.263
  separate manager, 64 KV heads 3.555  3.282   -0.273
  shared layers,   4 KV heads  3.553   3.617   +0.064
  shared layers,   64 KV heads 3.603   3.596   -0.007
  reuse disabled (control)       --      --    +-0.02

The loss is the same for both Eagle3 head geometries, so it is a property
of the separate-manager path, not of a particular drafter; sharing removes
it. The control rules out a systematic round-2 effect.

A manager can still opt out through supports_shared_draft_layers, which is
how MiniMax-M3 keeps the separate manager for its coalesced index-K pool.

Signed-off-by: Zheyu Fu <zheyuf@nvidia.com>
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.

1 participant