Fix DCP KV head mapping for GQA models (#32858)

Co-authored-by: Khoa Pham <khoa.pham@radixark.ai>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
YAMY
2026-08-08 14:25:09 -07:00
committed by GitHub
co-authored by Khoa Pham Claude Opus 5
parent c2d90db1e3
commit a59bb931c6
17 changed files with 172 additions and 63 deletions
@@ -96,7 +96,7 @@ def _make_model_runner(
)
mc.swa_head_dim = swa_head_dim or head_dim
mc.swa_v_head_dim = swa_v_head_dim or v_head_dim
mc.get_num_kv_heads = lambda tp_size: num_kv_heads
mc.get_num_kv_heads = lambda tp_size, dcp_size=1: num_kv_heads
mc.get_swa_num_kv_heads = lambda tp_size: swa_num_kv_heads or num_kv_heads
mc.hf_config = SimpleNamespace(architectures=["LlamaForCausalLM"])
mc.hf_config.get_text_config = lambda: mc.hf_config