kali20gakki/msAgent / skills/profiler/msagent-profiler-breakdown
msagent-profiler-breakdown
VerifiedDB格式Profiling数据场景化性能拆解:自动完成场景确认(框架/任务类型判定)、阶段拆解与单次执行边界拆解,并给出报告。Use when 需要对昇腾 Profiling DB 做阶段拆解、step 归因或生成性能报告, or when the user says "帮我按任务阶段拆解这个Profiling数据", "多层次性能耗时拆解", "分析这个 vllm/sglang/verl 数据,主要耗时都花费在哪里了"。
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 8.0 KB |
| references/breakdown-schema.md | markdown | 4.1 KB |
| references/check-rules.md | markdown | 1.5 KB |
| references/db-usage.md | markdown | 5.8 KB |
| references/frameworks/README.md | markdown | 5.5 KB |
| references/frameworks/verl.md | markdown | 11.9 KB |
| references/frameworks/vllm-instrumentation.md | markdown | 13.6 KB |
| references/frameworks/vllm-profiler-data.md | markdown | 4.6 KB |
| references/frameworks/vllm.md | markdown | 5.6 KB |
| references/report-template.md | markdown | 5.0 KB |
| references/scenario-taxonomy.md | markdown | 5.7 KB |
| resources/scenarios/inference/sglang.json | config | 549 B |
| resources/scenarios/inference/vllm.json | config | 912 B |
| resources/scenarios/rl/slime.json | config | 468 B |
| resources/scenarios/rl/verl.json | config | 1.4 KB |
| resources/scenarios/training/fsdp.json | config | 303 B |
| resources/scenarios/training/megatron.json | config | 556 B |
| resources/scenarios/training/mindspeed.json | config | 318 B |
| scripts/compare_runs.py | script | 12.4 KB |
| scripts/db_query.py | script | 12.6 KB |
| scripts/decompose.py | script | 47.7 KB |
references/breakdown-schema.md
View on GitHub# 拆解树节点契约(原 schemas/breakdown.schema.json)
> 本契约描述 msagent-profiler-breakdown(decompose.py)产出的分级别耗时节点(阶段 / 单次执行),
> 以及后续 layer-decompose 消费时的字段口径。层级用 `level` 字段表达(不靠目录),
> 结论阶梯深度见设计方案 §3.7。
## level 枚举
| level | 语义 | 由谁产出 |
| ------ | ----------------------------------------------------------------------------------------- | ------------------------------------------------------------------- |
| `端到端` | 会话整体跨度 | msagent-profiler-breakdown(breakdown.json 顶层) |
| `阶段` | 推理五 stage(prepare\_input / forward / post\_process / sample\_token / draft\_token)或 RL 阶段 | msagent-profiler-breakdown(breakdown.json children) |
| `单次执行` | 一次 forward(decode step) | msagent-profiler-breakdown(breakdown.json children 中 level=单次执行 分支) |
| `单层` | transformer 第 N 层 | layer-decompose(暂缓,经 --framework 继承场景) |
| `层内` | 层内子模块(attention / MLP(MoE) / 通信 / 归一化 / 量化反量化) | layer-decompose(暂缓) |
## 节点通用字段
| 字段 | 类型 | 语义 |
| ------------------ | ------------ | -------------------------------------------------------- |
| `level` | string(上表枚举) | 拆解层级 |
| `name` | string | 节点名:阶段名 / step 序号 / 层名 / 子模块名 |
| `start` / `end` | number(ns) | 起始 / 结束时间 |
| `wall_time` | number(ns) | 墙钟耗时 = end - start |
| `self_time` | number(ns) | 净自耗 = wall\_time - Σ children.wall\_time(主排序用) |
| `overlap` | number(ns) | 并行/重叠收益 = wall\_time - self\_time(单独列示) |
| `children` | array | 子节点(递归本契约) |
| `confidence` | object | `{method(A/B/C), level(high/medium/low), detail}` |
| `conservation_gap` | number(ns) | 守恒缺口 = wall\_time - Σ children.self\_time |
| `stats` | object | 同类节点跨 occurrence 聚合时填充:count/p50/p99/min/max/variance/cv |
| `anomaly` | object | 异常/漂移标记(is\_outlier / is\_drift / threshold\_ref) |
> 阶段节点(msagent-profiler-breakdown 的 breakdown.json children 中 level=阶段)额外带 `count`(次数)、`wall_mean` / `wall_max` / `wall_min`(单次均值/最大/最小)、`first`(首个起止/wall),供报告展示阶段统计;`--inspect-index` 时再带 `inspect`。
## confidence
- `method`:A = 框架打点 / B = 注入打点 / C = 数据推测 / `with_modules` / `sequence_align`。
- `level`:`high` / `medium` / `low`(判据见 check-rules.md 与设计方案 §3.7)。
## 约束
- msagent-profiler-breakdown 输出为独立 JSON(breakdown.json 统一拆解树,stage.json 为同内容别名;layers.json 由 layer-decompose 后续产出),**不经过统一事件 JSON 中间层**,
数据源为昇腾 Profiling DB 直查(见 `references/db-usage.md`)。
- 字段口径以本契约为准;scripts 仅用 Python 标准库,不依赖 JSON Schema 校验库。
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |