mindspore v1.1使用体验,根据官网资料对retinaface_resnet50写summary和profiler
一. 运行环境
MindSpore版本号:1.1.0;
硬件平台:GPU;
Python版本号:3.7.5;
操作系统:linux Ubuntu
二. 运行步骤
1.下载最新版本并安装
- 下载https://gitee.com/mindspore/mindspore.git仓库,修改retinaface_resnet50网络,添加写Summary和profiler的逻辑
按照官网资料https://www.mindspore.cn/tutorial/training/zh-CN/r1.1/advanced_use/performance_profiling_gpu.html 教程 “收集Summary数据”、“性能调试(Ascend)”、“性能调试(GPU)”三个章节修改retinaface_resnet50网络脚本
如修改profiler,只需要修改model_zoo/official/cv/retinaface_resnet50/train.py: - from mindspore.profiler import Profiler
- 在context.set_context(mode=context.GRAPH_MODE, device_target='GPU', save_graphs=False)之后初始化profiler
profiler = Profiler(output_path="...") - train方法最后收集profiler数据
train end and collect Profiler data
profiler.analyse()
三. 体验总结
summary和profiler基本功能可用,使用限制较多,如summary对数据类型的支持不完整,不支持dict类型数据的summary收集;profiler多P对profiler init 和NCCL的init()的位置有限制,GPU和Ascend的位置关系限制不一致。
多卡使用场景存在写多个profiler目录/summary文件的问题。
运行用例生成的summary和profiler文件
四. 建议
建议尽量减少限制,如summary proto提供对不同数据类型的支持,程序内部 如profiler init 内部对初始化逻辑进行处理等。