[NPU] enhance accuracy for model kimi-vl-a3b-instruct (#17480)

Co-authored-by: cy <chenyang08056032@163.com>
This commit is contained in:
McZyWu
2026-01-30 15:19:42 +08:00
committed by GitHub
parent 33c053c50c
commit 70db3398d1
2 changed files with 32 additions and 0 deletions

View File

@@ -103,6 +103,10 @@ def forward_mha_prepare_npu(
k_pe = latent_cache[:, :, m.kv_lora_rank :]
if m.rotary_emb is not None:
q_pe, k_pe = m.rotary_emb(positions, q_pe, k_pe)
# this is for model kimi-vl-a3B-instruct
forward_batch.token_to_kv_pool.set_kv_buffer(
m, forward_batch.out_cache_loc, kv_a.unsqueeze(1), k_pe
)
q[..., m.qk_nope_head_dim :] = q_pe