Eagle3 DP attention for Qwen3 MoE (#12002)

This commit is contained in:
Rain H
2025-10-29 20:25:17 +08:00
committed by GitHub
parent 42f8ea4030
commit 750940ae36
9 changed files with 219 additions and 27 deletions
@@ -5,6 +5,7 @@ from typing import List, Optional, Tuple
import torch
from sglang.srt.distributed import get_tp_group
from sglang.srt.layers.dp_attention import get_attention_tp_group
from sglang.srt.layers.logits_processor import LogitsProcessorOutput
from sglang.srt.layers.sampler import get_token_ids_logprobs, get_top_logprobs
from sglang.srt.managers.schedule_batch import ScheduleBatch
@@ -117,7 +118,11 @@ class EAGLEWorker(TpModelWorker):
self.hot_token_id = None
# Init draft worker
with empty_context():
if server_args.enable_dp_attention and self.speculative_algorithm.is_eagle3():
ctx = draft_tp_context(get_attention_tp_group())
else:
ctx = empty_context()
with ctx:
super().__init__(
server_args=server_args,
gpu_id=gpu_id,