Split rotary heads
×Partition the rotary features into 64 heads.
- in
- [B batch, T positions, 4096 heads × rotary]
- out
- [B batch, 64 heads, T positions, 64 rotary]
Sources
In codeq.view(bsz, q_len, self.num_heads, self.q_head_dim).transpose(1, 2)
Direct evidence
Queries are produced through a low-rank latent and split into a non-rotated and a rotated part.
modeling_deepseek.py 767–773 ↗ · moonshotai/Kimi-K2.5 @ 4d01dfe0332d
Excerpt
if self.q_lora_rank is None:
q = self.q_proj(hidden_states)
else:
q = self.q_b_proj(self.q_a_layernorm(self.q_a_proj(hidden_states)))
q = q.view(bsz, q_len, self.num_heads, self.q_head_dim).transpose(1, 2)
q_nope, q_pe = torch.split(
q, [self.qk_nope_head_dim, self.qk_rope_head_dim], dim=-1)