Repository navigation
feat(profiling): add compute-bound Roofline check to profiling-analysis - #144
Merged
Merged
Conversation
…is-computing Compare theory vs actual duration for aic_mac_ratio>=80% kernels and suggest whether optimization is needed. Co-authored-by: Cursor <cursoragent@cursor.com>
Move aic_mac_ratio Roofline analysis out of profiling-analysis-computing into a sibling skill and restore the original computing skill. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
代码合并说明
变更描述
增强 profiling-analysis-computing Skill,新增算力瓶颈算子 Roofline 核对能力,包含:
对 kernel_details.csv 中 aic_mac_ratio≥80% 的算子,按 NPU 峰值算力与带宽计算理论耗时,并与实际耗时对比
按效率给出是否需要优化的判断,以及初步优化/排查方向建议
变更类型
新增 Skill
更新现有 Skill
修复问题
其他(请说明)
涉及的 Skill
Skill 名称: profiling-analysis-computing
变更内容摘要
SKILL.md:补充第 4 步「算力瓶颈 Roofline 核对」流程、脚本说明与输出说明;更新 description 触发词(aic_mac_ratio / Roofline / 理论耗时等)
reference/kernel_roofline_compute_check.md:
说明必填输入(--flops、--bandwidth)与命令示例
明确理论耗时 / 效率口径与是否需优化判据
列出可建模算子范围(MatMul 系、Quant、Grouped、Compressor、SparseAttn、HcPre 等)
scripts/kernel_roofline_compute_check.py:
默认只分析 aic_mac_ratio≥80% 的算力瓶颈算子
计算 理论耗时 = max(FLOPs/算力, Bytes/带宽),输出效率、浪费时长、是否需优化与排查建议
支持常见 GEMM 与 Compressor / SparseAttn / HcPre 等专项建模
scripts/op_perf_analysis_combine.py:
在原有筛选 / 透视 / 形状解析流程后,增加可选 Roofline 核对步骤
提供 --flops / --bandwidth 时自动执行;未提供则跳过并提示补跑
父 Skill profiling-analysis/SKILL.md:导航表补充 Roofline 核对能力说明
检查清单(作者自审)
SKILL.md 格式检查
name 与目录名一致:profiling-analysis-computing
description 长度满足要求
frontmatter 以 --- 包裹
正文无 [TODO] 占位
内容完整性检查
内部链接指向正确(如有)
代码块语言标注正确
表格格式正确(如有)
仓库更新检查
已在既有 Skill 目录内更新(marketplace 无需新增条目)
父 Skill / 导航说明已同步(如适用)
测试说明
已在本地执行:
python skills/profiling/profiling-analysis/profiling-analysis-computing/scripts/kernel_roofline_compute_check.py --self-test
python skills/profiling/profiling-analysis/profiling-analysis-computing/scripts/kernel_roofline_compute_check.py
--csv "C:/Users/Downloads/kernel_details.csv"
--flops 313 --bandwidth 1.2 --bw-unit TB/s
--out "C:/Users/Downloads/kernel_roofline_compute_check.csv"
脚本运行正常:自测通过;对真实 kernel_details.csv 可正确筛选算力瓶颈算子,输出理论/实际耗时对比、是否需优化判断与排查建议,并生成明细 CSV。
image