huaweicloud/huaweicloud-skills

huawei-cloud-msot-msopprof-operator-profiler

Collect operator-level performance data on Ascend NPU using msopprof tool.

View source
Original skill document

Rendered from the source repository. Headings, examples, code, tables, links, and referenced images are preserved.

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
  1. Issue: Memory bandwidth bottleneck
  • Solution: Optimized data layout and batch processing
  • Gain: 15% throughput improvement
  1. 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

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)
from this repository

More skills

All skills
huaweicloud
Community

huawei-cloud-publish-work-to-gallery

Publish user's work to the Huawei Cloud University Operations Platform (华为云高校运营平台/作品陈列馆). Use this skill whenever the user wants to publish, submit, or upload a project/work to the gallery or a training camp (训练营) on the platform — including casual phrasings like "把作品发布上去", "投稿到陈列馆", "传作品到平台", "提交作品/项目", "报名发布作品", as well as formal ones like "publish to work gallery", "submit to training camp", "upload work to the platform". Do NOT use for general dev questions, git push to GitCode alone, or platform browsing without publishing intent.

installs
5
GitHub stars
50
Updated
Sep 23
huaweicloud
Community

huawei-cloud-eip-cost-optimizer

Huawei Cloud EIP (Elastic IP) cost optimization skill using hcloud CLI (KooCLI). 1. List and query EIPs across regions with detailed status 2. Identify idle/unbound EIPs and generate cost optimization reports 3. Set up idle EIP monitoring with webhook/email alerts 4. Generate HTML/JSON cost analysis reports 5. Maintain operation audit logs for compliance Read-only analysis only - NO bandwidth adjustment, tag management, or EIP release/deletion. Triggers include: "EIP cost optimization", "idle EIP analysis", "EIP audit", "cost report", "EIP status query", "EIP list", "EIP monitoring", "EIP alert", "cost analysis", "idle monitoring", "operation audit", "EIP 成本优化", "闲置 EIP 分析", "EIP 审计", "成本报告", "EIP 状态查询", "EIP 查询", "EIP 列表", "EIP 监控", "EIP 告警", "成本分析", "闲置监控", "操作审计"

installs
1
GitHub stars
50
Updated
Sep 22
huaweicloud
Community

huawei-cloud-flexus-l-deploy-jiuwenswarm

One-click deployment of JiuwenSwarm multi-Agent collaboration platform on Huawei Cloud Flexus L instances. Usage scenarios: When users need to quickly deploy JiuwenSwarm/JiuwenClaw on Huawei Cloud Flexus L instances, when they need to automatically create cloud instances and deploy AI Agent platforms, when they need to configure model APIs and message channels (Xiaoyi/Feishu/DingTalk). Automatically create instances, deploy applications via COC, configure models and message channels. Trigger keywords: JiuwenSwarm deployment, JiuwenClaw deployment, 九问Swarm部署, 九问Claw部署, 一键部署JiuwenSwarm, AI智能体平台部署, 部署九问Swarm, 部署九问Claw,云服务器部署AI平台.

installs
1
GitHub stars
50
Updated
Sep 22
huaweicloud
Community

huawei-cloud-flexus-l-server-flexusagent-deployment

Deploy AI Agent development platform (Dify) on Huawei Cloud Flexus L instance, providing deployment operations, password management, MaaS model configuration, and workflow import capabilities. Trigger keywords: deploy flexusagent/一键部署Flexus AI Agent开发平台、change password/修改开发平台管理员密码、change dify password/修改dify平台密码、add maas provider/添加MaaS模型供应商、configure maas model/配置MaaS模型、view workflow/查看AI Agent工作流、import workflow/导入AI Agent工作流

installs
1
GitHub stars
50
Updated
Sep 22