msProbe工具安装指南
1. 安装说明
使用本工具前需要安装CANN,具体操作请参见《CANN 快速安装》安装昇腾NPU驱动和CANN软件(包含Toolkit和ops包),并配置环境变量。
2. 安装方式
2.1 在线安装
pip install mindstudio-probe
打印如下信息时,表示msProbe安装成功。
Successfully installed mindstudio-probe-{version}
2.2 离线安装
请参见msProbe Release下载msProbe的whl软件包和对应数字签名文件(.sha256)。
下载本软件即表示您同意《华为企业业务最终用户许可协议(EULA)》的条款和条件。
验证whl包的完整性。
在whl包所在目录执行如下命令获取whl软件包的sha256校验码。
sha256sum {name}.whl
打印如下示例信息。
{sha256} {name}.whl用记事本打开数字签名文件查看sha256校验码。
比对两个文件的sha256校验码是否一致。
若两个校验码一致,则表示下载了正确的软件包;若不一致,请不要使用该软件包,需要支持与服务请在论坛求助或提交技术工单。
安装whl包。
pip install ./mindstudio_probe-{version}-py3-none-any.whl
打印如下信息时,表示msProbe安装成功。
Successfully installed mindstudio-probe-{version}若覆盖安装,请在命令行末尾添加
--force-reinstall参数。以上提供的whl包链接不包含adump、aclgraph_dump、atb_probe和nan_check等功能,如果需要使用这些功能,请参见源码安装下载源码编译whl包。
2.3 源码安装
功能说明
通过setup.py脚本编译msProbe工具的whl软件包。
命令格式
# 方式1:使用默认版本编译
python3 setup.py bdist_wheel [--include-mod=<include_mode>] [--no-check]
# 方式2:指定自定义版本编译(前置设置环境变量WHL_VERSION)
WHL_VERSION=自定义版本号 python3 setup.py bdist_wheel [--include-mod=<include_mode>] [--no-check]
参数说明
参数 |
可选/必选 |
说明 |
|---|---|---|
–include-mod |
可选 |
指定可选模块,可取值: |
–no-check |
可选 |
跳过证书校验。–include-mod指定可选模块后,会下载所依赖的第三方库包,下载过程会进行证书校验,配置本参数可以跳过证书校验。 |
使用示例
安装基础工具包
git clone https://gitcode.com/Ascend/msprobe.git cd msprobe pip install setuptools wheel python3 setup.py bdist_wheel cd ./dist pip install ./mindstudio_probe*.whl
安装基础工具包(指定自定义版本)
git clone https://gitcode.com/Ascend/msprobe.git cd msprobe pip install setuptools wheel # 设置环境变量WHL_VERSION=2.1.0,自定义包版本为2.1.0 WHL_VERSION=2.1.0 python3 setup.py bdist_wheel cd ./dist pip install ./mindstudio_probe-2.1.0*.whl
安装基础工具包和adump模块
git clone https://gitcode.com/Ascend/msprobe.git cd msprobe pip install setuptools wheel python3 setup.py bdist_wheel --include-mod=adump --no-check cd ./dist pip install ./mindstudio_probe*.whl
安装基础工具包和aclgraph_dump模块
git clone https://gitcode.com/Ascend/msprobe.git cd msprobe pip install setuptools wheel python3 setup.py bdist_wheel --include-mod=aclgraph_dump --no-check cd ./dist pip install ./mindstudio_probe*.whl
安装基础工具包和分级可视化插件
git clone https://gitcode.com/Ascend/msprobe.git cd msprobe pip install setuptools wheel python3 setup.py bdist_wheel --include-mod=tb_graph_ascend --no-check cd ./dist pip install ./mindstudio_probe*.whl
安装基础工具包和趋势可视化插件
git clone https://gitcode.com/Ascend/msprobe.git cd msprobe pip install setuptools wheel python3 setup.py bdist_wheel --include-mod=trend_analyzer --no-check cd ./dist pip install ./mindstudio_probe*.whl
安装基础工具包和分级可视化、趋势可视化插件
git clone https://gitcode.com/Ascend/msprobe.git cd msprobe pip install setuptools wheel python3 setup.py bdist_wheel --include-mod=tb_graph_ascend,trend_analyzer --no-check cd ./dist pip install ./mindstudio_probe*.whl
安装基础工具包和atb_probe模块
git clone https://gitcode.com/Ascend/msprobe.git cd msprobe pip install setuptools wheel python3 setup.py bdist_wheel --include-mod=atb_probe --no-check cd ./dist pip install ./mindstudio_probe*.whl
安装基础工具包和nan_check模块
git clone https://gitcode.com/Ascend/msprobe.git cd msprobe pip install setuptools wheel python3 setup.py bdist_wheel --include-mod=nan_check --no-check cd ./dist pip install ./mindstudio_probe*.whl
安装基础工具包和xor_checksum加速算子
git clone https://gitcode.com/Ascend/msprobe.git cd msprobe pip install setuptools wheel python3 setup.py bdist_wheel --include-mod=xor_checksum cd ./dist pip install ./mindstudio_probe*.whl
输出说明
打印如下信息时,表示msProbe安装成功。
Successfully installed mindstudio-probe-{version}
3. 卸载
执行如下命令卸载msProbe工具。
pip uninstall mindstudio-probe
打印如下信息时,表示msProbe卸载成功。
Successfully uninstalled mindstudio-probe-{version}
4. 升级
5. 附录
5.1 工具限制与注意事项
工具读写的所有路径,如
config_path、dump_path等,只允许包含大小写字母、数字、下划线、斜杠、点和短横线。出于安全性及权限最小化角度考虑,本工具不应使用root等高权限账户,建议使用普通用户权限安装执行。
使用本工具前请确保执行用户的umask值大于等于0027,否则可能会导致工具生成的精度数据文件和目录权限过大。
用户须自行遵循最小权限原则,如给工具输入的文件要求other用户不可写,在一些对安全要求更严格的功能场景下还需确保输入的文件group用户不可写。
msProbe建议执行用户与安装用户保持一致,如果使用root执行,请自行关注root高权限触及的安全风险。
5.2 查看msProbe工具信息
pip show mindstudio-probe
示例如下:
Name: mindstudio-probe
Version: 26.0.x
Summary: Ascend MindStudio Probe Utils
Home-page: https://gitcode.com/Ascend/MindStudio-Probe
Author: Ascend Team
Author-email: pmail_mindstudio@xx.com
License: Mulan PSL v2
Location: /home/xxx/miniconda3/envs/xxx/lib/python3.x/site-packages/
Requires: einops, matplotlib, numpy, onnx, onnxruntime, openpyxl, pandas, protobuf, pyyaml, rich, setuptools, skl2onnx, tensorboard, tqdm, wheel
Required-by:
5.3 Ascend生态链接
5.3.1 安装PyTorch_NPU
5.3.2 安装MindSpeed LLM
请参见MindSpeed LLM。