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_matmul_full_load_wiki.md
View on GitHub# ops-nn 官方 Wiki:MatMul 小输入全载复用【官方文档】
## 基本信息
- 算子类别:matmul
- DSL/框架:ascendc
- 类型:非PR(官方 Wiki)
- 来源可信度:官方文档
## 来源链接
- PR/出处链接:<https://gitcode.com/cann/ops-nn/wiki/MatMul%E7%AE%97%E5%AD%90%E6%80%A7%E8%83%BD%E4%BC%98%E5%8C%96%E5%AE%9E%E8%B7%B5%E4%B8%8E%E6%95%88%E6%9E%9C%E5%88%86%E6%9E%90.md>( 已验证可达,验证日期 2026-08)
- 优化代码查看:官方 Wiki 文章内代码段;无独立 PR diff
## 问题与瓶颈
MatMul 左右输入一路很小、另一路很大时,通用切分会重复搬运小矩阵,导致 MTE/L1 流量和搬运轮次高于必要值。
## 优化方法(理论手段)
1. **小矩阵全载**:把较小的一路完整装入片上层级,在多轮大矩阵切分中复用,减少重复 GM→L1/L0 搬运。
2. **按左右矩阵选择模板**:分别评估 A 全载与 B 全载,选择能满足 L1/L0 容量且复用次数更高的一侧。
3. **容量与流水共同约束**:全载后重新预算 L1/L0A/L0B,避免挤占 double buffer 空间导致流水反而变差。
## 性能对比
搜索可见的官方摘要未附可可靠抄录的量化表;具体数字以原 Wiki 页面为准,落库时不推算。
## 适用范围与警示
- 适用于一侧 K/M/N 维明显较小且能装入片上存储的 MatMul。
- 两侧都大或复用不足时不适用;必须结合 MTE active bandwidth、L2/L1 流量与容量模型判断。
- 全载模板在 A2/A3/A5 的容量和 API 能力不同,必须按目标 SoC 重算 Tiling。
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 |