MCP server for Ascend Profiler (msprof) analysis
Wellknown found it in public sources; nobody has proven control of it yet. Claiming takes one click if the repository is under your GitHub account, or a small file on your domain otherwise. Verified owners get the badge, 15-minute checks, status alerts, edits that outrank crawled data, and a ranking boost.
Agents can do it too: POST https://wellknown.network/api/v1/claims with {"agent":"msprof-mcp","method":"well_known_file"} — machine-readable steps at claim.json, guide at /docs/claim.
Everything here was measured by our prober or read from a registry. Nothing is self-reported.
Attributed to the source that supplied each field. Treated as claims, not facts.
# msprof mcp ## 简介 msprof mcp 是一个基于 Model Context Protocol (MCP) 的服务器,旨在为大语言模型 (LLM) 提供分析 Ascend PyTorch Profiler 采集性能数据的能力。通过一系列内置工具,它可以帮助用户快速定位性能瓶颈、分析算子耗时、查看通信开销以及进行 Trace 数据的深度查询。 ## 目录结构 ``` msprof_mcp/ ├── pyproject.toml # 项目配置文件 (build-system, dependencies) ├── src/ │ └── msprof_mcp/ │ ├── __init__.py │ ├── server.py # MCP 服务器入口 │ └── tools/ # 工具包 │ ├── msprof_analyze_cmd.py │ ├── csv_analyze.py │ ├── json_analyze.py │ └── trace_view/ └── README.md ``` ## MCP 能力说明 本服务提供以下核心能力,支持多维度性能数据分析。您可以直接在对话中使用自然语言(如示例 Prompt)来调用这些工具。 ### 1. 总体分析 (msprof-analyze) | 工具名称 | 描述 | 示例 Prompt | | :--- | :--- | :--- | | `msprof_analyze_advisor` | 调用 `msprof-analyze advisor` 提供全方位性能建议(计算/调度瓶颈)。 | "分析 `/path/to/data` 目录下的性能数据,找出主要瓶颈。" | ### 2. TimeLine 分析 (trace_view) | 工具名称 | 描述 | 示例 Prompt | | :--- | :--- | :--- | | `analyze_overlap` | 分析计算、通信与调度的重叠情况,判断负载特征(计算/通信密集型)。 | "分析 `/path/to/trace_view.json` 的计算和通信重叠情况。" | | `find_slices` | 搜索 Trace 中的特定 Slice(算子/函数),支持模糊匹配和时间范围过滤。 | "在 `/path/to/trace_view.json` 中查找所有 'MatMul' 算子。" | | `get_flow_data` | 根据时间范围获取 Flow 关联的 CPU/NPU 算子明细,支持按 `cpu_op` 或 `npu_op` 入口查询;结果过大时可通过 `result_output_path` 导出 CSV。 | "获取 `/path/to/trace_view.json` 中 1000000000 到 2000000000 时间范围内的 NPU 算子关联 Flow 数据,并导出到 `/tmp/flow_data.csv`。" | | `execute_sql_query` | 执行自定义 SQL 查询,支持 Slice/Thread/Process 等表的深度分析。 | "对 `/path/to/trace_view.json` 执行 SQL 查询,统计耗时超过 1ms 的 Slice 数量。" | ### 3. 算子性能分析 (CSV) | 工具名称 | 描述 | 示例 Prompt | | :--- | :--- | :--- | | `analyze_kernel_details` | 分析 `kernel_details.csv`,提供耗时分布、Top N 算子、设备分布等。 | "分析 `/path/to/kernel_details.csv`,列出耗时最长的 10 个算子。" | | `get_operator_details` | 查询特定算子(按名称或类型)的详细执行信息。 | "从 `/path/to/kernel_details.csv` 中获取 'FlashAttention' 算子的详细信息。" | | `analyze_op_statistic` | 分析 `op_statistic.csv`,提供调用次数、总耗时及 Core 类型分布。 | "统计 `/path/to/op_statistic.csv` 中的算子调用次数和总耗时。" | | `get_op_type_details` | 查询特定类型算子或 Core 类…
Mapped onto the structured taxonomy from declared text and observed tool names. Confidence shown for derived entries.
Every source is kept verbatim. Field changes are logged as events.