Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI][Spec Decode] fix: broken test for EAGLE model #11972

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: eagle test failed
Signed-off-by: Sungjae Lee <[email protected]>
  • Loading branch information
llsj14 committed Jan 12, 2025
commit 5a73145747bead80dab107734c5423461c1dc31c
8 changes: 7 additions & 1 deletion vllm/model_executor/models/eagle.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@

class DummyInputLayerNorm(nn.Module):

def __init__(self, weight=None, bias=None):
super().__init__()
self.weight = nn.Parameter(weight) if weight is not None else None
self.bias = nn.Parameter(bias) if bias is not None else None

def forward(self, x):
return x

Expand Down Expand Up @@ -69,7 +74,8 @@ def __init__(self, *, vllm_config: VllmConfig, prefix: str = ""):

# Modify layer normalization and residual connections as suggested
# in the EAGLE framework: https://github.com/SafeAILab/EAGLE
self.model.model.layers[0].input_layernorm = DummyInputLayerNorm()
self.model.model.layers[0].input_layernorm = DummyInputLayerNorm(
weight=self.model.model.layers[0].input_layernorm.weight)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the standard EAGLE model checkpoint, this part is not necessary. However, the EAGLE model ("abhigoyal/vllm-eagle-llama-68m-random") used in spec_decode/e2e/test_eagle_correctness.py contains an input layernorm in its checkpoint. If I simply remove the weight in this DummyInputLayerNorm, it could cause errors when loading the model's weights.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Can you please add a comment on the need to have these weights for some of the unit tests that we have?

self.model.model.norm = DummyOutputNorm()

self.orig_vocab_size = config.vocab_size
Expand Down