vllm.v1.worker.gpu.async_utils ¶
Classes:
-
StepTimingCollector–Times the steps run inside
collect; record calls no-op outside it.
Functions:
-
stream–Lightweight version of torch.cuda.stream() context manager which
StepTimingCollector ¶
Times the steps run inside collect; record calls no-op outside it.
Every step gets its own events, so the steps queue back-to-back and the block resolves them all behind one sync on the way out.
Methods:
-
collect–Time every step run in this block.
-
drafter_end–Ends the step: only steps that reach here have a draft cost.
-
record_batch–Costs from different execution modes must not share a cost curve.
Source code in vllm/v1/worker/gpu/async_utils.py
collect() ¶
Time every step run in this block.
The yielded list holds one sample per timed step once the block exits; it stays empty inside the block, where the timings are still on device.
Source code in vllm/v1/worker/gpu/async_utils.py
drafter_end() ¶
Ends the step: only steps that reach here have a draft cost.
record_batch(input_batch, full_cudagraph) ¶
Costs from different execution modes must not share a cost curve.
stream(to_stream, from_stream) ¶
Lightweight version of torch.cuda.stream() context manager which avoids current_stream and device lookups.