[QSA] Tag every raw-key ring row and validate it before pooling
The fused pre-indexer could read a stale or uncommitted raw-key ring row and pass its int64 tail to RoPE as a position (illegal address). The writer now tags each row with logical_position + 1; the reader checks the tag of every source row and, on a mismatch, masks the pooled load, the RoPE-tail read and the compressed-slot store. New guard site 11 (always fatal under warn). The KV pool size is unchanged. Co-Authored-By: Hinata <hinata@idihore.id> Signed-off-by: MOVZX <movzx@yahoo.com>
This commit is contained in:
@@ -180,6 +180,7 @@ from vllm.v1.worker.gpu.ubatch_utils import (
|
||||
maybe_build_ubatch_runner,
|
||||
)
|
||||
from vllm.v1.worker.lora_model_runner_mixin import LoRAModelRunnerMixin
|
||||
from vllm.v1.worker.ring_tags import clear_ring_row_tags, ring_tag_layers
|
||||
from vllm.v1.worker.utils import (
|
||||
KVBlockZeroer,
|
||||
clear_layer_kv_caches,
|
||||
@@ -1326,6 +1327,15 @@ class GPUModelRunner(LoRAModelRunnerMixin):
|
||||
assert self.kv_block_zeroer is not None
|
||||
self.kv_block_zeroer.zero_block_ids(scheduler_output.new_block_ids_to_zero)
|
||||
|
||||
# v2.2 ring-row tag fix: clear the tag words of newly claimed ring blocks. Not
|
||||
# under the zeroing gate; after the zeroer, before copies and forward.
|
||||
if scheduler_output.new_ring_block_ids_to_clear:
|
||||
clear_ring_row_tags(
|
||||
ring_tag_layers(self.compilation_config.static_forward_context),
|
||||
scheduler_output.new_ring_block_ids_to_clear,
|
||||
self.device,
|
||||
)
|
||||
|
||||
# Apply copy-on-write block copies for partial prefix-cache hits, after
|
||||
# zeroing new blocks and before the forward pass reads them.
|
||||
if scheduler_output.kv_cache_block_copies:
|
||||
|
||||
Reference in New Issue
Block a user