Skip to main content
skill CX Codex

huawei-cloud-msot-msopprof-operator-profiler — Claude Code skill

huawei-cloud-msot-msopprof-operator-profiler collects operator-level execution data on Ascend NPUs using msopprof in device or simulator mode and generates analysis reports.

MIT 162 installs ★ 59 updated 2026-10-23

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add huaweicloud/huaweicloud-skills --skill huawei-cloud-msot-msopprof-operator-profiler -a claude-code
Open on GitHub

What huawei-cloud-msot-msopprof-operator-profiler does

This skill guides the AI assistant through operator performance profiling on Ascend NPU hardware. The process follows four stages: configuring collection parameters, executing target operators via msopprof, generating structured performance metrics, and exporting data into a profiling database. It handles both physical execution (device) and emulation (simulator) to inspect hardware bottlenecks before on-device deployment.

It bundles an optimization knowledge base with recipes for common primitives like Conv2D, MatMul, Attention, and NMS, alongside architectural migration case studies such as YOLOv8s on Ascend 910B. Collected trace data is evaluated using python3 scripts/analyze_profile.py --data /path/to/output.

Profiling is strictly confined to operator workloads on Ascend and does not handle full system-level tracing or non-Ascend hardware. Without CANN >= 7.0.0, msopprof >= 1.0.0, and the official Ascend NPU driver present on the host system, runs will fail immediately.

What it helps with

  • Capture operator runtime metrics on Huawei Ascend NPU hardware
  • Benchmark operator execution differences between device and simulator modes
  • Detect CPU fallbacks and memory transfer bottlenecks in deep learning models
  • Generate structured operator performance reports for latency reduction

Example prompts for the agent

  • Profile operator ./my_operator on Ascend NPU using device mode and save to ./output
  • Collect operator metrics with msopprof and analyze the output directory
  • Compare simulator and device execution profiles for this custom layer

How to install huawei-cloud-msot-msopprof-operator-profiler

1Skills CLI (Vercel)

npx skills add huaweicloud/huaweicloud-skills --skill huawei-cloud-msot-msopprof-operator-profiler -a claude-code

2Manually: put the files in place

~/.claude/skills/huawei-cloud-msot-msopprof-operator-profiler/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/huawei-cloud-msot-msopprof-operator-profiler/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about huawei-cloud-msot-msopprof-operator-profiler

How to install huawei-cloud-msot-msopprof-operator-profiler in Claude Code?

Run npx skills add huaweicloud/huaweicloud-skills --skill huawei-cloud-msot-msopprof-operator-profiler -a claude-code. The skill file is placed at ~/.claude/skills/huawei-cloud-msot-msopprof-operator-profiler/SKILL.md.

What does this skill do?

It orchestrates the Huawei msopprof utility to capture execution timing of machine learning operators on Ascend NPUs and processes the resulting logs into performance summaries.

What environment prerequisites are needed?

You need an Ascend NPU driver installed, CANN platform version 7.0.0 or higher, msopprof version 1.0.0 or higher, plus Python 3 and Bash.

Source text

SKILL.md · MIT
---
name: huawei-cloud-msot-msopprof-operator-profiler
description: |
  Collect operator-level performance data on Ascend NPU using msopprof tool.
  Supports both device mode and simulator mode, generates performance analysis
  reports. Use this skill when the user wants to: (1) profile operator
  performance on Ascend NPU, (2) collect performance data for analysis,
  (3) identify performance bottlenecks through operator execution characteristics.
  Trigger: user mentions "msopprof", "profiler", "performance profiling",
  "operator profiling", "Ascend", "NPU", "profile data", "性能采集",
  "算子性能", "性能剖析", "算子耗时采集"
compatibility:
  - msopprof >= 1.0.0
  - CANN >= 7.0.0
tags: [Ascend, msopprof, profiler, operator]
allowed-tools:
  - python3
  - msopprof
  - bash
---

# Huawei Cloud msOT msopprof Operator Profiler

## Overview

This skill provides operator-level performance profiling capabilities for
Ascend NPU.

**Architecture**: Profiling Configuration → Data Collection → Report Generation
→ Analysis

**Related Skills**:

- `huawei-cloud-ascend-profiler-db-explorer` - Profiling database analysis and
  query
- `huawei-cloud-ascend-small-model-migrate` - Migration workflow that uses
  performance data

## Architecture Components

This skill involves the following cloud services and components:

- **msopprof**: Huawei Cloud operator profiling tool for Ascend NPU
- **CANN**: AI Computing Platform for NPU runtime support
- **Ascend NPU**: Target hardware for performance profiling
- **Profiling Database**: Storage for collected performance data

**Architecture Diagram:**

```text
┌─────────────────────────────────────────────────────────────┐
│           msOT msopprof Operator Profiler Skill            │
├─────────────────────────────────────────────────────────────┤
│  ┌──────────────┐    ┌──────────────┐    ┌──────────────┐ │
│  │  Profiling   │───▶│  Data        │───▶│  Report      │ │
│  │  Config      │    │  Collection  │    │  Generation  │ │
│  └──────────────┘    └──────────────┘    └──────────────┘ │
│         │                   │                   │          │
│         ▼                   ▼                   ▼          │
│  ┌──────────────┐    ┌──────────────┐    ┌──────────────┐ │
│  │  Mode        │    │  Operator    │    │  Data        │ │
│  │  Selection   │    │  Execution   │    │  Export      │ │
│  │  (Device/Sim)│    │  Monitoring  │    │              │ │
│  └──────────────┘    └──────────────┘    └──────────────┘ │
└─────────────────────────────────────────────────────────────┘
```

## Use Cases

**Typical Problem Scenarios:**

- Collecting operator-level performance data on Ascend NPU
- Profiling model inference performance
- Identifying performance bottlenecks through operator execution
- Comparing operator performance between device and simulator modes
- Generating performance analysis reports for model optimization

**Typical User Phrases:**

- "Profile operator performance on Ascend NPU"
- "Collect performance data using msopprof"
- "Generate performance analysis report"
- "Compare device vs simulator profiling"
- "Identify performance bottlenecks"
- "AscendCollectionOperatorPerformanceData"
- "msopprofPerformance"
- "PerformanceAnalysisReport"

## Scope

**Supported**:

- Operator performance data collection
- Device mode profiling
- Simulator mode profiling
- Report generation

**Not supported**:

- System-level profiling
- Non-Ascend platforms

## Core Workflow

### 1. Profiling Configuration

- Set up profiling parameters
- Configure collection mode (device/simulator)

### 2. Data Collection

- Execute profiling on target model
- Collect operator performance data

### 3. Report Generation

- Generate profiling reports
- Output performance metrics

### 4. Data Export

- Export data to profiling database
- Prepare for further analysis

## Enhanced Features

### Best Practices Knowledge Base

This skill integrates a searchable knowledge base containing migration success
stories and optimization patterns:

**Features:**

- **Case Study Repository**: Searchable database of migration success stories
  for common model architectures
- **Operator Optimization Recipes**: Proven optimization patterns with code
  snippets for common operators
- **Similarity Matching**: Recommends proven solutions based on model
  architecture similarity
- **Performance Patterns**: Collection of known performance patterns and
  anti-patterns
- **Expert Recommendations**: Curated tips from Ascend optimization experts

**Knowledge Base Structure:**

- **Case Studies**: YOLO, ResNet, UNet migration success stories
- **Operator Recipes**: Conv2D, MatMul, Attention optimization patterns
- **Performance Patterns**: Common bottleneck patterns and solutions
- **Expert Tips**: Optimization best practices from field experts

### YOLOv8 Migration Success Story

#### Model Information

- Model: YOLOv8s
- Input: 640x640
- Target: Ascend 910B

#### Challenges Encountered

1. **Issue**: NMS operator fallback to CPU

   - **Solution**: Implemented AscendC NMS operator
   - **Gain**: 30% latency reduction

2. **Issue**: Memory bandwidth bottleneck

   - **Solution**: Optimized data layout and batch processing
   - **Gain**: 15% throughput improvement

3. **Issue**: Custom activation function

   - **Solution**: Replaced with supported operators
   - **Gain**: Stable NPU execution

#### Final Results

- **Latency**: 8.2 ms → 5.1 ms (-37.8%)
- **Throughput**: 122 FPS → 196 FPS (+60.7%)
- **Accuracy**: 60.2% → 60.4% (+0.2%)

#### Key Takeaways

- Always check operator coverage before migration
- Implement custom operators for critical path
- Optimize memory access patterns

### Operator Optimization Recipes

- **Conv2D**: Padding overhead → Use native NPU padding (5-10% gain)
- **MatMul**: Memory layout → Optimal tiling config (10-15% gain)
- **Attention**: FlashAttention → Enable NPU FlashAttention (20-30% gain)
- **NMS**: CPU fallback → AscendC implementation (25-35% gain)

## Reference Documents

- [Acceptance Criteria](references/acceptance-criteria.md) - Functional
  acceptance criteria
- [Verification Method](references/verification-method.md) - Verification approach
- [Troubleshooting](references/troubleshooting.md) - Common issues and solutions

## Prerequisites

- msopprof >= 1.0.0 installed
- CANN >= 7.0.0 installed
- Ascend NPU driver installed
- Operator code to be analyzed

## Core Commands

```bash
# Collect operator performance data
msopprof --output=/path/to/output \
  --mode=device \
  ./my_operator

# Analyze performance report
python3 scripts/analyze_profile.py --data /path/to/output
```

## Parameter Confirmation

- **output**: Performance data output path (Required)
- **mode**: Collection mode (device/simulator) (Optional)
- **operator**: Operator executable file path (Required)

© huaweicloud · MIT · huaweicloud/huaweicloud-skills

Similar skills

All skills for AI and ML →

From the same set80

The whole set →
huawei-cloud-msmodelslim-model-adapt huawei-cloud-msmodelslim-model-adapt — a skill for Claude Code and Codex that builds Transformers model adapters for msModelSlim quantization. Guides the flow from reading config.json to four-step weight verification. CX Codex +1 165installs huawei-cloud-ucs-policy-governor The huawei-cloud-ucs-policy-governor skill manages Huawei Cloud UCS policies through hcloud, from policy instances and definitions to enforcement checks and fleet compliance. CX Codex +1 164installs huawei-cloud-msmodelslim-model-analysis huawei-cloud-msmodelslim-model-analysis — a skill for Claude Code and Codex that inspects a model architecture before writing an msModelSlim adapter. Checks implementation source and MoE quantization risks. CX Codex +1 163installs huawei-cloud-cce-kubernetes-event-analyzer huawei-cloud-cce-kubernetes-event-analyzer reads Kubernetes Events from Huawei Cloud CCE clusters, groups repeated warnings and points at the pod or namespace that broke. CX Codex +1 162installs huawei-cloud-cdn-traffic-anomaly-analysis huawei-cloud-cdn-traffic-anomaly-analysis pulls a CDN domain's billing mode and traffic metrics through the hcloud CLI, then compares the current window with a three-month baseline to flag days that break the pattern. CX Codex +1 159installs huawei-cloud-apig-instance-management huawei-cloud-apig-instance-management manages Huawei Cloud APIG dedicated instances via hcloud CLI. Handles API lifecycle, throttling policies, ACL rules, and public ingress diagnostic checks. CX Codex +1 155installs huawei-cloud-install-openjiuwenswarm huawei-cloud-install-openjiuwenswarm is a Claude Code skill that installs and starts JiuwenSwarm inside an active Huawei Cloud dev container without manual setup. CX Codex +1 153installs huawei-cloud-ecs-sqlbot-deploy huawei-cloud-ecs-sqlbot-deploy spins up a Huawei Cloud X instance and deploys SQLBot, an app for intelligent SQL queries. One run: server, security groups, COC deployment. CX Codex +1 149installs

Project sponsors

Companies that keep this analytics open