MCPcopy Create free account
hub / github.com/FlashSampling/FlashSampling / plot_speedups

Function plot_speedups

benchmarking/vllm/plot_tpot.py:223–253  ·  view source on GitHub ↗
(
    results_dir: Path, imgs_dir: Path, max_concurrency: int, fmms_name: str, fmt: str = "png"
)

Source from the content-addressed store, hash-verified

221 color="gray",
222 style="italic",
223 )
224
225 fig.tight_layout()
226 out = tpots_dir / f"{model}.{fmt}"
227 fig.savefig(out, dpi=150, bbox_inches="tight")
228 plt.close(fig)
229 print(f"Saved to {out}")
230
231
232# ---------------------------------------------------------------------------
233# Per-model speedup plots (imgs/speedups/)
234# ---------------------------------------------------------------------------
235
236
237def plot_speedups(
238 results_dir: Path, imgs_dir: Path, max_concurrency: int, fmms_name: str, fmt: str = "png"
239):
240 speedups_dir = imgs_dir / "speedups"
241 tp = tp_from_dir(results_dir)
242
243 for model in MODELS:
244 model_dirs = resolve_model_dirs(results_dir, model)
245 if not model_dirs:
246 continue
247 candidate_series = []
248 for candidate_dir, candidate_name in [(FI2_DIR, FI2_NAME), (FMMS_DIR, fmms_name)]:
249 sdf = paired_speedups(model_dirs, candidate_dir, max_concurrency)
250 if not sdf.empty:
251 candidate_series.append((candidate_name, sdf))
252 if not candidate_series:
253 continue
254
255 speedups_dir.mkdir(parents=True, exist_ok=True)
256 fig, ax = plt.subplots(figsize=FIGSIZE)

Callers 1

mainFunction · 0.85

Calls 4

tp_from_dirFunction · 0.85
resolve_model_dirsFunction · 0.85
paired_speedupsFunction · 0.85
_plot_scatter_lineFunction · 0.85

Tested by

no test coverage detected