Skip to content

Commit 98f006e

Browse files
committed
refine code
1 parent e38c664 commit 98f006e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lightllm/models/deepseek2/layer_infer/transformer_layer_infer.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,14 +230,15 @@ def _context_attention_kernel_with_v(
230230
self, q: Tuple[torch.Tensor, torch.Tensor], k, v, infer_state: LlamaInferStateInfo, layer_weight, out=None
231231
) -> torch.Tensor:
232232
q_nope, q_rope = q
233+
k_nope, k_rope = k
233234
nope_head_dim = q_nope.shape[-1]
234235
o_tensor = self.alloc_tensor(q_nope.shape, dtype=q_nope.dtype) if out is None else out
235236
if infer_state.use_dynamic_prompt_cache:
236237
context_attention_fwd_with_v(
237238
q_nope,
238239
q_rope,
239-
k[0],
240-
k[1],
240+
k_nope,
241+
k_rope,
241242
v,
242243
o_tensor.view(-1, self.tp_q_head_num_, nope_head_dim),
243244
infer_state.b_req_idx,
@@ -252,8 +253,8 @@ def _context_attention_kernel_with_v(
252253
context_attention_fwd_no_prompt_cache_with_v(
253254
q_nope,
254255
q_rope,
255-
k[0],
256-
k[1],
256+
k_nope,
257+
k_rope,
257258
v,
258259
o_tensor.view(-1, self.tp_q_head_num_, nope_head_dim),
259260
infer_state.b_start_loc,

0 commit comments

Comments
 (0)