基于 SOC 职业分类
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/mindspore-ai/akg --skill performance-summary命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
矩阵乘法矩阵乘法 A[M, K] @ B[K, N] = C[M, N]中,大K维度矩阵乘法(K>>M,N)优化:针对M/N较小但K极大(如M=N=256,K=131072)的场景,Split-K切分K维度并行化、Workspace+Reduce替代全局同步,实现显著性能提升
Triton Ascend hard API restrictions and forbidden syntax. MUST-follow rules that apply to every kernel: forbidden control flow (return/break/continue/lambda/while), tensor slice/index restrictions, scalar conversion rules, BLOCK_SIZE upper bound. Violating any of these produces a compile or runtime error on Ascend.
Triton Ascend 性能优化通用策略: BLOCK_SIZE 选择 (1024-2048 for elementwise, must be <65536), grid configuration (use VEC_CORE_NUM / CUBE_CORE_NUM, 2D/3D grid for matmul / conv / reduce, 1D grid + inner loop for elementwise / pointwise), 256B alignment for memory transfers, autotune block-size patterns, fp16 / fp32 precision conversion. Bind via keywords like matmul, elementwise, reduce, block_size, grid, autotune, alignment, fp16, fp32, tile, interleaved-loop, cube-core, vec-core.
| name | performance-summary |
| description | 用于汇总和对比多个算子的性能测试结果。当用户请求汇总多个算子的性能结果、对比算子 benchmark、生成性能报告、分析多个 kernel 的加速比时使用此 Skill。 |
汇总和对比多个算子的性能指标。
收集性能数据
read_file 读取各算子的 verify_<op_name>/result.json生成对比表格
| 算子 | 延迟 (ms) | 吞吐量 | 内存 (MB) | 加速比 |
|--------|-----------|--------|-----------|--------|
| relu | 0.15 | 1000 | 128 | 2.3x |
分析结果
生成报告
使用模板:## 测试环境 → ## 性能对比 → ## 分析 → ## 优化建议
性能结果存储在验证目录中:
verify_<op_name>/result.json - 主要结果verify_<op_name>/profiling.json - 详细性能分析(如有)| 指标 | 说明 |
|---|---|
| latency_ms | 单次执行延迟(毫秒) |
| throughput | 每秒操作数 |
| speedup | 相对基准(torch)的加速比 |
| memory_usage_mb | 峰值内存占用(MB) |
用户: "帮我汇总 relu 和 sigmoid 算子的性能"
Agent 执行:
read_file("verify_relu/result.json")read_file("verify_sigmoid/result.json")可使用 scripts/collect_metrics.py 批量收集并打印性能汇总:
from collect_metrics import collect_metrics, print_results
# 打印格式化的性能汇总结果
print_results()
使用 --verify 参数验证当前 skill 是否可用:
python scripts/collect_metrics.py --verify
验证内容包括:
输出示例:
============================================================
性能汇总结果
============================================================
| Operator | Latency (ms) | Throughput | Memory (MB) | Speedup | Correct |
|----------|--------------|------------|-------------|---------|---------|
| matmul | 1.234 | 5000 | 256.0 | 1.80x | ✅ |
| relu | 0.150 | 10000 | 128.0 | 2.30x | ✅ |
| sigmoid | 0.180 | 8000 | 128.0 | 2.10x | ✅ |
============================================================