model-recommend-analysis

Analyze Ascend NPU profiling data and dump graphs to diagnose recommendation model performance bottlenecks.

Updated Sep 15, 2026
One-click install
npx skills add https://github.com/WangWindow/CANN-BatchMatMulMaxsum --skill model-recommend-analysis-wangwindow
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: model-recommend-analysis
Source: https://github.com/WangWindow/CANN-BatchMatMulMaxsum/tree/main/.agents/skills/model-recommend-analysis
Command: npx skills add https://github.com/WangWindow/CANN-BatchMatMulMaxsum --skill model-recommend-analysis-wangwindow

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Recommendation models running on Ascend NPUs often fail to meet latency or throughput targets, and engineers struggle to interpret MindStudio Profiler output to find bottlenecks. This Skill parses profiling data and optional dump graphs to pinpoint H2D, ModelExecute, and D2H overhead, identify repeated subgraph structures, and produce actionable fusion and scheduling optimization suggestions. ## Core Features & Use Cases - Profiling Analysis: Parses MindStudio Profiler output (op_summary, op_statistic, api_statistic, step_trace, msprof JSON) to compute H2D/ModelExecute/D2H time, iteration counts, dynamic-shape detection, and top time-consuming operators. - Graph Structure Analysis: Analyzes GE Build pbtxt graphs and PyTorch fxgraph output_code files to find top repeated subgraphs and recommend fusion passes or fused operators. - Verified Optimization Suggestions: Generates prioritized recommendations covering AutoFuse, multi-instance parallelism, AICore control, CPU affinity, and multi-stream scheduling, with strict rules requiring all parameters to be verifiable against official Ascend documentation. - Use Case: A customer's recommendation inference service misses its latency SLA on Ascend NPU. Provide the MindStudio Profiler directory and the GE Build pbtxt; the Skill produces a Markdown report identifying that vector operators dominate and AutoFuse is disabled, then suggests enabling it with the correct environment variables. ## Quick Start Analyze the MindStudio Profiler output directory ./profiling_output for my recommendation model and generate a performance bottleneck report with optimization suggestions.

Frequently Asked Questions about model-recommend-analysis

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

FAQPage Schema
How do I analyze Ascend NPU profiling data for a recommendation model?

Run the profiling_parser.py script on the MindStudio Profiler output directory to compute H2D, ModelExecute, and D2H times, iteration counts, and top operators. It auto-discovers op_summary, op_statistic, api_statistic, and step_trace files and outputs a Markdown report.

How to detect repeated subgraphs for operator fusion on Ascend?

Use the graph_analyzer.py script with a GE Build pbtxt file or PyTorch fxgraph output_code.py file. It performs n-gram comparison over operator type sequences to find repeated subgraphs and ranks them by total profiling time or operator count times repetition.

How do I check if my model has dynamic shapes from profiling data?

Check the OP State column in op_summary CSV files for a dynamic value, or inspect msprof JSON for ModelExecute combined with infershape functions or aclnn interface calls. Either signal confirms dynamic shapes are present.

How can I tell if AutoFuse is already enabled on Ascend NPU?

Inspect the OP Type column in op_statistic CSV files for prefixes like autofuse_, autofused_, triton_poi_fused_, triton_per_fused_, or dvm_. Their presence indicates AutoFuse, Triton, or DVM fusion is active; absence means fusion likely needs enabling.

What input files does the profiling analysis require?

The analysis requires a MindStudio Profiler output directory containing files such as op_summary, op_statistic, api_statistic, step_trace CSVs, or msprof JSON. A dump graph file in pbtxt or fxgraph Python format is optional but enables repeated subgraph analysis.

Why are optimization suggestions sometimes given without specific parameters?

The Skill forbids inventing environment variables or parameter values from memory. When a parameter cannot be verified against official Ascend documentation, the suggestion degrades to a directional recommendation pointing to the relevant documentation link instead.