[Docs]Add documentation for bench serve visualization arguments (#40539)

Signed-off-by: Sophie du Couédic <sop@zurich.ibm.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
Sophie du Couédic
2026-04-23 15:48:29 -07:00
committed by GitHub
co-authored by gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
parent cde8d24710
commit ff2c2bd80a
5 changed files with 3943 additions and 9 deletions
+21 -8
View File
@@ -1611,14 +1611,12 @@ def add_cli_args(parser: argparse.ArgumentParser):
)
parser.add_argument(
"--timeline-itl-thresholds",
type=float,
nargs=2,
default=[25.0, 50.0],
metavar=("THRESHOLD1", "THRESHOLD2"),
type=str,
default="25,50",
help="ITL thresholds in milliseconds for timeline plot coloring. "
"Specify two values to categorize inter-token latencies into three groups: "
"below first threshold (green), between thresholds (orange), "
"and above second threshold (red). Default: 25 50 (milliseconds).",
"Specify two comma-separated values to categorize inter-token "
"latencies into three groups: below first threshold (green), "
"between thresholds (orange), and above second threshold (red).",
)
parser.add_argument(
"--plot-dataset-stats",
@@ -1637,6 +1635,19 @@ async def main_async(args: argparse.Namespace) -> dict[str, Any]:
random.seed(args.seed)
np.random.seed(args.seed)
# Validate timeline ITL thresholds
if args.plot_timeline:
try:
itl_thresholds = [
float(t.strip()) for t in args.timeline_itl_thresholds.split(",")
]
if len(itl_thresholds) != 2:
raise ValueError(
f"Expected 2 ITL threshold values, got {len(itl_thresholds)}"
)
except ValueError as e:
raise ValueError(f"Invalid --timeline-itl-thresholds format: {e}") from e
# Validate ramp-up arguments
if args.ramp_up_strategy is not None:
if args.request_rate != float("inf"):
@@ -1906,7 +1917,9 @@ async def main_async(args: argparse.Namespace) -> dict[str, Any]:
timeline_path = Path(file_name).with_suffix(".timeline.html")
# Convert thresholds from milliseconds to seconds
itl_thresholds_sec = [t / 1000.0 for t in args.timeline_itl_thresholds]
itl_thresholds_sec = [
float(t) / 1000.0 for t in args.timeline_itl_thresholds.split(",")
]
generate_timeline_plot(
per_request_data, timeline_path, itl_thresholds=itl_thresholds_sec
)