PROF_CONFIG_PATH
功能描述
PyTorch训练场景Ascend PyTorch Profiler接口的dynamic_profile采集功能profiler_config.json配置文件路径环境变量。
配置示例
export PROF_CONFIG_PATH="profiler_config_path"
配置该环境变量后启动训练,dynamic_profile会在profiler_config_path下自动创建模板文件profiler_config.json,用户可基于模板文件自定义修改配置项。
dynamic_profile采集功能及profiler_config.json文件的详细介绍请参见《CANN 性能调优工具用户指南》中的“dynamic_profile动态采集”章节。
使用约束
- 脚本不手动添加代码的情况,此环境变量适用于PyTorch训练场景。
- 脚本内添加dynamic_profile模块后,此环境变量可以在非训练场景使用。例如:
1 2 3 4 5 6 7 8 9
# 加载dynamic_profile模块 from torch_npu.profiler import dynamic_profile as dp # 设置Profiling配置文件的路径 dp.init("profiler_config_path") … for step in steps: train_one_step() # 划分step dp.step()
支持的型号
Atlas 训练系列产品 Atlas A2 训练系列产品 Atlas A3 训练系列产品
父主题: 性能优化