vllm.utils.lite_profiler ¶
Lightweight profiler for timing code execution with minimal overhead.
Modules:
Name | Description |
---|---|
lite_profiler | Minimal helpers for opt-in lightweight timing collection. |
lite_profiler_report | Summarize a single vLLM lite-profiler log in tabular form. |
LiteScope ¶
Lightweight context manager for timing code blocks with minimal overhead.
This class provides a simple way to measure and log the execution time of code blocks using Python's context manager protocol (with statement). It's designed for high-frequency profiling with minimal performance impact.
Source code in vllm/utils/lite_profiler/lite_profiler.py
__enter__ ¶
__exit__ ¶
__exit__(
exc_type: type[BaseException] | None,
exc_value: BaseException | None,
traceback: TracebackType | None,
) -> None
Source code in vllm/utils/lite_profiler/lite_profiler.py
maybe_emit_lite_profiler_report ¶
Generate and display a summary report of profiling data if available.
This function serves as the main entry point for analyzing and displaying profiling results. It checks if profiling was enabled and a log file exists, then delegates to the lite_profiler_report module to generate statistics like function call counts, timing distributions, and performance insights.