Skip to content
OpenSmartRoute
Skillv1.0.0

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 this skill when the user wants to: (1) calcula

by huaweicloud(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from huaweicloud/huaweicloud-skills (skills/ai/modelarts/huawei-cloud-ascend-op-mfu-calculator/SKILL.md). Install upstream with npx skills add huaweicloud/huaweicloud-skills --skill huawei-cloud-ascend-op-mfu-calculator. Copyright stays with the author.

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

  1. Python 3.8+ installed
  2. 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

  1. Input Collection: Gather operator parameters (matrix dimensions, data types, execution time)
  2. FLOPs Calculation: Compute theoretical FLOPs for the operation
  3. Achieved Performance: Calculate achieved TFLOPs/s from execution time
  4. MFU Calculation: Apply formula MFU = Achieved FLOPs / Peak FLOPs
  5. 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

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/huaweicloud-huaweicloud-skills-huawei-cloud-ascend-op-mf-173ee3/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

huaweicloud-huaweicloud-skills-huawei-cloud-ascend-op-mf-173ee3.ocm.jsonjson
{
  "ocm": "1",
  "id": "huaweicloud-huaweicloud-skills-huawei-cloud-ascend-op-mf-173ee3",
  "kind": "skill",
  "name": "huawei-cloud-ascend-op-mfu-calculator",
  "description": "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性能\"",
  "publisher": "huaweicloud",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "math"
    ],
    "tags": [
      "skill-md",
      "ascend",
      "mfu",
      "operator",
      "performance",
      "skills-sh"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "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性能\""
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/huaweicloud/huaweicloud-skills",
      "path": "skills/ai/modelarts/huawei-cloud-ascend-op-mfu-calculator/SKILL.md",
      "ref": "HEAD",
      "url": "https://github.com/huaweicloud/huaweicloud-skills/blob/HEAD/skills/ai/modelarts/huawei-cloud-ascend-op-mfu-calculator/SKILL.md",
      "key": "huaweicloud/huaweicloud-skills/skills/ai/modelarts/huawei-cloud-ascend-op-mfu-calculator/SKILL.md"
    },
    "compatibility": "['Python3 >= 3.8']",
    "allowed_tools": [
      "python3"
    ]
  },
  "instructions": "# Huawei Cloud Ascend Operator MFU Calculator\n\n## Overview\n\nThis skill calculates MFU (Machine FLOP Utilization) for operators like matmul/GEMM/FlashAttention on Ascend NPU, providing clear formulas and derivation process.\n\n**Architecture**: Input Validation → FLOPs Calculation → Achieved TFLOPs/s → MFU Calculation → Result Analysis\n\n**Related Skills**:\n- `huawei-cloud-ascend-profiler-db-explorer` - Profiling data analysis for operator performance data\n\n## Prerequisites\n\n1. Python 3.8+ installed\n2. Basic understanding of FLOPs calculation concepts\n\n## Usage Scenarios\n\n**Typical Problem Scenari",
  "cost": {
    "context_tokens": 726
  }
}

Fetch it by URL: GET /api/v1/registry/huaweicloud-huaweicloud-skills-huawei-cloud-ascend-op-mf-173ee3/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.