Skip to content

Commit 60501f8

Browse files
rahul-tuliclaude
andcommitted
fix: Update no_rope_layers configuration validation for Eagle3
Fixes IndexError during draft model initialization by properly padding no_rope_layers configuration to match the exact pattern from llama4_eagle.py. The configuration validation now correctly handles layer offset for speculative decoding compatibility. Co-Authored-By: Claude <[email protected]> Signed-off-by: Rahul Tuli <[email protected]>
1 parent 94bc6ba commit 60501f8

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

vllm/model_executor/models/llama4_eagle3.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,12 @@ def __init__(
107107
# Single decoder layer following Eagle3 pattern
108108
# The layer ID is offset by target model depth to maintain
109109
# correct parameter naming and quantization mappings
110-
self.layer = nn.ModuleList([
110+
self.layers = nn.ModuleList([
111111
Llama4DecoderLayer(
112112
self.config,
113113
quant_config=quant_config,
114-
prefix=maybe_prefix(prefix, f"layers.{start_layer_id}"),
115-
)
114+
prefix=maybe_prefix(prefix, f"layers.{i + start_layer_id}"),
115+
) for i in range(self.config.num_hidden_layers)
116116
])
117117

118118
# Eagle3 auxiliary hidden state combination layer
@@ -273,10 +273,11 @@ def _validate_and_update_config(
273273
"Mixture of Experts layers are not supported in Eagle3 draft models"
274274
)
275275

276-
# Pad layer-specific configurations for start_layer_id offset
277-
# This ensures correct behavior when draft layers have offset indices
278-
self.config.no_rope_layers = (
279-
[0] * start_layer_id + getattr(self.config, 'no_rope_layers', []))
276+
# Draft model layer index is increased by start_layer_id,
277+
# so we need to pad relevant configs accordingly
278+
self.config.no_rope_layers = [
279+
0
280+
] * start_layer_id + self.config.no_rope_layers
280281

281282
# Update quantization configuration for layer offset
282283
if isinstance(quant_config, TorchAOConfig):

0 commit comments

Comments
 (0)