runtime-utilities-and-visualization
Use MMEngine logging, message hubs, visualizer backends, distributed and device utilities, environment checks, timers, progress bars, manager mixins, and testing helpers safely.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- runtime-utilities-and-visualization
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Use MMEngine logging, message hubs, visualizer backends, distributed and device utilities, environment checks, timers, progress bars, manager mixins, and testing helpers safely.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/distributed-device-utilities.md6.8 KB
- 参考文档references/logging-visualization-workflows.md6.5 KB
- 参考文档references/troubleshooting.md7.3 KB
- 脚本scripts/runtime_env_check.py7.2 KB
03 SKILL.md 正文
Runtime Utilities and Visualization
Use this sub-skill when a task mentions MMLogger, print_log, MessageHub, Visualizer, LocalVisBackend, TensorboardVisBackend, WandbVisBackend, MLflow/ClearML/Aim/DVCLive/Neptune backends, init_dist, get_dist_info, collect_results, master_only, get_device, collect_env, ManagerMixin, progress bars, Timer, or MMEngine testing helpers.
Read Order
- references/logging-visualization-workflows.md: Choose and use loggers, message hubs, visualizers, local outputs, and optional tracking-service backends.
- references/distributed-device-utilities.md: Use distributed rank helpers, safe result collection, device detection, environment reports, timers, progress helpers, manager mixins, and testing utilities.
- references/troubleshooting.md: Diagnose duplicate loggers, optional backend dependency failures, visualization output surprises, distributed no-op behavior, collection mismatches, device fallback, and test-helper pitfalls.
- scripts/runtime_env_check.py: Run a safe local import/environment diagnostic, construct a temporary
LocalVisBackendvisualizer, and report distributed availability without launching multi-process jobs.
Scope
This sub-skill owns MMEngine runtime utilities: mmengine.logging, mmengine.visualization, mmengine.dist, mmengine.device, mmengine.utils, mmengine.utils.dl_utils.collect_env, mmengine.testing, ManagerMixin-based singleton behavior, progress helpers, and timers.
Route adjacent issues to sibling skills:
- Use
../runner-and-training/SKILL.mdfor RunnerLoggerHook,NaiveVisualizationHook, launch command placement, training log intervals, checkpoint/resume, and hook ordering. - Use
../models-metrics-and-inference/SKILL.mdfor model complexity/analysis APIs,BaseModel,BaseMetric, evaluator contracts, and inference/TTA behavior. - Use
../data-structures-and-io/SKILL.mdfor file format IO, file backends, datasets, samplers, collation, and data element schemas. - Use
../configuration-and-registry/SKILL.mdfor config syntax, registries,DefaultScope, and config-driven object construction.
Fast Workflow
- For one-off logging, call
print_log; for reusable project logging, create a namedMMLogger.get_instance(...)and reuse that instance name. - For training/runtime state shared across components, store numeric histories with
MessageHub.update_scalar(s)and overwrite current metadata withMessageHub.update_info. - For visualization without credentials, prefer
Visualizer(..., vis_backends=[dict(type='LocalVisBackend')], save_dir=...); add TensorBoard or service backends only when dependencies and credentials are available. - For distributed-safe code, call
get_dist_info()first; expect(0, 1)outside distributed launch and remembermaster_onlysilently returnsNoneon non-main ranks. - Before debugging user environments, run
python scripts/runtime_env_check.py --helpfrom this sub-skill directory, then run it with an optional--work-dirthat points to a disposable output directory.
Safe Operating Rules
- Do not initialize distributed jobs from helper scripts unless the user has explicitly launched the process group with PyTorch, MPI, or Slurm environment variables.
- Do not require optional tracking services, credentials, network access, or original MMEngine repository files; use
LocalVisBackendas the safe fallback. - Treat visualizer
save_diras a user project output path and keep generated runtime skill files independent from any user experiment outputs.
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).