Split rotary heads
×Partition the rotary features into 128 heads.
- in
- [B batch, T positions, 8192 heads × rotary]
- out
- [B batch, 128 heads, T positions, 64 rotary]
Sources
In codeq.view(bsz, seqlen, self.n_local_heads, self.qk_head_dim)
Direct evidence
Queries are produced through a low-rank latent, split into a non-rotated and a rotated part, and rotated.
model.py 560–564 ↗ · deepseek-ai/DeepSeek-V3.2-Exp @ 87e509a2e5a1
Excerpt
qr = self.q_norm(self.wq_a(x))
q = self.wq_b(qr)
q = q.view(bsz, seqlen, self.n_local_heads, self.qk_head_dim)
q_nope, q_pe = torch.split(q, [self.qk_nope_head_dim, self.qk_rope_head_dim], dim=-1)
q_pe = apply_rotary_emb(q_pe, freqs_cis)