服务化性能数据比对工具
概述 (Overview)
工具定位
大模型推理服务化不同版本,不同框架之间可能存在性能差异,服务化性能数据比对工具支持对使用msserviceprofiler工具采集的性能数据进行差异比对,通过比对快速识别可能存在的问题点。
关键特性
-
轻量级
-
可视化报告
- Excel 表格
- Grafana 仪表盘
-
多维度指标
- 服务总体维度
- Request 维度
- Batch 维度
版本配套关系
ms_service_profiler_ext 作为扩展包,依赖 Ascend-cann-toolkit 中的 ms_service_profiler 工具。
| 服务化性能数据比对工具 | CANN | MindIE |
|---|---|---|
| 依赖版本 | ≥ CANN 8.1.RC1 | ≥ MindIE 2.0.RC1 |
Python环境依赖
python>=3.7
pandas>=2.2
numpy>=1.24.3
快速入门 (Quick Start)
目前工具支持pip装包后调用和源码下载,脚本调用两种方式。
pip 安装 msserviceprofiler
pip install -U msserviceprofiler
msserviceprofiler compare input_path golden_path
或通过源码方式使用 msserviceprofiler
git clone https://gitcode.com/Ascend/msit.git
export PYTHONPATH=$PWD/msit/msserviceprofiler/:$PYTHONPATH
cd msit/msserviceprofiler/
python msserviceprofiler/__main__.py compare input_path golden_path
| 参数 | 说明 | 是否必选 |
|---|---|---|
| input_path | 输入数据目录 | 是 |
| golden_path | 标杆数据目录 | 是 |
| --output-path | 比对结果输出目录,默认为当前目录下创建一个compare_result目录 | 否 |
| --log-level | 设置日志级别,默认为info。取值为:debug info warning error fatal critical | 否 |
其中 input_path 与 golden_path 数据需通过解析工具生成,具体参考 ms_service_profiler_ext/analyze.py
输出结果
输出文件说明
比对结果支持 Excel 直接展示和 Grafana 可视化
|- output_path
|- compare_result.xlsx
|- compare_result.db
|- compare_visualization.json
| 结果文件 | 说明 |
|---|---|
| compare_result.xlsx | 展示所有数据 pair 的绝对误差和相对误差。包含有多个标签页,每个标签页以不同维度展示服务化数据 |
| compare_result.db | 比对结果数据库,用于Grafana数据源 |
| compare_visualization.json | 用于创建 Grafana 仪表盘 |
Grafana可视化参考 https://grafana.org.cn/
比对结果说明
比对结果围绕以下几个维度展示:
- 服务总体维度
- Request 维度
- Batch 维度
比对结果示例如下:
| Metric | Data Source | value1 | value2 |
|---|---|---|---|
| Metric1 | input_data | 0.9 | 1.2 |
| Metric1 | golden_data | 1.0 | 1.0 |
| Metric1 | Difference | 0.1|-10% | 0.2|20% |
| Metric2 | input_data | 0.9 | 1.2 |
| Metric2 | golden_data | 1.0 | 1.0 |
| Metric2 | Difference | 0.1|-10% | 0.2|20% |
常见问题 (FAQ)
附录 (Appendix)
版本更新日志 2025.2.21:比对工具上线