visualization-and-ui
Route plotting, display, UI controls, and scene-backed scalar visualization through the current phi.vis public APIs.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- visualization-and-ui
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Route plotting, display, UI controls, and scene-backed scalar visualization through the current phi.vis public APIs.
- disable-model-invocation
- true
02 资源文件 3
- 参考文档references/troubleshooting.md2.0 KB
- 参考文档references/workflows.md5.6 KB
- 脚本scripts/plot_smoke.py3.3 KB
03 SKILL.md 正文
Visualization and UI
Use this sub-skill when a task involves rendering fields, tensors, geometries, histograms, animations, scalar training logs, or interactive display/control surfaces through phi.vis.
First decisions
- Use the current public surface. Prefer
import phi.vis as vis.from phi.flow import *givesshow,plot, andcontrol, but notvis.close,load_scalars,plot_scalars,show_hist,overlay, orwrite_image; importphi.visexplicitly whenever you need the figure closer or scalar-log helpers. - Do not call
view(). Currentphi.flowandphi.visdo not export a publicviewsymbol. Older visualization, Dash, and console docs still containview(...)examples; translate those tovis.show(...)orvis.plot(...)and keep anycontrol(...)calls as script-level assignment declarations. - Choose a renderer deliberately. Use Matplotlib for stable static/headless 1D and 2D plots, Plotly for browser/notebook-friendly and 3D plots, and treat console/ascii plotting as unavailable for verification-critical workflows in this version.
- Close figures in scripts and tests. Store the result of
vis.plot(...), save or inspect it, then callvis.close(fig). Forvis.show(...), expect a display side effect; avoid it in headless automation unlessMPLBACKEND=Aggis set. - Use scene scalars through
load_scalars(). Prefercurve = vis.load_scalars(scene, "loss")followed byvis.plot(curve, ...).plot_scalars()remains available but is deprecated and Matplotlib-only.
Verified public entry points
vis.show(*fields, lib=None, row_dims=None, col_dims=batch, animate=None, overlay="overlay", title=None, size=None, same_scale=True, log_dims="", show_color_bar=True, color=None, alpha=1.0, err=0.0, frame_time=100, repeat=True, plt_params=None, max_subfigures=20)vis.plot(...)has the same live signature family asshow(...)and returns a native figure object or animation instead of immediately displaying it.vis.close(figure=None)closes a figure created byvis.plot(); without an argument, it closes the most recentphi.visfigure.vis.show_hist(data, bins=math.instance(bins=20), weights=1, same_bins=None)builds a histogram and displays it throughshow().vis.control(value, range=None, description="", **kwargs)only accepts primitiveint,float,bool, orstrvalues and must be used in a variable assignment statement.vis.load_scalars(scene, name, prefix="log_", suffix=".txt", x="steps", entries_dim=(iterationˢ), batch_dim=(batchᵇ))readslog_<name>.txtcurves from a single scene path orScene.vis.plot_scalars(*args, **kwargs)delegates to the Matplotlib scalar plot helper and emits a deprecation warning; useload_scalars()plusplot()for new code.
Route by task
- Static field/tensor/geometry figure: read workflows.md, then use
vis.plot(..., lib="matplotlib")orlib="plotly". - Quick human display: use
vis.show(field_or_tensor, lib="matplotlib" | "plotly"); for an existing figure, callvis.show(lib=...)only after a previousvis.plot(). - Animations: pass
animate="time"or another dimension tovis.plot()/vis.show()and setframe_time; prefer Plotly or notebook display for interactive review, Matplotlib for script-side objects. - Subplots / batches: use
row_dims,col_dims,overlay,title,same_scale,max_subfigures, andsize; for many batches, slice or raisemax_subfiguresdeliberately. - Scalar logs from scenes: read workflows.md; keep log files named
log_<name>.txt. - Controls: keep
learning_rate = vis.control(...)near the top-level script scope; do not rely oncontrol()alone to launch a GUI. - Problems or stale examples: read troubleshooting.md.
Smoke check
Run the bundled smoke helper in an environment where phiflow is installed:
python sub-skills/visualization-and-ui/scripts/plot_smoke.py
The helper verifies the show/plot signature family, absence of public view(), Matplotlib and Plotly figure creation, control() assignment semantics, histogram display path, scene scalar loading, deprecated plot_scalars(), and figure cleanup.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).