Eagle: GPT-OSS Eagle v2 support (#14920)
Signed-off-by: Izzy Putterman <iputterman@nvidia.com>
This commit is contained in:
@@ -100,7 +100,10 @@ class EAGLEDraftExtendCudaGraphRunner:
|
||||
(3, self.max_num_token), dtype=torch.int64
|
||||
)
|
||||
|
||||
if self.eagle_worker.speculative_algorithm.is_eagle3():
|
||||
if (
|
||||
self.eagle_worker.speculative_algorithm.is_eagle3()
|
||||
and self.eagle_worker.eagle_use_aux_hidden_state
|
||||
):
|
||||
self.hidden_states = torch.zeros(
|
||||
(
|
||||
self.max_num_token,
|
||||
|
||||
@@ -186,6 +186,15 @@ class EAGLEWorker(TpModelWorker):
|
||||
self.draft_tp_context = (
|
||||
draft_tp_context if server_args.enable_dp_attention else empty_context
|
||||
)
|
||||
self.eagle_use_aux_hidden_state = False
|
||||
if self.speculative_algorithm.is_eagle3():
|
||||
self.eagle_use_aux_hidden_state = True
|
||||
eagle_config = getattr(
|
||||
self.draft_model_runner.model_config.hf_config, "eagle_config", {}
|
||||
)
|
||||
self.eagle_use_aux_hidden_state = eagle_config.get(
|
||||
"use_aux_hidden_state", True
|
||||
)
|
||||
with self.draft_tp_context(
|
||||
self.draft_model_runner.tp_group
|
||||
), speculative_moe_backend_context(), speculative_moe_a2a_backend_context():
|
||||
@@ -895,6 +904,7 @@ class EAGLEWorker(TpModelWorker):
|
||||
hidden_size = (
|
||||
self.model_config.hidden_size * 3
|
||||
if self.speculative_algorithm.is_eagle3()
|
||||
and self.eagle_use_aux_hidden_state
|
||||
else self.model_config.hidden_size
|
||||
)
|
||||
batch.spec_info = EagleDraftInput.create_idle_input(
|
||||
|
||||
Reference in New Issue
Block a user