From 770aed629163f0db22139b92f68a615eb251ab47 Mon Sep 17 00:00:00 2001 From: Mukesh Garg Date: Tue, 28 Jul 2026 22:24:38 -0700 Subject: [PATCH] =?UTF-8?q?analytical-viz:=20Auto=20Suggest=20tab=20?= =?UTF-8?q?=E2=80=94=20add=20Top-10=20by=20memory=20footprint=20table?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds a second table beneath the Pareto configurations table, sorted by (hbm_utilization ↑, pes_used ↑, latency ↑) — top 10 smallest-memory Pareto configs first. Columns highlight the memory story: HBM % | weights (GB) | KV (GB) | PEs | SIPs | lat (ms) | CP TP PP DP | kv | ffn | tp_place | cp_place Useful when memory pressure is the real binding constraint of a deployment — e.g., picking a config for a per-PE HBM-limited SIP, or spotting configs that trade small latency headroom for large memory savings. Co-Authored-By: Claude Opus 4.7 --- tests/analytical_visualization/app.py | 29 +++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/tests/analytical_visualization/app.py b/tests/analytical_visualization/app.py index df07fcb..b151e3c 100644 --- a/tests/analytical_visualization/app.py +++ b/tests/analytical_visualization/app.py @@ -1685,6 +1685,35 @@ def _render_auto_explore_tab(): _df = pd.DataFrame(_rows) st.dataframe(_df, width='stretch', hide_index=True) + # ── Top-N by memory (smallest → largest) ───────────────────── + st.markdown( + "**Top 10 configurations by memory footprint** " + "(smallest HBM% first). Useful when memory pressure is the " + "real binding constraint of your deployment." + ) + _pareto_by_mem = sorted( + _res.pareto_scores, + key=lambda s: (s.hbm_utilization, s.pes_used, s.total_latency_ns), + )[:10] + _mem_rows = [] + for i, s in enumerate(_pareto_by_mem): + _mem_rows.append({ + "#": i, + "HBM %": round(s.hbm_utilization * 100, 1), + "weights (GB)": round(s.weights_gb, 2), + "KV (GB)": round(s.kv_gb, 2), + "PEs": s.pes_used, + "SIPs": s.sips_used, + "lat (ms)": round(s.latency_ms, 3), + "CP": s.cp, "TP": s.tp, "PP": s.pp, "DP": s.dp, + "kv": s.kv_shard_mode, + "ffn": s.ffn_shard_scope, + "tp_place": s.tp_placement, + "cp_place": s.cp_placement, + }) + _df_mem = pd.DataFrame(_mem_rows) + st.dataframe(_df_mem, width='stretch', hide_index=True) + # ── Parallelism sensitivity subplots ────────────────────── st.markdown( "**Parallelism sensitivity** — for the *baseline* config picked "