[Worker] Capture-safe guard-telemetry infrastructure, default off
Shared machinery for device-side bounds guards: persistent int64 counters per site, written by guarded kernels and read by a background thread. The reader starts only after warm-up and CUDA-graph capture and never waits on the compute stream; a read failure arms the stop rather than popping the buffer. Shutdown does one synchronous final drain so a hit on the last step is reported before teardown. Release default: off. Co-Authored-By: Hinata <hinata@idihore.id> Signed-off-by: MOVZX <movzx@yahoo.com>
This commit is contained in:
@@ -80,6 +80,7 @@ from vllm.v1.watermarking.spec_decode import (
|
||||
create_speculative_target_watermarker,
|
||||
speculative_target_watermark_key,
|
||||
)
|
||||
from vllm.v1.worker import guard_telemetry
|
||||
from vllm.v1.worker.block_table import get_block_table_width
|
||||
from vllm.v1.worker.cp_utils import check_attention_cp_compatibility
|
||||
from vllm.v1.worker.gpu import pcp_manager as pcp
|
||||
@@ -203,6 +204,10 @@ class GPUModelRunner(LoRAModelRunnerMixin):
|
||||
self.jit_warmup_registry = JitWarmupRegistry(vllm_config)
|
||||
|
||||
self.device = device
|
||||
# Bounds-guard instrumentation: allocate the guard counters now, while we are certainly
|
||||
# not capturing. The thread that READS them starts much later, from
|
||||
# gpu_worker after capture. See guard_telemetry.start_reader.
|
||||
guard_telemetry.prealloc(device)
|
||||
self.dtype = self.model_config.dtype
|
||||
self.kv_cache_dtype = self.dtype
|
||||
if self.cache_config.cache_dtype != "auto":
|
||||
@@ -1708,6 +1713,10 @@ class GPUModelRunner(LoRAModelRunnerMixin):
|
||||
randomize_inputs: bool = False,
|
||||
) -> ModelRunnerOutput | IntermediateTensors | None:
|
||||
if not dummy_run:
|
||||
# Bounds-guard instrumentation: raise on the engine thread if a bounds guard fired.
|
||||
# A Python bool; adds no device sync to the step. Late and
|
||||
# rank-local -- see guard_telemetry.check_pending.
|
||||
guard_telemetry.check_pending()
|
||||
# Update the request states.
|
||||
self.update_pp_decode_requests()
|
||||
self.finish_requests(scheduler_output)
|
||||
|
||||
Reference in New Issue
Block a user