Skip to content
Merged
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
Eagle, use last hidden post norm
Signed-off-by: Izzy Putterman <iputterman@nvidia.com>
  • Loading branch information
IzzyPutterman committed Sep 15, 2025
commit e671c8d3e6a89f5e2a9affb6f74b8d0e2f506194
5 changes: 5 additions & 0 deletions tensorrt_llm/_torch/models/modeling_speculative.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ def __init__(self, model: TModel, model_config: ModelConfig[TConfig]):
assert key in ('attn_layers', 'mla_layers')
assert key in model_config.extra_attrs
model_config.extra_attrs[key].update(value)
self.layer_idx = -1

def forward(
self,
Expand All @@ -430,6 +431,10 @@ def forward(
**kwargs,
)

if spec_metadata is not None and spec_metadata.is_layer_capture(
self.layer_idx):
spec_metadata.maybe_capture_hidden_states(self.layer_idx,
hidden_states)
if attn_metadata.padded_num_tokens is not None:
hidden_states = hidden_states[:attn_metadata.num_tokens]

Expand Down