observability
Configure Composer logging, callbacks, artifact uploading, profiling, environment reports, and monitoring for training runs.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- observability
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Configure Composer logging, callbacks, artifact uploading, profiling, environment reports, and monitoring for training runs.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/loggers-and-callbacks.md8.3 KB
- 参考文档references/profiling-and-artifacts.md7.2 KB
- 参考文档references/troubleshooting.md9.6 KB
- 脚本scripts/logger_smoke.py3.4 KB
- 脚本scripts/profiler_smoke.py3.9 KB
03 SKILL.md 正文
Composer Observability
Use this sub-skill when a Composer task is about making run state visible: metrics/loggers, callback-based monitoring, file and artifact uploads, profiler traces, TensorBoard, environment reports, or diagnosing why observability outputs are missing.
Route here
- Add local metrics capture with
InMemoryLogger,ConsoleLogger,ProgressBarLogger, orFileLogger. - Configure external experiment trackers such as Weights & Biases, MLflow, Comet ML, Neptune, Slack, or TensorBoard.
- Decide which callback owns a monitoring concern: speed, memory, learning-rate, optimizer, NaN/OOM, early stopping, threshold stopping, runtime estimate, image visualization, or MLPerf reporting.
- Upload Composer-generated files such as checkpoints, logs, TensorBoard event files, profiler traces, or custom artifacts.
- Configure
Profiler,JSONTraceHandler,cyclic_schedule, and short trace windows. - Run or interpret
composer_collect_envoutput when debugging hardware, Python, PyTorch, or CUDA availability. - Diagnose missing log files, empty metric collections, absent uploaded artifacts, invalid remote paths, or profiler option conflicts.
Reroute
- Training loop construction, optimizer/dataloader setup, checkpoint save/load/autoresume semantics: use
../training/SKILL.md. - Algorithm method behavior, method-specific events, or speedup recipe choices: use
../methods/SKILL.md. - Distributed launcher, rank topology, backend initialization, FSDP/TP config, or automatic microbatching: use
../distributed/SKILL.md. - Model export APIs and export callback ownership: use
../inference-export/SKILL.md.
Read first
- Loggers and callbacks: choose logger destinations, monitoring callbacks, run-name placeholders, and upload-capable destinations.
- Profiling and artifacts: configure
Profiler,JSONTraceHandler, file upload routing, trace retention, andcomposer_collect_env. - Troubleshooting: optional dependencies, credentials, upload gaps, URI parsing, placeholder mistakes, profiler conflicts, and remote validation.
- Logger smoke and profiler smoke: tiny CPU/no-network sanity checks future agents can copy or run in a prepared Composer environment.
Logger decision guide
- Keep the default progress bar for quick interactive experiments.
- Add
log_to_console=Trueandconsole_log_interval="100ba"when stdout/stderr logs are easier to archive than progress bars. - Use
InMemoryLogger()when a test, smoke script, or agent needs assertions over metrics and hyperparameters after the run. - Use
FileLogger(filename="{run_name}/logs-rank{rank}.txt")for durable per-rank local text logs. - Use
TensorboardLogger(log_dir=...)when users expect TensorBoard event files. - Use tracker loggers only after installing the matching optional extra and confirming credentials or offline/debug mode.
- Use
RemoteUploaderDownloader(bucket_uri=...)when the task is about object-store upload/download rather than experiment tracking.
Artifact upload checklist
- A class must generate a local file first, such as a checkpoint callback, file logger, TensorBoard logger, profiler trace handler, or custom
trainer.logger.upload_file(...)call. - At least one logger destination must implement upload; otherwise the file remains local.
- Keep rank and run-name placeholders in filenames so multi-rank outputs do not clobber each other.
- If
autoresume=True, avoid unsupported concurrent upload settings and keep a stablerun_nameplus checkpoint latest filename. - For cloud/object stores, validate credentials and URI scheme separately from Trainer construction.
Profiler decision guide
Use a short window before expanding trace collection:
from composer.profiler import Profiler, JSONTraceHandler, cyclic_schedule
profiler = Profiler(
schedule=cyclic_schedule(skip_first=0, wait=0, warmup=1, active=4, repeat=1),
trace_handlers=[JSONTraceHandler(folder="traces", overwrite=True)],
torch_prof_memory_filename=None,
)
Attach it as Trainer(..., profiler=profiler). Prefer one or two batches first, then increase active or enable stack/memory options when the tiny trace is usable.
Safe workflow
- Start with a tiny
max_duration="1ba"run andInMemoryLogger(). - Add one durable destination such as
FileLoggeror TensorBoard. - Add only one remote tracker or uploader at a time.
- If files are generated but missing remotely, inspect upload-capable destinations before changing callbacks.
- If profiler output is missing, check the schedule first; it may have stayed in
SKIPorWARMUP. - Record
composer_collect_envoutput when debugging PyTorch/CUDA/device issues, but do not put machine-specific paths into reusable project code.
Bundled smoke scripts
Run from this sub-skill directory:
python scripts/logger_smoke.py
python scripts/profiler_smoke.py
Both scripts use random CPU tensors and temporary directories; they do not contact external services.
Ask or stop before proceeding
- The user wants to log to a credentialed service and no token/offline mode is available.
- The task requires mutating external object storage or deleting existing remote artifacts.
- Profiling must run on a production-scale job rather than a tiny isolated reproduction.
- The issue depends on multi-rank launch behavior rather than logger/profiler configuration.
- Optional logger packages are absent and installation policy is unclear.
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).