SetHF32Mode

Supported Products

Product

Supported/Unsupported

Atlas A3 training products/Atlas A3 inference products

Atlas A2 training products/Atlas A2 inference products

Atlas 200I/500 A2 inference products

Atlas inference product's AI Core

x

Atlas inference product's Vector Core

x

Atlas training products

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 to HF32 before participating in the MMAD computation.

Prototype

1
__aicore__ inline void SetHF32Mode(bool hf32Mode)

Parameters

Table 1 Parameters

Parameter

Input/Output

Description

hf32Mode

Input

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

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

Returns

None

Constraints

None

Example

1
2
bool hf32Mode = true;
AscendC::SetHF32Mode(hf32Mode);