Install
openclaw skills install @huaweicloudskill/huawei-cloud-ascend-op-mfu-calculatorCalculate MFU (Machine FLOP Utilization) for operators like matmul/GEMM/FlashAttention on Ascend NPU, providing clear formulas and derivation process Use when the user wants to: (1) calculate MFU for matrix operations, (2) analyze operator performance efficiency, (3) bottleneck diagnosis from Ascend profiling data, (4) optimize operator implementation Triggers include: "MFU", "machine flop utilization", "operator FLOPs", "matmul performance", "GEMM efficiency", "Ascend MFU", "算子MFU", "算力利用率", "矩阵乘效率", "GEMM性能", "FlashAttention性能", "瓶颈诊断", "bottleneck"
openclaw skills install @huaweicloudskill/huawei-cloud-ascend-op-mfu-calculatorThis 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:
Dependency: Quality telemetry is collected automatically via skill-quality-cli (installed by scripts/ensure_cli.sh if absent).
skill-quality-cli — ensured by bash scripts/ensure_cli.sh (idempotent, skips if present)
skill-quality-cli upgrade manually (no auto-upgrade)SKILL_QUALITY_REPORT=0All
hcloudcommands in this skill are wrapped withskill-quality-cli runfor telemetry. No manual action required.
Typical Problem Scenarios:
Typical User Utterances:
MFU = (Achieved FLOPs / Peak FLOPs) × 100%
Where:
| Ascend Model | FP16/BF16 Peak (TFLOPs/s) |
|---|---|
| 910B1 | ≈ 378.88 |
| 910B2 | ≈ 353.89 |
| 910B3 | ≈ 294.91 |
| 910B4 | ≈ 270 |
| 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 |
A rule-based bottleneck diagnoser (scripts/bottleneck_diagnoser.py) that analyzes Ascend profiling CSV data (e.g. OpBasicInfo.csv from msprof) and automatically classifies each operator's bottleneck:
It computes per-operator achieved TFLOPS, memory bandwidth and compute utilization, then returns a ranked report (priority P0/P1/P2) with concrete optimization recommendations.
skill-quality-cli run --skill-name huawei-cloud-ascend-op-mfu-calculator -- python3 scripts/bottleneck_diagnoser.py --csv OpBasicInfo.csv --peak-tflops 294.91 --peak-memory-bw 1200
Column matching is tolerant of the exact msprof header names (e.g.
Task Duration(us),AI Core Time(us),Memory Read Bytes,Memory Write Bytes). If a column is absent, the related signal is skipped and classification falls back to the remaining signals.
The skill is a pure calculation/diagnosis skill (no Huawei Cloud CLI mutation): everything is computed locally with Python 3.8+.
| Command | Purpose |
|---|---|
| MFU calculation | Compute FLOPs, achieved TFLOPs/s and MFU with the formulas in MFU Calculation Methodology; use per-model peak TFLOPs from the table above and confirm the execution-time unit (ms vs us) |
python3 scripts/bottleneck_diagnoser.py --csv <profiling.csv> [--peak-tflops <TFLOPs>] [--peak-memory-bw <GB/s>] | Auto-classify operator bottlenecks from Ascend profiling CSV |
| 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 |
| time_us | Operator execution time (microseconds) — alternative to time_ms | No |
| peak_tflops | Hardware peak computing power (TFLOPS); use the per-model table above | Yes |
| device | NPU device type (910B1/910B2/910B3/910B4/910, etc.) | No |
MFU is sensitive to the execution-time unit — mixing ms and us changes the result by ~1000×. Follow these rules:
time_ms is the canonical input (milliseconds).Task Duration(us)), that value is in microseconds (us) — convert it before calculating:
time_ms = time_us / 1000flops / (time_us × 1e-6) / 1e12 (equivalently flops / (time_ms × 1e-3) / 1e12)time_us as the input parameter and let the calculation convert internally.