Skip to content
cccskills
FreePublished on GitHub

msagent-profiler-breakdown

DB格式Profiling数据场景化性能拆解:自动完成场景确认(框架/任务类型判定)、阶段拆解与单次执行边界拆解,并给出报告。

Use when 需要对昇腾 Profiling DB 做阶段拆解、step 归因或生成性能报告, or when the user says "帮我按任务阶段拆解这个Profiling数据", "多层次性能耗时拆解", "分析这个 vllm/sglang/verl 数据,主要耗时都花费在哪里了"。

The English summary is being prepared. Showing the original description.

See how to install

Files included (21)

  • SKILL.md8.0 KB
  • references/breakdown-schema.md4.1 KB
  • references/check-rules.md1.5 KB
  • references/db-usage.md5.8 KB
  • references/frameworks/README.md5.5 KB
  • references/frameworks/verl.md11.9 KB
  • references/frameworks/vllm-instrumentation.md13.6 KB
  • references/frameworks/vllm-profiler-data.md4.6 KB
  • references/frameworks/vllm.md5.6 KB
  • references/report-template.md5.0 KB
  • references/scenario-taxonomy.md5.7 KB
  • resources/scenarios/inference/sglang.json549 B
  • resources/scenarios/inference/vllm.json912 B
  • resources/scenarios/rl/slime.json468 B
  • resources/scenarios/rl/verl.json1.4 KB
  • resources/scenarios/training/fsdp.json303 B
  • resources/scenarios/training/megatron.json556 B
  • resources/scenarios/training/mindspeed.json318 B
  • scripts/compare_runs.py12.4 KB
  • scripts/db_query.py12.6 KB
  • scripts/decompose.py47.7 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

msagent-profiler-breakdown —— 场景化拆解(一步到位)

定位:合并原 stage-decompose / step-decompose / breakdown-report 三份 skill,一份搞定 阶段归因(level=阶段)→ 单次执行边界(level=单次执行)→ 报告。 场景差异(推理 / 训练 / RL,vllm / sglang / verl / slime…)下沉到场景资源文件 resources/scenarios/<scenario>/<framework>.json,主 skill 不做框架分支。 用户只与本文档交互;scripts/decompose.py 一步产出 breakdown.json(统一拆解树)/ HTML 报告 / findings。

触发与元信息

维度内容
触发关键词模型按层拆解、完整性能分析、一键分析、端到端到层内拆解、框架/并行自动识别、多卡 TP/EP/PP 分析
外部依赖昇腾 Profiling DB(sqlite)与 analysis.db;Python 3 标准库;场景资源 resources/scenarios/;拆解树契约 references/breakdown-schema.md;报告模板 references/report-template.md
权限要求只读打开 Profiling DB(mode=ro,保留 WAL 恢复);在工作区读写中间产物与报告
预期输出breakdown.json(统一拆解树:端到端 → 阶段 + 单次执行分支)+ stage.json(同内容别名,场景信息供 layer-decompose 继承)+ HTML 报告 + findings(8 字段)+ 明细 CSV

一句话调用

python scripts/decompose.py --db <ascend_pytorch_profiler_{rank_id}.db> \
    [--framework vllm|sglang|verl|slime|megatron|mindspeed|fsdp] \
    [--task-type inference|train|rl] [--anchor "forward"] [--inspect-index 0]

最少必给只有 --db;framework / task-type 可省,走自动探测 / 兜底默认 / 由编排层询问用户。

三步流程

第 1 步:场景确认(framework / task-type 判定)

判定优先级(framework 与 task-type 同构):

  1. CLI / 编排层显式指定(--framework / --task-type)→ high。用户可直接说 「请帮我分析下这个 vllm 的 profiling 数据」,此时 framework 由上层输入。
  2. 自动探测(从 profiling 数据分析):STRING_IDS.value 含 vllm% 前缀 → vllm; 存在 verl worker 侧 MSTX 打点名(actor_update / actor_compute_log_prob / ref_compute_log_prob / train_batch)→ verl。框架映射任务类型: vllm/sglang→inference、megatron/mindspeed/fsdp→train、verl/slime→rl。→ high
  3. 识别不了 → 询问用户(编排层用 AskUserQuestion 回显候选 + 依据让用户确认/修正); 仍缺则默认 vllm/inference + 显式告警(task_type_source=default),报告低置信度清单列出。

探测工具:scripts/db_query.py(子命令 string / mstx / pytorch / cann / api), 先查打点再定规则。判定结果(framework / framework_source / task_type / task_type_source)写入 stage.json,供下游 layer-decompose 经 --framework 继承, 无需重新探测。

第 2 步:执行拆解(按场景资源规则)

引擎 decompose.py 框架无关,按场景资源文件声明式规则执行,主 skill 不过多呈现框架分支:

  • 阶段归因:读取 resources/scenarios/<scenario>/<framework>.json 的 stage_decompose.stages(name + scopes + backing),直连 DB 统计每个 stage 的 count / 累计 / 均值 / 最大 / 最小 / 首个。

  • 单次执行边界:读取 step_decompose.anchor(默认 forward),锚点 scope 每次出现 记一个 step,按位置(前 2 步 graph_capture/compile)+ 阈值(wall_time > factor×median) 判热身并写 warmup_reason;--skip-first-step 另标首个 step 为疑似 prefill; 剔除后算稳态统计(count/mean/P50/P99/min/max/variance/CV)。

  • 锚点优先级:CLI --anchor 显式覆盖 > 场景资源 step_decompose.anchor;锚点为空 (如 RL/训练待核验)→ 跳过 step 拆解并告警。

新增框架 = 在场景目录放一个 <framework>.json(支持 extends 继承父规则),不改引擎, 详见 references/frameworks/README.md。

第 3 步:生成报告(模板即资源,无独立 report skill)

按 references/report-template.md 组织结论先行 HTML(自包含、无 JS 依赖): 一句话结论 → 逐级耗时(仅列出现过的级别)→ 阶段统计表 → TOP-N 下钻链 → per-step 明细 → 稳态统计 → 异常/漂移 → 低置信度清单 → 建议下一步 → findings(8 字段)。 场景信息(框架/任务类型,用户已知)与守恒自检不做独立章节,守恒缺口告警保留在 findings 中。 同时落盘 findings JSON 与明细 CSV;多 run A/B 对比用 scripts/compare_runs.py。

输入

输入必填来源
昇腾 Profiling DB是用户给定路径(ascend_pytorch_profiler_{rank}.db / analysis.db)
framework否场景确认(CLI > 自动探测 > 询问 > 默认 vllm + 告警)
task-type否场景确认(CLI > 框架映射 > 默认 inference + 告警)
anchor否覆盖 step 边界锚点(默认取场景资源 step_decompose.anchor)

输出(workspace 落盘)

产物内容
breakdown.json统一拆解树:端到端(会话)→ children(阶段... + 单次执行分支含 per-step 序列与稳态统计)+ 框架/任务类型来源 + 守恒自检
stage.json与 breakdown.json 同内容别名;场景信息供 layer-decompose --framework 继承
<prefix>.html结论先行报告(模板见 references/report-template.md)
<prefix>_findings.json结构化结论(8 字段:问题/证据/影响/根因/优化动作/预期收益/验证路径/置信度)
<prefix>_detail.csv / <prefix>_handoff.csvper-step 明细 / 层拆解交接清单(暂缓期间为占位)

涉及的 skill

skill职责状态
msagent-profiler-breakdown场景确认 + 阶段/单次执行拆解 + 报告,一步到位在链路内
layer-decompose单层归属 + 层内归因 + 结构校验(直连 DB)暂缓保留(经 --framework 继承场景)

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

当用户直接要求进行数据集压缩测评,或在量化调优过程中需要使用 AISBench 评测工具输出数据集精度等场景时使用。 本 Skill 负责:使用 AISBench 数据集压缩代码、用 RBF Kernel Herding 算法生成压缩后的数据子集(coreset),并按用户目标交付两种产物之一: ① 接入量化调优主流程:产出独立的 coreset 数据集配置(不覆盖原始数据),回传「全集 config_name + coreset config_name」给编排层,供 evaluation.yaml 切换; ② 仅数据集压缩测评(不做量化调优):基于 example 模板生成「全集测试脚本」和「子集测试脚本」两份 shell 脚本。 暂时支持 AIME 2025 和 GPQA,其他数据集需要再结合 aisbench tools目录下 herding_coreset_selector 源码进行分析。

The English summary is being prepared. Showing the original description.

kali20gakki/msAgent32Updated Oct 17, 2026

Ascend cluster comparison tool. Invoke when user asks to compare two cluster datasets (DB or TEXT), or to generate cluster_analysis_output from raw profiling data via msprof-analyze and then compare.

The English summary is being prepared. Showing the original description.

kali20gakki/msAgent32Updated Oct 17, 2026

专门用于 Ascend 集群 Profiling 性能数据的“快慢卡”诊断专家技能。当用户提供【集群性能数据目录/路径】并要求分析【快慢卡】、【慢节点】、【负载不均衡】或【集群瓶颈】时,必须触发此技能。该技能会自动接收集群路径,调度相关工具输出快慢卡的宏观定性与微观根因(如 Host 下发瓶颈、算子计算劣化)。

The English summary is being prepared. Showing the original description.

kali20gakki/msAgent32Updated Oct 17, 2026

Analyze Ascend NPU collective communication profiling data with a DB-first workflow. Use when the user provides `cluster_analysis_output/cluster_analysis.db`, rank-level `analysis.db`, rank-level `ascend_pytorch_profiler_{rank_id}.db`, together with `profiler_info.json`, and asks about HCCL or hcom communication cost, collective communication TOP ops, wait time, slow rank/straggler, Notify Wait, bandwidth, retry, relay, SDMA/RDMA/HCCS links, communication matrix, or Ascend communication fault patterns.

The English summary is being prepared. Showing the original description.

kali20gakki/msAgent32Updated Oct 17, 2026

Analyze Ascend NPU computation-side profiling data for single-card runs or a selected rank from multi-card runs. Use this skill when the user asks to diagnose computation bottlenecks, AI Core / AI Vector / AICPU hotspots, dynamic shape overhead, block dim issues, redundant TransData/Transpose/Cast, cross-stream waits, frequency/runtime-state issues, or fusion opportunities.

The English summary is being prepared. Showing the original description.

kali20gakki/msAgent32Updated Oct 17, 2026

针对昇腾 NPU 上的 PyTorch 模型,识别可做融合算子替换的代码段、替换为 torch_npu 融合算子并做性能/精度验证。当用户提到融合算子、NPU 算子替换、RMSNorm/SwiGLU/RoPE/Attention 融合、torch_npu 亲和算子等关键词是,使用本 Skill。

The English summary is being prepared. Showing the original description.

kali20gakki/msAgent32Updated Oct 17, 2026

See all skills by kali20gakki

Report a problem with this skill