vllm.benchmarks.plot
¶
Generate plots for benchmark results.
Functions:
-
construct_timeline_data–Construct timeline data from request results.
-
generate_dataset_stats_plot–Generate a matplotlib figure with dataset statistics.
-
generate_timeline_plot–Generate an HTML timeline plot from benchmark results.
construct_timeline_data(requests_data, itl_thresholds, labels)
¶
generate_dataset_stats_plot(results, output_path)
¶
Generate a matplotlib figure with dataset statistics.
Creates a figure with 4 subplots: - Top-left: Prompt tokens distribution (histogram) - Top-right: Output tokens distribution (histogram) - Bottom-left: Prompt+output tokens distribution (histogram) - Bottom-right: Stacked bar chart (request_id vs tokens)
Parameters:
generate_timeline_plot(results, output_path, colors=None, itl_thresholds=None, labels=None)
¶
Generate an HTML timeline plot from benchmark results.
Parameters:
-
(results¶list[dict[str, Any]]) –List of per-request result dictionaries containing: - start_time: Request start time (seconds) - ttft: Time to first token (seconds) - itl: List of inter-token latencies (seconds) - latency: Total request latency (seconds) - prompt_len: Number of prompt tokens - output_tokens: Number of output tokens
-
(output_path¶Path) –Path where the HTML file will be saved
-
(colors¶list[str] | None, default:None) –List of colors for ITL categories (default: green, orange, red, black)
-
(itl_thresholds¶list[float] | None, default:None) –ITL thresholds in seconds (default: [1.0, 4.0, 6.0])
-
(labels¶list[str] | None, default:None) –Labels for ITL categories (default based on thresholds)