Skip to content

vllm.v1.worker.gpu.async_utils

Classes:

Functions:

  • new_d2h_stream –

    Create a stream for non_blocking D2H copies.

  • stream –

    Lightweight accelerator stream context manager which

AsyncOutput

Bases: AsyncModelRunnerOutput

Methods:

get_kv_connector_output()

Get the KV connector output for this async output.

AsyncPoolingOutput

Bases: AsyncModelRunnerOutput

Methods:

get_kv_connector_output()

Get the KV connector output for this async output.

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.

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.

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.

new_d2h_stream(device=None)

Create a stream for non_blocking D2H copies.

It must only carry copies: compute anything it copies on the producer stream first (see conf_compute_utils.new_external_d2h_stream()).

stream(to_stream, from_stream)

Lightweight accelerator stream context manager which avoids current_stream and device lookups.