Skip to content

Commit 1b230ce

Browse files
zzhfzChamberlain0w0
authored andcommitted
Split the visualization module and optimize the operator page
1 parent cdd9e46 commit 1b230ce

File tree

9 files changed

+768
-403
lines changed

9 files changed

+768
-403
lines changed

dashboard/pages/operator.py

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from utils.visualizations import (
1010
create_summary_table_ops,
1111
plot_timeseries_auto,
12+
render_operator_performance_charts,
1213
)
1314

1415
init_page("算子测试分析 | InfiniMetrics", "⚡")
@@ -37,6 +38,10 @@ def main():
3738
only_success = st.checkbox("仅显示成功测试", value=True)
3839
y_log = st.checkbox("Y轴对数刻度(可选)", value=False)
3940

41+
st.markdown("---")
42+
st.markdown("### 📊 图表选项")
43+
show_performance_charts = st.checkbox("显示性能仪表盘", value=True)
44+
4045
filtered = [r for r in ops_runs if (not only_success or r.get("success"))]
4146

4247
st.caption(f"找到 {len(filtered)} 个算子测试")
@@ -63,35 +68,54 @@ def main():
6368
ri["data"] = data
6469
selected_runs.append(ri)
6570

66-
tab1, tab2 = st.tabs(["📌 概览", "📈 曲线/原始数据"])
71+
tab1, tab2, tab3 = st.tabs(["📈 性能图表", "📌 概览", "📊 原始数据"])
6772

6873
with tab1:
74+
# Use the new performance chart function
75+
render_operator_performance_charts(
76+
selected_runs, y_log, show_performance_charts
77+
)
78+
79+
with tab2:
6980
for run in selected_runs:
7081
with st.expander(f"{run.get('run_id')} - 概览"):
7182
st.dataframe(
7283
create_summary_table_ops(run["data"]),
7384
use_container_width=True,
7485
hide_index=True,
7586
)
76-
st.markdown("**config**")
87+
st.markdown("**完整配置**")
7788
st.json(run["data"].get("config", {}))
7889

79-
with tab2:
80-
# If operators have timeseries CSVs, automatically plot them
90+
env = run["data"].get("environment", {})
91+
if env:
92+
st.markdown("**环境信息**")
93+
try:
94+
acc = env["cluster"][0]["machine"]["accelerators"][0]
95+
st.write(f"- 加速卡: {acc.get('model', 'Unknown')}")
96+
st.write(f"- 显存: {acc.get('memory_gb_per_card', '?')} GB")
97+
st.write(f"- CUDA版本: {acc.get('cuda', 'Unknown')}")
98+
except:
99+
st.json(env)
100+
101+
with tab3:
102+
# Original data
81103
for run in selected_runs:
82-
with st.expander(f"{run.get('run_id')} - metrics"):
104+
with st.expander(f"{run.get('run_id')} - 原始数据"):
83105
for m in run["data"].get("metrics", []):
84106
df = m.get("data")
85107
if df is not None and len(df.columns) >= 2:
108+
st.markdown(f"**{m.get('name', 'metric')}**")
86109
fig = plot_timeseries_auto(
87110
df, title=m.get("name", "metric"), y_log_scale=y_log
88111
)
89112
st.plotly_chart(fig, use_container_width=True)
90113
else:
91114
# scalar
92115
if m.get("type") == "scalar":
93-
st.write(
94-
f"- {m.get('name')}: {m.get('value')} {m.get('unit','')}"
116+
st.metric(
117+
label=m.get("name", ""),
118+
value=f"{m.get('value', '')} {m.get('unit', '')}",
95119
)
96120

97121

dashboard/pages/training.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
load_selected_runs,
1313
create_training_summary,
1414
)
15-
from utils.training_plots import (
15+
from utils.visualizations import (
1616
render_performance_curves,
1717
render_throughput_comparison,
1818
render_data_tables,

dashboard/utils/visualizations/__init__.py

Lines changed: 65 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,91 @@
44
This package provides visualization utilities organized by test type:
55
- base: Common/legacy visualization functions
66
- hardware: Hardware test visualizations (memory sweep, cache bandwidth)
7-
- (future) communication: Communication test visualizations
8-
- (future) inference: Inference test visualizations
9-
- (future) operator: Operator test visualizations
7+
- communication: Communication test visualizations
8+
- inference: Inference test visualizations
9+
- operator: Operator test visualizations
10+
- training: Training test visualizations
11+
- summary_tables: Summary tables for different test types
1012
"""
1113

14+
# Base functions (common)
1215
from .base import (
13-
plot_metric_vs_size,
14-
plot_comparison_matrix,
15-
create_summary_table,
1616
create_gauge_chart,
1717
plot_timeseries_auto,
18-
create_summary_table_infer,
19-
create_summary_table_ops,
2018
)
19+
20+
# Communication functions
21+
from .communication import (
22+
plot_metric_vs_size,
23+
plot_comparison_matrix,
24+
)
25+
26+
# Inference functions
27+
from .inference import (
28+
render_inference_metrics,
29+
render_memory_gauge,
30+
)
31+
32+
# Summary tables
33+
from .summary_tables import (
34+
create_comm_summary_table,
35+
create_infer_summary_table,
36+
create_ops_summary_table,
37+
)
38+
39+
# Hardware functions
2140
from .hardware import (
2241
create_summary_table_hw,
2342
plot_hw_mem_sweep,
2443
plot_hw_cache,
2544
)
2645

46+
# Operator functions
47+
from .operator import (
48+
extract_operator_metrics,
49+
render_operator_performance_charts,
50+
)
51+
52+
# Training functions
53+
from .training import (
54+
render_performance_curves,
55+
render_throughput_comparison,
56+
render_data_tables,
57+
render_config_details,
58+
)
59+
60+
# Backward-compatible aliases
61+
create_summary_table = create_comm_summary_table
62+
create_summary_table_infer = create_infer_summary_table
63+
create_summary_table_ops = create_ops_summary_table
64+
2765
__all__ = [
28-
# Base (common/legacy)
66+
# Base
67+
"create_gauge_chart",
68+
"plot_timeseries_auto",
69+
# Communication
2970
"plot_metric_vs_size",
3071
"plot_comparison_matrix",
72+
# Inference
73+
"render_inference_metrics",
74+
"render_memory_gauge",
75+
# Summary tables
76+
"create_comm_summary_table",
77+
"create_infer_summary_table",
78+
"create_ops_summary_table",
3179
"create_summary_table",
32-
"create_gauge_chart",
33-
"plot_timeseries_auto",
3480
"create_summary_table_infer",
3581
"create_summary_table_ops",
3682
# Hardware
3783
"create_summary_table_hw",
3884
"plot_hw_mem_sweep",
3985
"plot_hw_cache",
86+
# Operator
87+
"extract_operator_metrics",
88+
"render_operator_performance_charts",
89+
# Training
90+
"render_performance_curves",
91+
"render_throughput_comparison",
92+
"render_data_tables",
93+
"render_config_details",
4094
]

0 commit comments

Comments
 (0)