kali20gakki/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/catlass/pr_catlass_grouped_matmul_tiling.md
View on GitHub# MR !978 更新 cppgen grouped matmul 的 default tiling 策略【PR】
## 基本信息
- 算子类别:matmul
- DSL/框架:catlass
- 类型:PR
- 来源可信度:一手 PR 原文
## 来源链接
- PR/出处链接:<https://gitcode.com/cann/catlass/pull/978>( 已验证可达,验证日期 2026-08);关联 issue:<https://gitcode.com/cann/catlass/issues/386>( 已验证可达,验证日期 2026-08)
- 优化代码查看:<https://gitcode.com/cann/catlass/pull/978/files>( 已验证可达,验证日期 2026-08)
## 问题与瓶颈
`get_default_tile_shape` 返回固定 `GemmShape(256,256,256), GemmShape(256,256,64)`,fp32 下所需 L1 空间 `256*256*sizeof(float)*(L1A_STAGES+L1B_STAGES)` = 1024KB,超过 512KB 硬件约束导致报错。
## 优化方法(理论手段)
1. **按 `element_max_size` 计算默认 tiling**:不再返回固定 tile 形状,而是根据元素最大尺寸推导默认 tiling,保证片上存储需求不超过硬件容量。
2. **tiling 形状与片上存储(L1)容量联合约束求解**——典型的 tile-size/存储容量权衡案例。
## 性能对比
原文未附量化数字(本 MR 为修复硬件容量约束导致的报错,属正确性/可用性修复而非性能优化)。
## 适用范围与警示
- 触发场景为 cppgen grouped matmul 在 fp32 等较大元素 dtype 下默认 tiling 超出 L1 容量(512KB 约束);fp32 以外 dtype 的固定默认值同样存在越界风险,本修复统一改为按 `element_max_size` 计算。
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 |