[Bugfix] Fix stale common_attn_metadata.max_seq_len in speculative decoding with Eagle (#32312)
Signed-off-by: Ofir Zafrir <ofir.zafrir@intel.com>
This commit is contained in:
@@ -466,6 +466,12 @@ class EagleProposer:
|
||||
# For the requests that exceed the max model length, we set the
|
||||
# sequence length to 1 to minimize their overheads in attention.
|
||||
common_attn_metadata.seq_lens.masked_fill_(exceeds_max_model_len, 1)
|
||||
# Increment the maximum sequence length. We increment max_seq_len
|
||||
# unconditionally even though some seq_lens may have been capped above,
|
||||
# as max_seq_len serves as an upper bound for sequence lengths.
|
||||
common_attn_metadata.max_seq_len = min(
|
||||
common_attn_metadata.max_seq_len + 1, self.max_model_len
|
||||
)
|
||||
|
||||
# Also update the CPU-side shadow; NOTE: this is hacky and should be
|
||||
# removed in when common_attn_metadata.seq_lens_cpu is deprecated.
|
||||
|
||||
Reference in New Issue
Block a user