-``cast_model_type``:Castsyourmodel's parameters and buffers to the desired type.
- ``patch_torch_functions``: Patch all Torch functions and Tensor methods to perform Tensor Core-friendly ops like GEMMs and convolutions in FP16, and any ops that benefit from FP32 precision in FP32.
- ``keep_batchnorm_fp32``: To enhance precision and enable cudnn batchnorm (which improves performance), it'softenbeneficialtokeepbatchnormsinparticularinFP32eveniftherestofthemodelisFP16.
The unified Amp API supports gradient accumulation across iterations,
multiple backward passes per iteration, multiple models/optimizers,
and custom/user-defined autograd functions. Gradient clipping and GANs also
require special treatment, but this treatment does not need to change
...
...
@@ -82,10 +175,12 @@ Transition guide for old API users
We strongly encourage moving to the new Amp API, because it'smoreversatile,easiertouse,andfutureproof.Theoriginal:class:`FP16_Optimizer`andtheold"Amp"APIaredeprecated,andsubjecttoremovalatatanytime.
**For users of the old "Amp" API**
Forusersoftheold"Amp"API
******************************
In the new API, ``opt-level O1`` performs the same patching of the Torch namespace as the old Amp API.
However, the new API allows choosing static or dynamic loss scaling, while the old API only allowed dynamic loss scaling.