Function Overview
This Skill provides two independent analysis functions that can be selected according to user needs:
- Fast/Slow Card Performance Analysis: By parsing the analysis.db database file collected by MindStudio Insight, analyze the execution time and communication time of each NPU card to identify fast and slow cards with inconsistent performance.
- Host-Side Trace Analysis: By parsing system trace files, analyze Host-side process performance and identify problematic processes/threads and main bottlenecks.
The two functions run independently and do not call each other. Users can use the two analysis functions separately or simultaneously as needed.
Core Functions:
- Multi-dimensional fast/slow card identification (computation time + communication time)
- Host-side process performance analysis (context switches, CPU migration, interrupts, etc.)
- Detailed Excel report generation
- Problematic process/thread and bottleneck localization
Supported Data Formats
- Profiling data collected by MindStudio Insight (analysis.db database file)
- System trace files (such as trace files generated by Linux ftrace)
- Supports performance analysis of Ascend NPU systems
Sub-skill Description
This Skill contains two sub-skills, which users can select according to specific needs:
1. Fast/Slow Card Performance Analysis
Analyze the performance differences between NPU cards in detail, and identify fast and slow cards with abnormal computation or communication.
Main Functions:
- Multi-dimensional fast/slow card identification based on computation time and communication time
- Calculation of performance difference percentage between cards
- Detailed Excel report generation
Detailed Documentation: Fast/Slow Card Performance Analysis
2. Host-Side Trace Analysis
Analyze system trace files to identify Host-side process performance issues.
Main Functions:
- Process runtime statistics
- Context switch count detection
- CPU migration count analysis
- Interrupt time statistics
- Problematic process/thread identification
Detailed Documentation: Host-Side Trace Analysis
Usage
1. Automatically called by the main analysis Skill
This Skill is usually automatically triggered by the main analysis Skill /profiling-analysis-profiling-main . When the main Skill detects that it needs to analyze performance differences between NPU cards or Host-side process bottlenecks, it will automatically call the corresponding sub-skill for in-depth analysis.
2. Standalone Use
According to specific needs, choose to use the corresponding sub-skill:
2.1 Using Fast/Slow Card Performance Analysis
python scripts/analyze_hostbound.py --db-path <analysis.db路径> [--output <报告输出路径>] [--speed-threshold <阈值>]
Detailed Description: Please refer to Fast/Slow Card Performance Analysis Document
2.2 Using Host-Side Trace Analysis
python scripts/trace_analyzer.py --input <trace文件路径> [--output <报告输出路径>]
Detailed Description: Please refer to Host-Side Trace Analysis Document
Usage Recommendations
Function Selection:
- When it is necessary to analyze performance differences between NPU cards, use theFast/Slow Card Performance Analysissub-skill
- When it is necessary to analyze Host-side process performance issues, useHost-Side Trace AnalysisSub-skill
- To fully understand system performance, you can run both analysis sub-skills simultaneously.
Analyze optimization path:
- If inter-card performance imbalance is detected, further analysis of the Host-side Trace can be performed to identify possible process scheduling or resource contention issues.
- If there is a performance bottleneck on the Host side, combine it with fast-slow card analysis to confirm whether it affects the overall performance of the NPU cards.
Report interpretation:
- The fast-slow card analysis report focuses on inter-card performance differences.
- The Host-side Trace analysis report focuses on process behavior and resource contention.
- Combining both reports provides more comprehensive system performance insights.
Dependency requirements
- Python 3.8+
- Dependencies: pandas, openpyxl, matplotlib, sqlite3