[Bugfix][KVConnector] Disable cross-layer KV blocks for per-token-head quant (#49226)

Signed-off-by: Achyuthan Sivasankar <achyuthan.sivasankar@gmail.com>
Co-authored-by: Or Ozeri <oro@il.ibm.com>
This commit is contained in:
achyuthan.s
2026-07-26 05:24:27 +03:00
committed by GitHub
co-authored by Or Ozeri
parent b153ae6089
commit 48ebd6f2f1
@@ -155,6 +155,10 @@ class KVConnectorModelRunnerMixin:
kv_cache_spec = attn_group.kv_cache_spec
if not isinstance(kv_cache_spec, AttentionSpec):
return False
# Per-token-head quant carves inline-scale views that assume per-layer
# contiguous KV buffers; the cross-layer layout breaks this and corrupts KV.
if kv_cache_spec.kv_quant_mode.is_per_token_head:
return False
return kv_cache_spec.indexes_kv_by_block_stride
@staticmethod