SuperAPI AI Directory

profiling-analysis-hostbound

Data & analytics

View repository

Updated 10-15 17:19

About this skill

NPU Fast/Slow Card and Host-Side Performance Analysis Skill

Function Overview

This Skill provides two independent analysis functions that can be selected according to user needs:

  1. 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, and identify fast and slow cards with inconsistent performance.
  2. 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 migrations, 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 in detail the performance differences between NPU cards, 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 used by the main analysis Skill /profiling-analysis automatically triggered. When the main Skill detects that NPU inter-card performance differences or Host-side process bottlenecks need to be analyzed, it will automatically call the corresponding sub-skill for in-depth analysis.

2. Used separately

According to specific needs, select and 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 Documentation

2.2 Using Host-Side Trace Analysis

python scripts/trace_analyzer.py --input <trace文件路径> [--output <报告输出路径>]

Detailed description: Please refer to Host-Side Trace Analysis Documentation

Usage Recommendations

Function Selection:

  • When NPU inter-card performance differences need to be analyzed, use theFast/Slow Card Performance Analysissub-skill
  • When Host-side process performance issues need to be analyzed, useHost-Side Trace AnalysisSub-skill
  • To gain a comprehensive understanding of system performance, you can run both analysis sub-skills simultaneously

Analyze optimization paths:

  • If inter-card performance imbalance is found, you can further analyze the Host-side Trace to identify possible process scheduling or resource contention issues
  • If there is a performance bottleneck on the Host side, you can combine 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 the two reports provides more comprehensive system performance insights

Dependency requirements

  • Python 3.8+
  • Dependencies: pandas, openpyxl, matplotlib, sqlite3