Develop and optimize custom operators using AscendC programming language. Analyze operator performance bottlenecks and conduct optimization validation. Based...
编程
huawei-cloud-ascend-op-mfu-calculator
试用Calculate MFU (Machine FLOP Utilization) for operators like matmul/GEMM/FlashAttention on Ascend NPU, providing clear formulas and derivation process Use thi...
它能做什么
Calculate MFU (Machine FLOP Utilization) for operators like matmul/GEMM/FlashAttention on Ascend NPU, providing clear formulas and derivation process Use this skill when the user wants to: (1) calculate MFU for matrix operations, (2) analyze operator performance efficiency, (3) understand hardware utilization, (4) optimize operator implementation Trigger: user mentions "MFU", "machine flop utilization", "operator FLOPs", "matmul performance", "GEMM efficiency", "Ascend MFU", "算子MFU", "算力利用率", "矩阵乘效率", "GEMM性能", "FlashAttention性能"
技能文档
Huawei Cloud Ascend Operator MFU Calculator
Overview
This skill calculates MFU (Machine FLOP Utilization) for operators like matmul/GEMM/FlashAttention on Ascend NPU, providing clear formulas and derivation process.
Architecture: Input Validation → FLOPs Calculation → Achieved TFLOPs/s → MFU Calculation → Result Analysis
Related Skills:
huawei-cloud-ascend-profiler-db-explorer- Profiling data analysis for operator performance data
Prerequisites
- Python 3.8+ installed
- Basic understanding of FLOPs calculation concepts
Usage Scenarios
Typical Problem Scenarios:
- Evaluating how well an operator utilizes Ascend NPU compute power
- Comparing performance of different operator implementations
- Identifying optimization opportunities for matrix operations
Typical User Utterances:
- "Calculate MFU for my GEMM operator"
- "What's the machine FLOP utilization for FlashAttention?"
- "Analyze my matmul operator performance efficiency"
Workflow
- Input Collection: Gather operator parameters (matrix dimensions, data types, execution time)
- FLOPs Calculation: Compute theoretical FLOPs for the operation
- Achieved Performance: Calculate achieved TFLOPs/s from execution time
- MFU Calculation: Apply formula MFU = Achieved FLOPs / Peak FLOPs
- Result Analysis: Provide interpretation and optimization suggestions
MFU Calculation Formula
MFU = (Achieved FLOPs / Peak FLOPs) × 100%
Where:
- Achieved FLOPs = Operation FLOPs / Execution Time
- Peak FLOPs = Hardware-specific peak performance (e.g., Ascend 910B: 256 TFLOPs for FP16)
Reference Documents
| Document | Description |
|---|---|
| Ascend 910B Series Technical Specifications | Official Ascend 910B series product specifications |
| MFU Calculation Methodology | Detailed MFU calculation formulas and examples |
| FlashAttention Technical Paper | Original FlashAttention research paper |
Enhanced Features
Intelligent Bottleneck Diagnoser
- AI-powered bottleneck diagnosis that analyzes profiling data to identify root causes automatically
- Classifies bottlenecks into categories: memory-bound, compute-bound, communication-bound, or operator-fallback
- Provides actionable optimization recommendations with priority ranking
- Includes pattern matching for known performance anti-patterns
Parameter Confirmation
| Parameter | Description | Required |
|---|---|---|
| operator | Operator type (matmul/flash_attention/gemm, etc.) | Yes |
| flops | Theoretical FLOPs of the operator | Yes |
| time_ms | Operator execution time (milliseconds) | Yes |
| peak_tflops | Hardware peak computing power (TFLOPS) | Yes |
| device | NPU device type (910B/910, etc.) | No |
相关技能
Collect operator-level performance data on Ascend NPU using msopprof tool. Supports both device mode and simulator mode, generates performance analysis repor...
用自然语言控制华为昇腾 NPU,本地或 SSH 远程执行 npu-smi 命令。
把自然语言性能问题转换为安全 SQL,查询 Ascend PyTorch Profiler / msprof 数据库中的算子、通信与调度耗时。
Migrate vision/detection/segmentation small models to Ascend NPU, covering the full workflow: model structure analysis, migration verification, performance p...
在华为云昇腾 910B DevServer 上按单机或双机(16 卡)拓扑部署并测试 LLM、VL、Embedding、Rerank 模型。
huaweicloud-skills-team 的更多技能
浏览全部技能用自然语言控制华为昇腾 NPU,本地或 SSH 远程执行 npu-smi 命令。
在华为云昇腾 910B DevServer 上按单机或双机(16 卡)拓扑部署并测试 LLM、VL、Embedding、Rerank 模型。
面向华为云资源的只读查询能力,用于资源清点、核对与参数发现。
通过本地 Python SDK 只读查询华为云 IAM 资源(用户、用户组、策略、委托、AK/SK、MFA、安全设置)。
在华为云 Flexus L 实例上一键部署 OpenClaw AI Agent 平台,并完成模型与通道配置。
在华为云 Flexus L 实例上一键部署 Hermes AI Agent 平台,并完成大模型与机器人通道配置。