开启混合精度后,Reduce类算子性能变差,block dim变小,性能降低。
在AMP初始化之前添加代码:
amp.register_float_function(torch,'relu') #relu为算子名称,请根据实际情况替换