profiling-analyze

Analyzes Ascend NPU profiling data to diagnose bottlenecks and compare kernel-level performance across runs.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? It turns raw Ascend NPU profiling output (kernel_details.csv, trace_view.json, step_trace_time.csv) into actionable bottleneck diagnoses, answering why a model is slow, where time goes, and whether an optimization actually helped. ## Core Features & Use Cases - Five-layer analysis pipeline: warmup validation, DiT/VAE stage separation, operator category breakdown (FA/MatMul/Vector/Comm), host-bound and communication-overlap analysis, and P0-P2 prioritized optimization directions via analyze_trace.py. - Baseline vs optimized comparison: compare_traces.py diffs two profiling runs at kernel level, flagging REGRESSION or improvement with an automatic PASS/WARN/FAIL verdict. - Fusion candidate identification: detects fusion opportunity candidates from kernel execution sequences and hands them to fusion-scope-analyze for boundary and benefit judgment. - Use Case: After collecting profiling data from a remote NPU, run the pipeline to learn that DiT MatMul exceeds 50% of step time, then receive a P1 recommendation pointing to MatMul quantization documentation. ## Quick Start Ask the assistant to analyze the profiling output directory with analyze_trace.py and explain where the inference bottleneck is and which optimization direction to try first.

Frequently Asked Questions about profiling-analyze

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

FAQPage Schema
How do I analyze Ascend NPU profiling data to find inference bottlenecks?▼

Run analyze_trace.py with --profile-dir pointing to the parent of ASCEND_PROFILER_OUTPUT and --output-dir for reports. It executes a five-layer pipeline covering warmup validation, DiT/VAE stage separation, operator category percentages, host-bound and communication analysis, and prioritized recommendations.

How to compare two profiling runs before and after optimization?▼

Use compare_traces.py with --baseline and --target pointing to each run's kernel_details.csv. It aggregates kernels by name, lists new and removed operators, marks regressions or improvements, and emits an automatic PASS, WARN, or FAIL verdict.

What profiling data formats does this analysis support?▼

It primarily consumes CANN profiler output: kernel_details.csv, trace_view.json, step_trace_time.csv, and optionally communication.json. As a fallback it also parses Chrome Trace JSON files produced by torch_npu tensorboard_trace_handler.

Why does the first profiling step show abnormally high latency?▼

That usually means warmup steps were not excluded before profiling started. The analysis flags this as WARMUP_NOT_STRIPPED and recommends recollecting with at least five warmup steps, or ten or more when compilation is involved.

Does this skill decide fusion boundaries and expected benefits?▼

No. It only identifies fusion opportunity candidates with region coordinates and similarity grades, then hands them to the fusion-scope-analyze skill, which judges whether candidates can fuse, how large the unit should be, and whether it is worthwhile.

What Python dependencies are required to run the analysis scripts?▼

None beyond the Python 3.10+ standard library. Both analyze_trace.py and compare_traces.py use only built-in modules such as csv, json, and argparse, so no pip installation is needed.