From f1cf0257d3e0bdf85e7e342704593324c1794f27 Mon Sep 17 00:00:00 2001 From: Mukesh Garg Date: Tue, 28 Jul 2026 21:55:29 -0700 Subject: [PATCH] analytical-viz: restore Apply memory-min button An "Apply memory-min" button was removed when the 3 latency-optimal buttons were added. Consequence: after clicking any latency-optimal button, the sidebar sliders drift from the memory-min caption and there was no way to sync them back without restarting the app or manually adjusting each slider. Restore the button, positioned below the caption and above the 3 latency-optimal buttons. Clicking it snaps cp/tp/pp/dp/cp_placement to what the caption shows and clears _pl_active_scope to "full" so the Physical Layout tab stops filtering. Co-Authored-By: Claude Opus 4.7 --- tests/analytical_visualization/app.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/analytical_visualization/app.py b/tests/analytical_visualization/app.py index 0285b02..0c1da5d 100644 --- a/tests/analytical_visualization/app.py +++ b/tests/analytical_visualization/app.py @@ -185,6 +185,18 @@ with st.sidebar.expander("Parallelism", expanded=True): f"{_default_suggestion.pes_used} PEs " f"(cp_placement={_default_suggestion.cp_placement})" ) + # Memory-min apply — snap sliders back to what the caption says. + if st.button("Apply memory-min", width='stretch', + key="_sb_apply_memmin", + help="Set sliders to the memory-min config shown above " + "(smallest deployment that fits)."): + st.session_state["cp"] = _snap(_default_suggestion.cp, _CP_OPTS) + st.session_state["tp"] = _snap(_default_suggestion.tp, _TP_OPTS) + st.session_state["pp"] = _snap(_default_suggestion.pp, _PP_OPTS) + st.session_state["dp"] = 1 + st.session_state["cp_placement"] = _default_suggestion.cp_placement + st.session_state["_pl_active_scope"] = "full" + st.rerun() # Three latency-optimal apply buttons — pick a scope, load the # latency-min Pareto config into the sidebar sliders. from tests.analytical_visualization.auto_explore import (