NPU上AMP的使用方法
模型从GPU适配到NPU时,需要将代码torch.cuda.amp修改为torch_npu.npu.amp。
当前PyTorch1.8.1 AMP工具中GradScaler增加了dynamic选项(默认为True),设置为False时,AMP能支持静态Loss Scale。
父主题:
AMP使用说明