We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f5cbcc1 commit c9decdbCopy full SHA for c9decdb
lightllm/models/deepseek2/infer_struct.py
@@ -10,5 +10,7 @@ def __init__(self):
10
11
def init_some_extra_state(self, model, input_ids: torch.Tensor):
12
super().init_some_extra_state(model, input_ids)
13
- self.kv_starts = torch.cat([self.b_start_loc, self.b_start_loc[-1:] + self.b_seq_len[-1:]], dim=0)
+ # 只有 decode 阶段使用 ppl 的优化算子才会有这个管理变量
14
+ if not self.is_prefill:
15
+ self.kv_starts = torch.cat([self.b_start_loc, self.b_start_loc[-1:] + self.b_seq_len[-1:]], dim=0)
16
return
0 commit comments