stormlog.infer.vllm_hook

Install the vLLM execution hook’s patches; see docs/vllm_execution.md.

install patches classes once per process: the scheduler, the engine core’s admission, and the GPU worker’s device setup. Whatever the process role, a multiproc executor that forks its workers hands them the already patched classes, while a spawned worker runs the plugin again. Each patched call records only for an instance whose configuration passed the gate, runs vLLM’s own code exactly once, and lets its exceptions through unchanged; telemetry failures are counted and never raised.

Functions

install([environ])

Patch whichever vLLM classes are importable; return what was patched.

producer_name(writer)

Names one scheduler's iterations: unique per host boot and process.

writer_for(settings, role[, status_fields])

One writer per process and role; a forked child gets its own.

stormlog.infer.vllm_hook.install(environ=environ({'READTHEDOCS_VIRTUALENV_PATH': '/home/docs/checkouts/readthedocs.org/user_builds/stormlog/envs/latest', 'READTHEDOCS_CANONICAL_URL': 'https://stormlog.readthedocs.io/en/latest/', 'HOSTNAME': 'build-34933807-project-1178985-stormlog', 'READTHEDOCS_GIT_CLONE_URL': 'https://github.com/Silas-Asamoah/stormlog.git', 'HOME': '/home/docs', 'NO_COLOR': '1', 'READTHEDOCS': 'True', 'READTHEDOCS_PRODUCTION_DOMAIN': 'app.readthedocs.org', 'READTHEDOCS_REPOSITORY_PATH': '/home/docs/checkouts/readthedocs.org/user_builds/stormlog/checkouts/latest', 'READTHEDOCS_PROJECT': 'stormlog', 'READTHEDOCS_OUTPUT': '/home/docs/checkouts/readthedocs.org/user_builds/stormlog/checkouts/latest/_readthedocs/', 'PATH': '/home/docs/checkouts/readthedocs.org/user_builds/stormlog/envs/latest/bin:/home/docs/.asdf/shims:/home/docs/.asdf/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', 'READTHEDOCS_VERSION_TYPE': 'branch', 'LANG': 'C.UTF-8', 'READTHEDOCS_LANGUAGE': 'en', 'DEBIAN_FRONTEND': 'noninteractive', 'READTHEDOCS_GIT_COMMIT_HASH': 'e099bc0cbd7d3053259f6620b37175d418b2a713', 'READTHEDOCS_VERSION_NAME': 'latest', 'READTHEDOCS_VERSION': 'latest', 'PWD': '/home/docs/checkouts/readthedocs.org/user_builds/stormlog/checkouts/latest/docs', 'READTHEDOCS_GIT_IDENTIFIER': 'main', 'DOCUTILSCONFIG': '/home/docs/checkouts/readthedocs.org/user_builds/stormlog/checkouts/latest/docs/docutils.conf', 'JAX_LOG_COMPILES': '0', 'TF_CPP_MIN_LOG_LEVEL': '2', 'TF_ENABLE_ONEDNN_OPTS': '0'}))[source]

Patch whichever vLLM classes are importable; return what was patched.

Parameters:

environ (Mapping[str, str])

Return type:

list[str]

stormlog.infer.vllm_hook.producer_name(writer)[source]

Names one scheduler’s iterations: unique per host boot and process.

Parameters:

writer (EpochWriter)

Return type:

str

stormlog.infer.vllm_hook.writer_for(settings, role, status_fields=None)[source]

One writer per process and role; a forked child gets its own.

Parameters:
  • settings (_Settings)

  • role (str)

  • status_fields (Callable[[], dict[str, Any]] | None)

Return type:

EpochWriter

Modules

engine

Engine-core snapshots: admissions, scheduled steps, their outputs, and exits.

gate

Decide, from vLLM's configured objects, whether the hook may record.

worker

Worker side: wrap each serving step's launches in its iteration range.

writer

The vLLM hook's raw log: one epoch directory per process and role.