()
| 367 | fontweight="bold", |
| 368 | color=ann_color, |
| 369 | ) |
| 370 | |
| 371 | ax.set_xticks(range(n_conc)) |
| 372 | ax.set_xticklabels([str(int(c)) for c in concurrencies]) |
| 373 | ax.set_xlabel("Batch Size") |
| 374 | ax.set_ylabel("Median TPOT (ms)") |
| 375 | ax.set_title(f"E2E Speedups for {model} TP{tp}") |
| 376 | ax.grid(axis="y", alpha=0.3) |
| 377 | |
| 378 | if legend_handles: |
| 379 | ax.legend( |
| 380 | legend_handles.values(), |
| 381 | legend_handles.keys(), |
| 382 | loc="upper left", |
| 383 | framealpha=0.9, |
| 384 | ) |
| 385 | |
| 386 | fig.tight_layout() |
| 387 | out = strips_dir / f"{model}.{fmt}" |
| 388 | fig.savefig(out, dpi=150, bbox_inches="tight") |
| 389 | plt.close(fig) |
| 390 | print(f"Saved to {out}") |
| 391 | |
| 392 | |
| 393 | def main(): |
| 394 | parser = argparse.ArgumentParser(description="Plot TPOT and speedup from vLLM benchmarks") |
| 395 | parser.add_argument( |
| 396 | "--results-dir", |
| 397 | type=Path, |
| 398 | default=Path(__file__).parent, |
| 399 | help="Directory containing model subdirectories (default: benchmarking/vllm/)", |
| 400 | ) |
| 401 | parser.add_argument( |
| 402 | "--fmt", |
| 403 | default="png", |
| 404 | help="Output image format (default: png)", |
| 405 | ) |
| 406 | parser.add_argument( |
no test coverage detected