[Bugfix] Fix EAGLE vocab embedding construction for Llama 70B (#19033)

Signed-off-by: Benjamin Chislett <benjamin.chislett@centml.ai>
This commit is contained in:
Benjamin Chislett
2025-06-05 19:10:08 -07:00
committed by GitHub
parent c8134bea15
commit 3465b87ef8
7 changed files with 70 additions and 47 deletions
+7 -4
View File
@@ -330,16 +330,19 @@ class EagleProposer:
self.attn_layer_names = list(draft_attn_layer_names)
# share embed_tokens with the target model if needed
if get_pp_group().world_size == 1:
if get_pp_group().world_size == 1 \
and self.model.model.embed_tokens.weight.shape \
== target_model.model.embed_tokens.weight.shape:
logger.info(
"The EAGLE head shares the same vocab embedding" \
"Assuming the EAGLE head shares the same vocab embedding" \
" with the target model."
)
del self.model.model.embed_tokens
self.model.model.embed_tokens = target_model.model.embed_tokens
else:
logger.info(
"Since PP > 1, the EAGLE head loaded its own vocab embedding" \
" weights instead of sharing them with the target model."
"The EAGLE head's vocab embedding will be loaded separately" \
" from the target model."
)
# share lm_head with the target model if needed