mirror of
https://github.com/deepspeedai/DeepSpeed.git
synced 2026-03-28 10:47:28 +00:00
Pytorch now provide torch.amp https://docs.pytorch.org/docs/stable/amp.html as recommended AMP API instead of torch.<device_type>.amp which is used in DeepSpeed abstract accelerator amp(). Some PyTorch backend such as XPU does not provide the legacy `torch.xpu.amp` module. This PR replace `get_accelerator().amp()` by `torch.amp` which is the recommended way of using AMP. Related issues and PRs https://github.com/deepspeedai/DeepSpeed/issues/7876 https://github.com/deepspeedai/DeepSpeed/pull/7877 --------- Signed-off-by: Ma, Guokai <guokai.ma@intel.com> Co-authored-by: Olatunji Ruwase <tjruwase@gmail.com>