Ascend/msagent / skills/operator/ops-performance-tuning
ops-performance-tuning
VerifiedCompile, profile, diagnose, optimize, and compare Ascend NPU operators across CANN versions and A2/A3/A5 for Ascend C, CATLASS, Triton-Ascend, TileLang-Ascend, PyPTO, and SHMEM/MC2. Use when an operator already has a runnable implementation and the user asks for msOpProf collection, bottleneck analysis, source-level tuning, or a reproducible before/after performance report. Do not use as the primary workflow for operator creation, migration, or unresolved correctness failures.
references/cases/ascendc/pr_ascendc_mhc_24x.md
View on GitHub# MR !1589(cann/ops-transformer)"add mhc" —— AscendC mHC 算子【PR】
## 基本信息
- 算子类别:misc(einsum 类小矩阵批量计算,mHC / Manifold-Constrained Hyper-Connections)
- DSL/框架:ascendc
- 类型:PR
- 来源可信度:一手 PR 原文(内容来自 GitCode 仓库提交记录页)
## 来源链接
- PR/出处链接:<https://gitcode.com/cann/ops-transformer/pull/1589>( 已验证可达,验证日期 2026-08)
- 优化代码查看:<https://gitcode.com/cann/ops-transformer/pull/1589/files>( 已验证可达,验证日期 2026-08)
## 问题与瓶颈
面向昇腾 NPU 的 mHC(Manifold-Constrained Hyper-Connections)算子,基线为 torch.einsum;原文未附 profiling 指标数据。实现为 AscendC(智子芯元 KernelCAT 智能体生成)。
## 优化方法(理论手段)
1. **einsum 类小矩阵批量计算的融合 + 片上复用**:消除中间结果 GM 往返。
## 性能对比
(MR 描述原文,对比 torch.einsum,Ascend 910B2)
| 算子 | 加速比 |
|---|---|
| mhc_pre | 24x ~ 52x |
| mhc_post | 2x ~ 5x |
| mhc_res | 24x ~ 50x |
## 适用范围与警示
- 适用:Ascend 910B2;对比基线为 torch.einsum,非优化后 AscendC 实现间对比。
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| planning-and-task-breakdownaddyosmani/agent-skillsBreaks work into ordered tasks. Use when you have a spec or clear requirements and need to break work into implementable tasks. Use when a task feels too large to start, when you need to estimate scope, or when parallel work is possible. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| screenpipethedotmack/claude-memSearch screen and audio history recorded by Screenpipe and optionally save selected context into claude-mem. Use when the user asks to recall desktop activity, a meeting, or something seen in another app through Screenpipe. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |
| contact-widgetnexu-io/open-designSelf-contained floating chat widget with welcome screen, social links, meeting button, and message input. Single HTML file, zero dependencies. | Stars: 108k | Updated | Claude CodeCodex | Verified | Install |
| meeting-notesnexu-io/open-designMeeting notes page — title bar with attendees, agenda checklist, decisions block, action items table with owners + dates, and a "next meeting" footer. Use when the brief mentions "meeting notes", "minutes", "1:1 notes", "all-hands recap", or "会议纪要". | Stars: 108k | Updated | Claude CodeCodex | Verified | Install |