SetHF32Mode

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

Atlas inference product AI Core

x

Atlas inference product Vector Core

x

Atlas training product

x

Function Usage

Sets whether to enable the HF32 mode for the Mmad computation. After this mode is enabled, FP32 data in L0A/L0B is rounded off to HF32 before participating in the Mmad computation.

Prototype

1
__aicore__ inline void SetHF32Mode(HF32Mode mode)

Parameters

Table 1 Parameters

Parameter

Input/Output

Description

mode

Input

Input parameter for controlling the Mmad HF32 mode. The value is of the HF32Mode type. The options are as follows:

  • ENABLE: The FP32 data in L0A/L0B is rounded off to HF32 before matrix multiplication.
  • DISABLE: The regular FP32 matrix multiplication is performed.

Returns

None

Restrictions

None

Examples

1
AscendC::SetHF32Mode(HF32Mode::ENABLE); // Control whether to use the HF32 mode for the mmad computation.