File tree Expand file tree Collapse file tree 5 files changed +41
-9
lines changed Expand file tree Collapse file tree 5 files changed +41
-9
lines changed Original file line number Diff line number Diff line change @@ -168,7 +168,7 @@ cython_debug/
168168# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
169169# and can be added to the global gitignore or merged into this file. For a more nuclear
170170# option (not recommended) you can uncomment the following to ignore the entire idea folder.
171- # .idea/
171+ .idea /
172172
173173
174174# MacOS files
Original file line number Diff line number Diff line change 77import click
88
99from guidellm .backend import BackendType
10- from guidellm .benchmark import ProfileType , benchmark_generative_text
10+ from guidellm .benchmark import ProfileType , benchmark_generative_text , display_benchmarks_report
1111from guidellm .config import print_config
1212from guidellm .preprocess .dataset import ShortPromptStrategy , process_dataset
1313from guidellm .scheduler import StrategyType
@@ -282,6 +282,16 @@ def benchmark(
282282 )
283283
284284
285+ @cli .command (help = "Redisplay a saved benchmark report." )
286+ @click .argument (
287+ "path" ,
288+ type = click .Path (),
289+ default = Path .cwd () / "benchmarks.json" ,
290+ )
291+ def display (path ):
292+ asyncio .run (display_benchmarks_report (path ))
293+
294+
285295def decode_escaped_str (_ctx , _param , value ):
286296 """
287297 Click auto adds characters. For example, when using --pad-char "\n ",
Original file line number Diff line number Diff line change 1212 StatusBreakdown ,
1313)
1414from .benchmarker import Benchmarker , BenchmarkerResult , GenerativeBenchmarker
15- from .entrypoints import benchmark_generative_text
15+ from .entrypoints import benchmark_generative_text , display_benchmarks_report
1616from .output import GenerativeBenchmarksConsole , GenerativeBenchmarksReport
1717from .profile import (
1818 AsyncProfile ,
Original file line number Diff line number Diff line change 1+ import os
12from collections .abc import Iterable
23from pathlib import Path
34from typing import Any , Literal , Optional , Union
@@ -121,13 +122,8 @@ async def benchmark_generative_text(
121122 )
122123
123124 if output_console :
124- orig_enabled = console .enabled
125- console .enabled = True
126125 console .benchmarks = report .benchmarks
127- console .print_benchmarks_metadata ()
128- console .print_benchmarks_info ()
129- console .print_benchmarks_stats ()
130- console .enabled = orig_enabled
126+ console .print_full_report ()
131127
132128 if output_path :
133129 console .print_line ("\n Saving benchmarks report..." )
@@ -139,3 +135,12 @@ async def benchmark_generative_text(
139135 console .print_line ("\n Benchmarking complete." )
140136
141137 return report , saved_path
138+
139+ async def display_benchmarks_report (file : str ):
140+ console = GenerativeBenchmarksConsole (enabled = True )
141+ if not os .path .exists (file ):
142+ console .print_line (f"File { file } not found." )
143+ return
144+ report = GenerativeBenchmarksReport .load_file (file )
145+ console .benchmarks = report .benchmarks
146+ console .print_full_report ()
Original file line number Diff line number Diff line change @@ -944,3 +944,20 @@ def print_benchmarks_stats(self):
944944 title = "Benchmarks Stats" ,
945945 sections = sections ,
946946 )
947+
948+ def print_full_report (self ):
949+ """
950+ Print out the benchmark statistics to the console.
951+ Temporarily enables the console if it's disabled.
952+
953+ Format:
954+ - Metadata
955+ - Info
956+ - Stats
957+ """
958+ orig_enabled = self .enabled
959+ self .enabled = True
960+ self .print_benchmarks_metadata ()
961+ self .print_benchmarks_info ()
962+ self .print_benchmarks_stats ()
963+ self .enabled = orig_enabled
You can’t perform that action at this time.
0 commit comments