Ascend NPU profiling collection, analysis, and memory profiling for vLLM serving.
This is a Claude Code / Codex plugin that provides five core capabilities for Ascend NPU profiling workflows:
| Capability | Description | Remote Required |
|---|---|---|
| Profiling Analysis | Analyze collected torch-profiler output, produce traceable reports (md/xlsx/html) | Optional (supports local mode) |
| Profiling Collection | Collect one torch-profiler case end-to-end on a remote NPU | Yes |
| Profiling Sweep | Batch analyze multiple profiling roots on a remote machine | Yes |
| Memory Profile | Collect HBM memory usage data on Ascend NPU | Yes |
| Memory Analyze | Analyze collected memory profiling data locally | No |
Add this plugin to your Claude Code or Codex workspace:
# Claude Code
claude plugin add /path/to/profiling-analysis-plugin
# Or copy into your project's .claude/plugins/ directoryLocal mode (no remote server needed):
/ascend-analyze --local-profile-root /path/to/local/profiling_dataRemote mode (profiling data on a remote NPU machine):
/ascend-analyze --machine <alias> --manifest <manifest-path>
/ascend-analyze --machine <alias> --remote-profile-root /remote/pathKey options:
--local-profile-root <path>— Local profiling directory (skips SSH)--manifest <path>— Collection manifest JSON from a priorascend-collectrun--remote-profile-root <path>— Remote profiling root path--local-output-dir <path>— Output directory--skip-html— Skip HTML rendering (faster)--report-mode summary|full-raw— HTML depth (default: full-raw)--from-stage / --to-stage / --only-stage— Partial pipeline re-runs
/ascend-collect --machine <alias> --model /path/to/model --tp 4 --tag my_runKey options:
--machine <alias>— Remote machine alias--model <path>— Model path on the remote container--tp <N>— Tensor parallelism degree--tag <name>— Run tag--mode enforce_eager— vLLM mode--benchmark-output-tokens <N>— Output token count
/ascend-sweep --machine <alias> --search-root /remote/profiling_dirKey options:
--search-root <path>— Remote directory to scan (repeatable)--limit <N>— Cap number of roots--jobs <N>— Parallel analysis threads--reuse-existing— Skip roots with existing manifests--render-html— Render HTML for each root (off by default)
Standalone mode:
/ascend-mem-profile --machine <alias> --model /path/to/model --tp 4 --tag my_memAttach mode (attach to a running service):
/ascend-mem-profile --machine <alias> --attach --tag my_mem/ascend-mem-analyze <run-dir>Where <run-dir> is the local directory created by /ascend-mem-profile.
You can also use natural language with the agent:
- "分析一下
/path/to/profiling_data这份 profiling 数据" → triggers local analysis - "采集一个 profiling case" → triggers collection
- "显存用了多少" → triggers memory profiling
- "批量分析远端的 profiling 目录" → triggers sweep
When using --local-profile-root, the directory must contain Ascend profiler output:
<local-profile-root>/
kernel_details.csv # Required
trace_view.json # Optional
op_summary/ # Optional
communication.json # Optional
Analysis results are written to .vaws-local/profiling-analysis/runs/<timestamp>_<tag>/ by default:
report/
report.md # Markdown report
report.xlsx # Excel report
report.html # Interactive HTML report
*_manifest.json # Pipeline manifests
diagnosis_findings.json
*.csv # Summary CSVs
- Remote mode: A managed remote Ascend NPU machine (added via machine-management skill), with SSH access and
torch/torch_npuavailable - Local mode: Profiling data already downloaded to the local machine; only Python stdlib +
pandasneeded - Collection: Model weights must exist on the remote container
profiling-analysis-plugin/
.claude-plugin/plugin.json # Plugin metadata
.mcp.json # MCP server config (remote-dev)
agents/ascend-profiler.md # Agent routing rules
commands/ # Slash command definitions
hooks/ # Pre-tool-use guards
skills/ # Skill packages
ascend-profiling-analysis/ # Profiling analysis
ascend-profiling-collection/ # Profiling collection
ascend-memory-profiling/ # Memory profiling
scripts/ # MCP server & remote tools
agents_shared/ # Shared libraries