jieran-zhang/cannbot-skills/ops-profiling
Claude Code and agent skill by jieran-zhang/cannbot-skills
- community
Checking that the SKILL.md file is still in the repository.
NPU 性能采集与分析,融合 msprof 算子级瓶颈定位与 kernel-level 对比测试,用于采集算子性能数据、对比自定义算子 vs 标杆加速比、定位性能瓶颈并给出优化建议。当用户在算子开发过程中提到"上板性能"、"算子性能测试"、"硬件性能验证"、"NPU性能采集"、"NPU profiling"、"性能对比"、"加速比"等场景时触发。
Install
npx vskill@latest install jieran-zhang/cannbot-skills/ops-profilingSKILL.md
The same SKILL.md was published earlier as tasselszcx/ako-npu/ops-profiling.
上板性能采集与调优
在真实 NPU 上采集算子性能数据,系统化解读指标文件,判定性能是否达标,定位瓶颈类型,并给出可操作的优化建议。
本技能基于 msprof 工具链,统一入口为两个脚本:
- `msprof_profile_run.sh` — 性能采集(标准采集 / 对比测试 / 批量并行)
- `msprof_perf_summary.py` — 结果解析(瓶颈分析 / 对比报告 / 批量汇总)
| 工具 | 流程文档 | 用途 | |
|---|---|---|---|
| `msprof_profile_run.sh` | `references/msprof-guide.md` | 统一采集入口:标准采集、对比测试、批量并行 | |
| `msprof_perf_summary.py` | `references/msprof-guide.md` | 统一解析入口:瓶颈分析、对比报告生成、批量汇总 | |
| `perf_summary.py` | `references/msprof-op-guide.md` | msprof op 归档(需 msopprof) |
使用方式
1. 标准采集模式(深度瓶颈分析)
对单个可执行文件采集 7 组 aic-metrics + sample-based:
2. 对比测试模式(kernel-level 加速比)
对算子目录下的 model.py vs model_new_ascendc.py 做对比测试:
输出:performance.json + performance.log + perf_report.md
3. 批量并行模式(多 NPU)
扫描目录下所有算子子目录,多 NPU 并行执行对比测试:
输出:各子目录 performance.json + batch_performance.log + batch_report.md + batch_summary.json
输入目录结构(对比模式)
传统模式(端到端自动开发):
JSONL 模式(ascend-kernel 工程结构):
用例加载优先级
- 优先:
<op>_perf_cases.jsonl(标准 JSONL 命名) - 回退:任意
*.jsonl文件 - 回退:任意
*.json文件(非.bak,JSON Lines 格式) - 回退:从
model.py的get_input_groups()加载
输出格式(对比模式)
Markdown 报告包含:
- 对比表:
Case | Shape | DType | 自定义算子(us) | 标杆(us) | 加速比 - 全量汇总:用例数、平均加速比、自定义/标杆更优条数
- 按数据类型汇总:分 dtype 的统计
- 简短分析:整体趋势结论
- 深度瓶颈分析入口:提供 msprof 深度分析命令
额外输出:
performance.json— 结构化数据(含 geomean/mean/median/min/max 加速比)performance.log— 打屏日志
深度分析:msprof / msprof op
当性能不达标或需要根因分析时,使用深度分析流程。
选用哪个工具:决策树
- 用户显式指定工具
- 指定
msprof op/ msopprof → 加载 `references/msprof-op-guide.md` - 指定
msprof→ 加载 `references/msprof-guide.md`
- 用户未指定 — 探测环境:
- 仅
msopprof可用 → `references/msprof-op-guide.md` - 仅
msprof可用 → `references/msprof-guide.md` - 两者皆可用 → 须向用户确认或按项目约定选用其一
- 两者皆不可用 → 报错,提示检查 CANN /
ASCEND_HOME安装
参考资源
| 文件 | 内容 | 何时查阅 | |
|---|---|---|---|
| `references/msprof-op-guide.md` | msprof op:构建 / 采集 / 归档 / 判定 / 瓶颈 / 回归 | 选用 msprof op 时 | |
| `references/msprof-guide.md` | msprof:构建 / 采集 / 归档 / 主 Bound 判定 / 瓶颈 | 选用 msprof 时 | |
| `references/csv_fields_reference.md` | CSV 字段定义与阈值 | 理解指标含义时 | |
| `references/optimization_quickref.md` | 瓶颈类型与优化方法 | 定位瓶颈后 |
适用场景总览
| 场景 | 推荐命令 | 说明 | |
|---|---|---|---|
| 算子开发完成后的性能验收 | msprof_profile_run.sh --compare | 快速对比自定义算子 vs 标杆 | |
| 性能问题定位 | msprof_profile_run.sh + msprof_perf_summary.py | 深度瓶颈分析 | |
| 优化效果验证 | msprof_profile_run.sh + msprof_perf_summary.py | 对比优化前后的归档数据 | |
| Agent team 测试阶段 | --compare + 标准采集 | 先快速对比,不达标再深度分析 | |
| 端到端自动开发 Phase 5 | msprof_profile_run.sh --compare | 集成到 ascendc-ops-lab-developer 流程 | |
| 批量性能测试 | msprof_profile_run.sh --batch | 多 NPU 并行批量测试 |
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingops/ops-profiling/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/jieran-zhang/cannbot-skills/ops-profiling)