benchmark-dev

Benchmarks and extends the mindie_bench performance toolchain for MindIE-SD core operators.

14|5|Updated Mar 30, 2026
One-click install
npx skills add https://github.com/Ascend/MindIE-SD --skill benchmark-dev-ascend
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: benchmark-dev
Source: https://github.com/Ascend/MindIE-SD/tree/main/.agents/skills/benchmark-dev
Command: npx skills add https://github.com/Ascend/MindIE-SD --skill benchmark-dev-ascend

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? It provides a single methodology for developing and using the mindie_bench benchmark toolchain to measure and compare FA/BSA/GMM/MM operator implementations on NPU, so model tuning decisions (dtype, quantization, sparsity, head shapes) are based on real measured MFU/latency data instead of guesswork. ## Core Features & Use Cases - Operator implementation selection: Run mindie_bench with --op and --config to compare real kernel dispatch across dtype/quant_algo (e.g., bf16 vs mxfp4 FA), sparsity levels, and head configurations, then merge runs into a single HTML report for MFU/latency comparison. - Toolchain development: Extend the benchmark with new operators via a five-step flow (op_defs accounting, NPU vendor kernel, schema tables, CLI registration, unit tests) following test-first development and single-source metrics conventions. - Data anomaly troubleshooting: Diagnose constant latency, all-zero outputs, MFU clamping, and incremental merge pitfalls using the operator-UT-first triage method and data validity guards. - Use Case: During model optimization (S1/S4 selection), compare bf16 vs mxfp4 FA implementations at the same seqlen with a shared peak_flops input, producing operator-level evidence for quantization and sparsity decisions. ## Quick Start Use the benchmark-dev skill to compare FA implementations across bf16 and mxfp4 dtypes at seqlen 8192 with mindie_bench and merge the runs into one HTML report.

Frequently Asked Questions about benchmark-dev

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I compare FA operator implementations with mindie_bench?

Run mindie_bench with --config {dtype: [bf16, mxfp4]} to trigger real kernel dispatch per dtype, keeping seqlen and peak_flops identical across runs. Place runs under one report parent directory and use the report command to merge them into a single HTML comparing MFU and latency.

How do I add a new operator to the mindie_bench benchmark?

Follow the five-step extension: create op_defs/{op}.py with FLOPs/byte accounting, register the NPU vendor kernel, update the four schema tables in common/schema.py, add the op to VALID_OPS and OP_DEFAULTS in mindie_bench.py, and unit test the accounting pure functions.

Why is my benchmark latency constant across all sequence lengths?

Constant latency usually means the kernel never executed or fixed overhead pollutes the timed region. First run the operator's own unit test to triage, then check vendor call parameters like inner_precise and mask layout against the UT, and verify outputs are non-zero.

Can I configure per-case timeout without adding new CLI arguments?

Yes, add timeout as a --config key in CONFIG_ALLOWED_KEYS rather than a new CLI flag. The backend reads it per case from args_dict with a 5-second default, so long sequences use --config {timeout: 300}.

Why does MFU stay clamped at 1.0 in benchmark reports?

MFU clamping at 1 signals a calibration problem: fake latency, accounting FLOPs mismatched with actual kernel execution, or an inaccurate peak_flops value. Peak values must be measured on the actual device and passed via --config, never hardcoded.

When should I use benchmark-dev versus feature-level optimization selection?

Use this skill for implementation-level measurement of a single operator across dtypes, shapes, and sparsity. Feature-level scheme selection based on docs/zh/features belongs to dit-perf-opt; benchmark results feed back as evidence for its implementation and re-verification steps.