代码链接:https://github.com/mmunhappy/ICASSP2025-PDM
代码迁移
vim train_pdm_os.py
报错1

- 确认数据类型

- 打印结果
x.clone().type:torch.float32 x.clone().shape:torch.Size([32, 3, 384, 192]) - 导出plog日志
export ASCEND_WORK_PATH=/path export ASCEND_GLOBAL_LOG_LEVEL=1 export ASCEND_HOST_LOG_FILE_NUM=1000 
原因
- 当aclnnMatmul参数cubeMathType为0时,输入数据类型不支持FLOAT32
- torch.fft.fft2调用aclnnMatmu时,cubeMathType写死为0
解决方案
torch.fft.fft2除GPU外只能使用fp32 
torch.fft.fft2使用cpu计算

cubeMathType固定为0原因

报错2
op type TransData is not found in this op store. 
分析定位

dump组图 export DUMP_GE_GRAPH=2 export DUMP_GRAPH_LEVEL=2 export ASCEND_GLOBAL_LOG_LEVEL=0 export ASCEND_SLOG_PRINT_TO_STDOUT=1

解决方案
模型、数据转fp16



- torch.fft.fft2使用fp32

需求
- 插入cast

- 数据类型转换
- uint16转int32
启动训练

代码链接:https://github.com/mmunhappy/ICASSP2025-PDM
代码迁移
vim train_pdm_os.py报错1
分析定位
x.clone().type:torch.float32 x.clone().shape:torch.Size([32, 3, 384, 192])export ASCEND_WORK_PATH=/pathexport ASCEND_GLOBAL_LOG_LEVEL=1export ASCEND_HOST_LOG_FILE_NUM=1000原因
解决方案
torch.fft.fft2除GPU外只能使用fp32
torch.fft.fft2使用cpu计算
cubeMathType固定为0原因
报错2
op type TransData is not found in this op store.
分析定位
dump组图
export DUMP_GE_GRAPH=2export DUMP_GRAPH_LEVEL=2export ASCEND_GLOBAL_LOG_LEVEL=0export ASCEND_SLOG_PRINT_TO_STDOUT=1原因
解决方案
模型、数据转fp16
需求
启动训练