analytical-viz: hot-reload guard — include model_config + model_presets, ordered

The reload guard didn't include model_config.py. When the batch (B)
field was added to TopologyConfig, Streamlit kept the stale
pre-B dataclass in sys.modules and every downstream module hit
"AttributeError: 'TopologyConfig' object has no attribute 'b'".

Fix: add model_config and model_presets to the reload list, and order
model_config FIRST so downstream modules that reload after it pick up
the new dataclass definition. Also reordered the rest so upstream
dependencies (autosuggest, memory_layout, stage_latencies) reload
before their consumers (auto_explore, auto_hardware).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-07-28 22:43:47 -07:00
parent 770aed6291
commit 674e194dc9
+9 -3
View File
@@ -19,12 +19,18 @@ import streamlit as st
# keep using the pre-edit versions until a full Ctrl+C + restart. Force
# a reload of our own modules on every rerun so signature changes land
# without a full restart.
# Order matters: model_config first because everything else imports from it
# (e.g. TopologyConfig). If we reload downstream modules while model_config
# is stale, they end up holding the OLD dataclass definition and every
# `cfg.topo.new_field` lookup blows up with AttributeError.
for _mod_name in (
"tests.analytical_visualization.model_config",
"tests.analytical_visualization.model_presets",
"tests.analytical_visualization.autosuggest",
"tests.analytical_visualization.memory_layout",
"tests.analytical_visualization.stage_latencies",
"tests.analytical_visualization.auto_explore",
"tests.analytical_visualization.auto_hardware",
"tests.analytical_visualization.autosuggest",
"tests.analytical_visualization.stage_latencies",
"tests.analytical_visualization.memory_layout",
"tests.analytical_visualization.pe_weight_layout",
"tests.analytical_visualization.tensor_sharding",
"tests.analytical_visualization.topology_map",