Update llama.py
This commit is contained in:
parent
e0ea238256
commit
5f3c51b394
1 changed files with 3 additions and 3 deletions
|
|
@ -265,8 +265,8 @@ def LlamaAttention_fast_forward_inference(
|
|||
self.paged_attention = torch.empty((2, bsz, n_kv_heads, 2048, head_dim), dtype = dtype, device = "cuda")
|
||||
self.paged_attention_K = self.paged_attention[0]
|
||||
self.paged_attention_V = self.paged_attention[1]
|
||||
self.paged_attention_K[:,:,:kv_seq_len,:] = K1
|
||||
self.paged_attention_V[:,:,:kv_seq_len,:] = V1
|
||||
self.paged_attention_K[:,:,:kv_seq_len,:] = Kn
|
||||
self.paged_attention_V[:,:,:kv_seq_len,:] = Vn
|
||||
pass
|
||||
Kn = self.paged_attention_K[:,:,seq_len,:] = K1
|
||||
Vn = self.paged_attention_V[:,:,seq_len,:] = V1
|
||||
|
|
@ -346,7 +346,7 @@ def LlamaAttention_fast_forward(
|
|||
position_ids,
|
||||
)
|
||||
return A, None, past_key_value
|
||||
elif hasattr(self, "paged_attention_K"):
|
||||
elif hasattr(self, "paged_attention"):
|
||||
del self.paged_attention_K
|
||||
del self.paged_attention_V
|
||||
del self.paged_attention
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue