@@ -160,8 +160,6 @@ def __init__(self, *, vllm_config: "VllmConfig", prefix: str = ""):
160160 """Mapping from layer index to layer name for Eagle3."""
161161 self ._output_aux_hidden_states_kwargs : dict [str , bool ] = {}
162162 """Kwargs to pass to model forward for Eagle3 aux hidden states."""
163- self ._aux_embeddings = False
164- """Whether layer 0 (the input embeddings) is an Eagle3 aux hidden state."""
165163
166164 if self .quant_config :
167165 quant_method_name = self .quant_config .get_name ()
@@ -804,13 +802,6 @@ def forward(
804802 if input_ids is not None and inputs_embeds is not None :
805803 input_ids = None
806804
807- aux_embeddings = None
808- if self ._aux_embeddings :
809- if inputs_embeds is None :
810- inputs_embeds = self .embed_input_ids (input_ids )
811- input_ids = None
812- aux_embeddings = inputs_embeds [0 , ...]
813-
814805 outputs = self .model (
815806 input_ids = input_ids ,
816807 inputs_embeds = inputs_embeds ,
@@ -823,16 +814,13 @@ def forward(
823814
824815 # Remove batch dimension after exiting Transformers model
825816 hidden_states = outputs [0 ][0 , ...]
826- aux_hidden_states = []
827817 if self ._output_aux_hidden_states_kwargs :
828818 aux_hidden_states = [x [0 ][0 , ...] for x in outputs [1 :]]
829- if aux_embeddings is not None :
830- aux_hidden_states .insert (0 , aux_embeddings )
831819
832820 if not self .pp_group .is_last_rank :
833821 return IntermediateTensors ({"hidden_states" : hidden_states })
834822
835- if aux_hidden_states :
823+ if self . _output_aux_hidden_states_kwargs and len ( aux_hidden_states ) > 0 :
836824 return hidden_states , aux_hidden_states
837825 return hidden_states
838826
@@ -865,11 +853,7 @@ def set_aux_hidden_state_layers(self, layers: tuple[int, ...]) -> None:
865853 self .model ._can_record_outputs = {}
866854
867855 target_class = self ._target_class
868- # The input to layer 0 is captured in `forward`
869- self ._aux_embeddings = 0 in layers
870856 for layer in layers :
871- if layer == 0 :
872- continue
873857 # layer - 1 because we want the input to the layer
874858 layer_name = self ._layer_names [layer - 1 ]
875859 layer_key = f"aux_hidden_state_{ layer } "
0 commit comments