streamline code; add intermediate saving support for ep

This commit is contained in:
ZihanWang314
2025-05-22 07:21:52 +00:00
parent 98fd21ce21
commit f38f67706c
123 changed files with 710 additions and 5601 deletions

View File

@@ -1721,7 +1721,7 @@ class DeepseekV2ForCausalLM(DeepseekV2PreTrainedModel):
if isinstance(past_key_values, Cache):
cache_length = past_key_values.get_seq_length()
past_length = past_key_values.seen_tokens
max_cache_length = past_key_values.get_max_length()
max_cache_length = past_key_values.get_max_cache_shape()
else:
cache_length = past_length = past_key_values[0][0].shape[2]
max_cache_length = None