下载
中文
注册
Ascend PyTorch Profiler采集过程中提示:Incorrect schedule

Ascend PyTorch Profiler采集过程中提示:Incorrect schedule

2025/04/02

47

暂无评分
我要评分

问题信息

问题来源产品大类产品子类关键字
官方MindStudio-Incorrect schedule、性能数据采集、Ascend PyTorch Profiler

问题现象描述

使用Ascend PyTorch Profiler接口采集PyTorch性能数据过程中,打印“Incorrect schedule”提示信息,如下图所示:

图1 Incorrect schedule 放大

profiler.py: Incorrect schedule: Stop profiler while current state is WARMUP which will result in enpty parsed data.

图2 Incorrect schedule 放大

profiler.py: Incorrect schedule: Stop profiler while current state is RECORD which may result in incomplete parsed data.

图3 Incorrect schedule 放大

profiler.py: Stop profiler while current state is RECORD_AND_SAVE, perhaps the scheduling sycle has not yet completed.

原因分析

  • 情况一:

    设置的schedule参数不合理,导致Profiler尚未完成设置的schedule周期就提前退出。如下面的案例所示:

    图4 案例代码 放大

    实际模型训练step为1,但是设置schedule中skip_first=1, active=2,此时Profiler在刚好处于RECORD状态(准备好采集),但是训练进程已经退出,所以导致性能数据缺失或者为空的情况。

  • 情况二:

    设置schedule参数repeat为默认值0,可能导致采集的最后一个step数据不完整,日志提示:profiler.py: Stop profiler while current state is RECORD_AND_SAVE, perhaps the scheduling sycle has not yet completed.和profiler.py: Incorrect schedule: Stop profiler while current state is RECORD which may result in incomplete parsed data.。此时不建议最后一个step数据作为性能数据分析参考。

解决措施

检查设置的schedule是否正确(建议通过此公式判断:step总数 >= skip_first+(wait+warmup+active)*repeat),确保Profiler完成schedule后还有足够的step用于性能数据采集。

本页内容