Update llama.py

This commit is contained in:
Daniel Han-Chen 2024-02-01 23:54:01 +11:00
commit da64d3403c

View file

@ -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[:,:,:seq_len,:] = K1
self.paged_attention_V[:,:,:seq_len,:] = V1
pass
Kn = self.paged_attention_K[:,:,seq_len,:] = Kn
Vn = self.paged_attention_V[:,:,seq_len,:] = Vn