Mixed Precision Training on NPU

Objective

The model is successfully ported to the NPU before accuracy tuning. Distributed training (if involved) is enabled.

Especially, mixed precision training is enabled during model porting.

Procedure

For a better trade-off between performance and accuracy, you can enable mixed precision training on the NPU by using either of the following methods: Note: Enable only one of the following methods to avoid unexpected problems invited by frequent graph modification.

  1. If you implement manual mixed precision training on the GPU for your benchmark model script, all operator data types are defined in the model. Do it the same way when you implement mixed precision training on the NPU and ensure that the precision configuration for the NPU is as follows:

    For Atlas Training Series Product , use the precision_mode parameter. The value is allow_fp32_to_fp16.

  2. If you implement automatic mixed precision training on the GPU for your benchmark model script, define operator data types using TensorFlow or other third-party APIs (such as apex APIs). Do it the same way when you implement mixed precision training on the NPU and ensure that the precision configuration for the NPU is as follows:

    For Atlas Training Series Product , use the precision_mode parameter. The value is allow_fp32_to_fp16.

For details about the default values and restrictions of precision_mode and precision_mode_v2, see Precision Tuning.