stormlog.infer.vllm_execution_devices

Map a profiler trace to the GPU it ran on, from the vLLM hook’s worker hellos.

Each worker epoch’s hello names the worker’s host, pid, CUDA ordinal and GPU UUID (docs/vllm_execution.md). A trace names its host and launching pids and spans a wall-clock window, so a worker epoch that was alive on that host, with that pid, across that window is the process that wrote it: its UUID is the trace’s device. A pid that no epoch covers, or that several do, is left for --device-uuid.

Functions

trace_wall_window(trace)

The wall-clock span of a trace's launches and GPU events, if any.

Classes

TraceBinding(status[, uuids, workers, ...])

The GPU UUIDs a trace's processes map to, and what could not be mapped.

WorkerEpoch(epoch, host, boot_id, pid, ...)

One worker process lifetime, as its hello and liveness records say.

WorkerIndex(workers[, directory])

Every worker epoch of a hook directory, ready to bind traces.

class stormlog.infer.vllm_execution_devices.TraceBinding(status, uuids=<factory>, workers=<factory>, ambiguous=<factory>, unmatched=<factory>)[source]

Bases: object

The GPU UUIDs a trace’s processes map to, and what could not be mapped.

Parameters:
  • status (str)

  • uuids (dict[int, dict[int, str]])

  • workers (dict[int, str])

  • ambiguous (dict[int, list[str]])

  • unmatched (list[int])

status: str
uuids: dict[int, dict[int, str]]
workers: dict[int, str]
ambiguous: dict[int, list[str]]
unmatched: list[int]
summary()[source]
Return type:

dict[str, Any]

class stormlog.infer.vllm_execution_devices.WorkerEpoch(epoch, host, boot_id, pid, engine_producer, cuda_ordinal, device_uuid, local_rank, rank, trace_rank_suffix, enabled, refused, started_wall_ns, last_seen_wall_ns, ended)[source]

Bases: object

One worker process lifetime, as its hello and liveness records say.

Parameters:
  • epoch (str)

  • host (str)

  • boot_id (str | None)

  • pid (int)

  • engine_producer (str | None)

  • cuda_ordinal (int | None)

  • device_uuid (str | None)

  • local_rank (int | None)

  • rank (dict[str, int])

  • trace_rank_suffix (str | None)

  • enabled (bool)

  • refused (str | None)

  • started_wall_ns (int | None)

  • last_seen_wall_ns (int | None)

  • ended (bool)

epoch: str
host: str
boot_id: str | None
pid: int
engine_producer: str | None
cuda_ordinal: int | None
device_uuid: str | None
local_rank: int | None
rank: dict[str, int]
trace_rank_suffix: str | None
enabled: bool
refused: str | None
started_wall_ns: int | None
last_seen_wall_ns: int | None
ended: bool
covers(start_wall_ns, end_wall_ns)[source]

Whether this process was alive across the whole window.

Parameters:
  • start_wall_ns (int)

  • end_wall_ns (int)

Return type:

bool

class stormlog.infer.vllm_execution_devices.WorkerIndex(workers, directory=None)[source]

Bases: object

Every worker epoch of a hook directory, ready to bind traces.

Parameters:
  • workers (Sequence[WorkerEpoch])

  • directory (Path | None)

classmethod from_log(read)[source]
Parameters:

read (LogRead)

Return type:

WorkerIndex

classmethod from_directory(directory, *, importer=None)[source]
Parameters:
  • directory (str | Path)

  • importer (Importer | None)

Return type:

WorkerIndex

bind_trace(trace)[source]

Bind a loaded trace by its host, launching pids and time window.

Parameters:

trace (KinetoTrace)

Return type:

TraceBinding

bind(*, host, pids, start_wall_ns, end_wall_ns)[source]

The one worker epoch per pid alive on host across the window.

Parameters:
  • host (str | None)

  • pids (Iterable[int])

  • start_wall_ns (int)

  • end_wall_ns (int)

Return type:

TraceBinding

summary()[source]
Return type:

dict[str, Any]

stormlog.infer.vllm_execution_devices.trace_wall_window(trace)[source]

The wall-clock span of a trace’s launches and GPU events, if any.

Parameters:

trace (KinetoTrace)

Return type:

tuple[int, int] | None