GKCY / dlsys-notes

Apache License 2.0
1 stars 0 forks source link

llama2源码阅读 #5

Open GKCY opened 8 months ago

GKCY commented 8 months ago

LlamaAttention

  1. repeatkv是什么作用?self.num_key_value_groups变量的作用?
  2. attention_mask作为forward( )的入参,是怎么变化的?
  3. kvcache的原理,见Understanding Llama2,动态图很形象
  4. attention mask的原理
  5. LlamaAttention中分组注意力的机制,num_heads,num_key_value_heads,num_key_value_groups的作用