-
Notifications
You must be signed in to change notification settings - Fork 0
Split the visualization module and optimize the operator page #38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
zzhfz
wants to merge
1
commit into
master
Choose a base branch
from
refactor/operator-and-visualizations
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,7 @@ | |
| from utils.visualizations import ( | ||
| create_summary_table_ops, | ||
| plot_timeseries_auto, | ||
| render_operator_performance_charts, | ||
| ) | ||
|
|
||
| init_page("算子测试分析 | InfiniMetrics", "⚡") | ||
|
|
@@ -37,6 +38,10 @@ def main(): | |
| only_success = st.checkbox("仅显示成功测试", value=True) | ||
| y_log = st.checkbox("Y轴对数刻度(可选)", value=False) | ||
|
|
||
| st.markdown("---") | ||
| st.markdown("### 📊 图表选项") | ||
| show_performance_charts = st.checkbox("显示性能仪表盘", value=True) | ||
|
|
||
| filtered = [r for r in ops_runs if (not only_success or r.get("success"))] | ||
|
|
||
| st.caption(f"找到 {len(filtered)} 个算子测试") | ||
|
|
@@ -63,35 +68,54 @@ def main(): | |
| ri["data"] = data | ||
| selected_runs.append(ri) | ||
|
|
||
| tab1, tab2 = st.tabs(["📌 概览", "📈 曲线/原始数据"]) | ||
| tab1, tab2, tab3 = st.tabs(["📈 性能图表", "📌 概览", "📊 原始数据"]) | ||
|
|
||
| with tab1: | ||
| # Use the new performance chart function | ||
| render_operator_performance_charts( | ||
| selected_runs, y_log, show_performance_charts | ||
| ) | ||
|
|
||
| with tab2: | ||
| for run in selected_runs: | ||
| with st.expander(f"{run.get('run_id')} - 概览"): | ||
| st.dataframe( | ||
| create_summary_table_ops(run["data"]), | ||
| use_container_width=True, | ||
| hide_index=True, | ||
| ) | ||
| st.markdown("**config**") | ||
| st.markdown("**完整配置**") | ||
| st.json(run["data"].get("config", {})) | ||
|
|
||
| with tab2: | ||
| # If operators have timeseries CSVs, automatically plot them | ||
| env = run["data"].get("environment", {}) | ||
| if env: | ||
| st.markdown("**环境信息**") | ||
| try: | ||
| acc = env["cluster"][0]["machine"]["accelerators"][0] | ||
| st.write(f"- 加速卡: {acc.get('model', 'Unknown')}") | ||
| st.write(f"- 显存: {acc.get('memory_gb_per_card', '?')} GB") | ||
| st.write(f"- CUDA版本: {acc.get('cuda', 'Unknown')}") | ||
| except: | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 应该用 except Exception: |
||
| st.json(env) | ||
|
|
||
| with tab3: | ||
| # Original data | ||
| for run in selected_runs: | ||
| with st.expander(f"{run.get('run_id')} - metrics"): | ||
| with st.expander(f"{run.get('run_id')} - 原始数据"): | ||
| for m in run["data"].get("metrics", []): | ||
| df = m.get("data") | ||
| if df is not None and len(df.columns) >= 2: | ||
| st.markdown(f"**{m.get('name', 'metric')}**") | ||
| fig = plot_timeseries_auto( | ||
| df, title=m.get("name", "metric"), y_log_scale=y_log | ||
| ) | ||
| st.plotly_chart(fig, use_container_width=True) | ||
| else: | ||
| # scalar | ||
| if m.get("type") == "scalar": | ||
| st.write( | ||
| f"- {m.get('name')}: {m.get('value')} {m.get('unit','')}" | ||
| st.metric( | ||
| label=m.get("name", ""), | ||
| value=f"{m.get('value', '')} {m.get('unit', '')}", | ||
| ) | ||
|
|
||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,37 +4,91 @@ | |
| This package provides visualization utilities organized by test type: | ||
| - base: Common/legacy visualization functions | ||
| - hardware: Hardware test visualizations (memory sweep, cache bandwidth) | ||
| - (future) communication: Communication test visualizations | ||
| - (future) inference: Inference test visualizations | ||
| - (future) operator: Operator test visualizations | ||
| - communication: Communication test visualizations | ||
| - inference: Inference test visualizations | ||
| - operator: Operator test visualizations | ||
| - training: Training test visualizations | ||
| - summary_tables: Summary tables for different test types | ||
| """ | ||
|
|
||
| # Base functions (common) | ||
| from .base import ( | ||
| plot_metric_vs_size, | ||
| plot_comparison_matrix, | ||
| create_summary_table, | ||
| create_gauge_chart, | ||
| plot_timeseries_auto, | ||
| create_summary_table_infer, | ||
| create_summary_table_ops, | ||
| ) | ||
|
|
||
| # Communication functions | ||
| from .communication import ( | ||
| plot_metric_vs_size, | ||
| plot_comparison_matrix, | ||
| ) | ||
|
|
||
| # Inference functions | ||
| from .inference import ( | ||
| render_inference_metrics, | ||
| render_memory_gauge, | ||
| ) | ||
|
|
||
| # Summary tables | ||
| from .summary_tables import ( | ||
| create_comm_summary_table, | ||
| create_infer_summary_table, | ||
| create_ops_summary_table, | ||
| ) | ||
|
|
||
| # Hardware functions | ||
| from .hardware import ( | ||
| create_summary_table_hw, | ||
| plot_hw_mem_sweep, | ||
| plot_hw_cache, | ||
| ) | ||
|
|
||
| # Operator functions | ||
| from .operator import ( | ||
| extract_operator_metrics, | ||
| render_operator_performance_charts, | ||
| ) | ||
|
|
||
| # Training functions | ||
| from .training import ( | ||
| render_performance_curves, | ||
| render_throughput_comparison, | ||
| render_data_tables, | ||
| render_config_details, | ||
| ) | ||
|
|
||
| # Backward-compatible aliases | ||
| create_summary_table = create_comm_summary_table | ||
| create_summary_table_infer = create_infer_summary_table | ||
| create_summary_table_ops = create_ops_summary_table | ||
|
Comment on lines
+61
to
+63
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 我觉得这里有点多余,你新建的方法应该还是叫:create_summary_table, |
||
|
|
||
| __all__ = [ | ||
| # Base (common/legacy) | ||
| # Base | ||
| "create_gauge_chart", | ||
| "plot_timeseries_auto", | ||
| # Communication | ||
| "plot_metric_vs_size", | ||
| "plot_comparison_matrix", | ||
| # Inference | ||
| "render_inference_metrics", | ||
| "render_memory_gauge", | ||
| # Summary tables | ||
| "create_comm_summary_table", | ||
| "create_infer_summary_table", | ||
| "create_ops_summary_table", | ||
| "create_summary_table", | ||
| "create_gauge_chart", | ||
| "plot_timeseries_auto", | ||
| "create_summary_table_infer", | ||
| "create_summary_table_ops", | ||
| # Hardware | ||
| "create_summary_table_hw", | ||
| "plot_hw_mem_sweep", | ||
| "plot_hw_cache", | ||
| # Operator | ||
| "extract_operator_metrics", | ||
| "render_operator_performance_charts", | ||
| # Training | ||
| "render_performance_curves", | ||
| "render_throughput_comparison", | ||
| "render_data_tables", | ||
| "render_config_details", | ||
| ] | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个地方改成加速卡版本是不是好一点?