
# Profiling数据采集
在train.py的main()函数Step迭代处添加配置，添加位置如下图所示：
![](https://support.huaweicloud.com/bestpractice-modelarts/figure/zh-cn_image_0000002126110073.png "点击放大")
此处需要注意的是prof.step()需要加到dataloder迭代循环的内部以保证采集单个Step迭代的Profiling数据。
更多信息，请参见[Ascend PyTorch Profiler接口采集](https://www.hiascend.com/document/detail/zh/canncommercial/80RC3/devaids/devtools/profiling/atlasprofiling_16_0033.html#ZH-CN_TOPIC_0000002081898541__section11606112810711)。
