[KV Connector][NIXL] Reject NVFP4 KV cache with heterogeneous TP head split (#61865)
Signed-off-by: NickLucche <nicolo.lucchesi@mistral.ai> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Kevin H. Luu <khluu000@gmail.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
Kevin H. Luu
parent
c414bf0295
commit
33212db2c2
@@ -82,6 +82,7 @@ from vllm.utils.math_utils import cdiv
|
||||
from vllm.utils.network_utils import make_zmq_path
|
||||
from vllm.utils.torch_utils import async_tensor_h2d
|
||||
from vllm.v1.kv_cache_interface import (
|
||||
AttentionSpec,
|
||||
CircularBufferSpec,
|
||||
FullAttentionSpec,
|
||||
KVCacheLayout,
|
||||
@@ -2671,6 +2672,22 @@ class NixlBaseConnectorWorker:
|
||||
"Heterogeneous TP head-dimension splitting requires contiguous heads. "
|
||||
"Use a block-contiguous layout (e.g. LBHNC) on the prefill side."
|
||||
)
|
||||
# NVFP4 pages store all heads' data before all heads' scales, so a
|
||||
# head's bytes are not a contiguous slice of the page.
|
||||
if (
|
||||
not self.use_mla
|
||||
and self.transfer_topo.local_physical_heads
|
||||
!= max(1, self.transfer_topo.total_num_kv_heads // remote_tp_size)
|
||||
and any(
|
||||
isinstance(spec, AttentionSpec) and spec.kv_quant_mode.is_nvfp4
|
||||
for spec in self._layer_specs.values()
|
||||
)
|
||||
):
|
||||
raise RuntimeError(
|
||||
"NIXL KV-head re-sharding is not supported for NVFP4 KV cache "
|
||||
f"(local TP {self.transfer_topo.tp_size}, remote TP "
|
||||
f"{remote_tp_size}). Use matching TP sizes on prefill and decode."
|
||||
)
|
||||
|
||||
# Per-region block_len validation enforcing the P/D invariant.
|
||||
# REPLICATE regions (MLA, or a whole-model MLA / replicated-KV transfer)
|
||||
|
||||
Reference in New Issue
Block a user