Skip to content
cccskills
FreePublished on GitHub

ascend-profiler-data-validation

当用户提供 MindStudio profiler 采集的性能数据(框架 profiler、msprof 命令行)时,对数据完整性、采集状态及关键配置进行校验,确保后续分析工具能正常运行。

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

See how to install

Files included (3)

  • SKILL.md5.0 KB
  • scripts/offline_parse_mindspore.py2.2 KB
  • scripts/offline_parse_pytorch.py2.2 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

MindStudio Profiler 数据校验

技能目标

在深入性能分析前,对 profiler 数据进行「体检」,确保:

  • 正确识别数据类型(框架 profiler / msprof)
  • 采集过程正常结束(流程正常 Stop)
  • 数据已解析,关键交付件存在
  • 识别 profiler 配置,预判后续分析可行性

数据类型特征

类型标识特征采集方式
框架 profiler[*]_ascend_pt(PyTorch)或 [*]_ascend_ms(MindSpore)代码内嵌,进程级
msprof含 PROF_{} 目录命令行,进程级

框架 profiler 含 torch_npu/MindSpore 框架 API、CANN API、device 算子、硬件指标;msprof 含 CANN API、device 算子、硬件指标。

依赖与资源

  • MCP 工具:msprof-mcp__get_profiler_config(profiler_path) — 解析 profiler_info.json(仅框架 profiler)
  • 离线解析:
    • 框架 profiler:scripts/offline_parse_pytorch.py <profiler_path>(PyTorch),scripts/offline_parse_mindspore.py <profiler_path>(MindSpore)
    • msprof:msprof --export=on --output=<output_path>(output 指向 PROF_{} 所在路径或导出目录)

分析步骤

  • 多卡原则:多卡数据默认只抽查一张卡(如 Rank0);仅当用户明确要求「每张卡都检查」「逐卡校验」时,再逐卡检查。
  • 类型绑定原则(必须严格遵守):数据类型的判定依据是用户给定的顶层路径。判定后,全程只执行该类型对应的步骤,不得混用。
    • 若顶层路径以 [*]_ascend_pt 或 [*]_ascend_ms 结尾 → 仅用框架 profiler 规则。
    • 若顶层路径为 PROF_[*] 目录 → 仅用 msprof 规则。

1. 识别数据类型

  • [*]_ascend_pt → 框架 profiler(PyTorch);多子目录→多卡,单目录→单卡
  • [*]_ascend_ms → 框架 profiler(MindSpore);多子目录→多卡,单目录→单卡
  • PROF_[*] → msprof 命令行;多子目录 → 多卡,单目录 → 单卡

2. 校验采集状态 (Stop Check)

  • 框架 profiler:检查 profiler_info.json 或 profiler_info_{Rank_ID}.json;缺失则提示「采集未正常 Stop」,终止,建议检查 profiler.stop()
  • msprof:检查 PROF_{}/device_{}/ 下是否存在 end_info.{}({} 为 device 编号占位);缺失则提示「采集未正常结束」,终止

3. 解析配置(仅框架 profiler)

  • 框架 profiler:调用 get_profiler_config 读取 profiler_info.json,关注 profiler_level、with_stack、with_modules、record_shapes、profile_memory。
  • msprof:无需检查配置,跳过本步骤。

4. 校验解析状态 (Parse Check)

  • 框架 profiler:检查是否存在 ASCEND_PROFILER_OUTPUT 或对应解析输出目录;若缺失则停止分析,询问用户是否协助解析,同意则执行 offline_parse_pytorch.py(PyTorch)或 offline_parse_mindspore.py(MindSpore)。
  • msprof:检查 PROF_{} 下是否存在 mindstudio_profiler_output 目录(即 msprof --export=on 的导出结果);若缺失则停止分析,询问是否协助执行 msprof --export=on --output=<path>。
  • 解析完成(或已存在解析结果)后,继续第 5 步。

5. 检查关键交付件

  • 框架 profiler:按 export_type 检查——Text 模式需 trace_view.json、kernel_details.csv;DB 模式需 [*]_profiler_[*].db。缺失则警告影响 Timeline/算子分析。
  • msprof:检查 PROF_{} 下是否含 msprof_[*].db,或 mindstudio_profiler_output 下是否含 msprof_{timestamp}.json、op_summary.csv。都缺失则警告。

输出策略

本技能为前置校验,不必每次都输出完整报告:

  • 用户明确要求「检查数据」「看校验结果」时,输出简洁结构化报告,按以下格式(每项一行,无则略过):
    【类型】框架 profiler (PyTorch/MindSpore) 或 msprof 命令行采集 | 单卡/多卡
    【状态】valid / invalid / unparsed
    【配置】level、with_stack、profile_memory、采集步数等关键项(仅框架 profiler)
    【缺失】trace_view.json、kernel_details.csv 等(如有)
    【建议】需解析 / 检查 profiler.stop / 无
    【下一步】推荐的分析技能或操作
    
  • 前置调用(用户在做 Timeline / 算子分析等):
    • invalid(未 Stop)→ 必须告知并终止
    • unparsed(未解析)→ 告知需先解析并询问是否协助
    • 校验通过 → 静默进入后续分析

约束

  • invalid(未正常 Stop)必须终止流程
  • unparsed(未解析)必须优先引导解析,否则后续工具无法运行

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 19, 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 19, 2026

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

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

kali20gakki/msAgent32Updated Oct 19, 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 19, 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 19, 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 19, 2026

See all skills by kali20gakki

Report a problem with this skill