diff --git a/tests/analytical_visualization/app.py b/tests/analytical_visualization/app.py index 43ade29..df07fcb 100644 --- a/tests/analytical_visualization/app.py +++ b/tests/analytical_visualization/app.py @@ -237,12 +237,15 @@ with st.sidebar.expander("Parallelism", expanded=True): "`pe_hbm_gb` or reducing `s_kv`." ) else: - # Compound key: min latency, then fewer PEs, then lower HBM %. - # Prefer smaller-footprint configs when they tie on latency. + # Smallest-fit Pareto point: fewest PEs first, then lowest + # HBM utilization, then fastest latency as final tiebreaker. + # Gives the smallest deployment that's still Pareto-optimal + # for the chosen scope (matches how the memory-min autosuggest + # thinks — but restricted to this scope's Pareto set). _sb_best = min(_sb_res.pareto_scores, - key=lambda s: (s.total_latency_ns, - s.pes_used, - s.hbm_utilization)) + key=lambda s: (s.pes_used, + s.hbm_utilization, + s.total_latency_ns)) st.session_state["cp"] = _snap(_sb_best.cp, _CP_OPTS) st.session_state["tp"] = _snap(_sb_best.tp, _TP_OPTS) st.session_state["pp"] = _snap(_sb_best.pp, _PP_OPTS) @@ -584,11 +587,11 @@ with tab_layout: "`s_kv`." ) else: - # Compound tiebreaker: min latency, then fewer PEs, then lower HBM %. + # Smallest-fit Pareto point (see sidebar apply comment). _pl_best = min(_pl_res.pareto_scores, - key=lambda s: (s.total_latency_ns, - s.pes_used, - s.hbm_utilization)) + key=lambda s: (s.pes_used, + s.hbm_utilization, + s.total_latency_ns)) # Load the winning config into the sidebar's session state. st.session_state["cp"] = _pl_best.cp st.session_state["tp"] = _pl_best.tp