--allow_hf32
Applicability
Product |
Supported |
|---|---|
√ |
|
√ |
|
x |
|
x |
|
x |
Description
This option is reserved and is not supported in the current version.
Enables the function of automatically replacing the float32 data type with the HF32 data type. In the current version, this option takes effect only for Conv and Matmul operators.

See Also
- For the same operator, if enable_hi_float_32_execution or enable_float_32_execution is configured using --op_precision_mode, you are not advised using this option together with --allow_hf32. If they are used together, the priority is as follows:
op_precision_mode(ByNodeName) > allow_hf32 > op_precision_mode(ByOpType)
- --allow_hf32 automatically replaces float32 with HF32. To make this option take effect, ensure that the input or output type of the enabled operator is float32. The default value of --precision_mode_v2 is fp16. If the operator type in the original network model is float32, it will be forcibly converted to float16. In this case, --allow_hf32 does not take effect. You are advised to change the value of --precision_mode_v2 to origin. The default value of --precision_mode is force_fp16, and you are advised to change the value to must_keep_origin_dtype or force_fp32.
Argument
Argument:
- true: Enable the function of automatically converting the FP32 data type to the HF32 data type for Conv and Matmul operators.
For details about the operators for which this function is enabled, see opp/built-in/op_impl/ai_core/tbe/impl_mode/allow_hf32_matmul_t_conv_t.ini in the file storage path after the CANN software is installed. This file cannot be modified by users.
- false: Disable the function of automatically converting the FP32 data type to the HF32 data type for Conv and Matmul operators.
For details about the operators for which this function is disabled, see opp/built-in/op_impl/ai_core/tbe/impl_mode/allow_hf32_matmul_f_conv_f.ini in the file storage path after the CANN software is installed. This file cannot be modified by users.
Default: Enable FP32-to-HF32 conversion for Conv operators; disable FP32-to-HF32 conversion for Matmul operators.
Suggestions and Benefits
None
Example
--allow_hf32=true
If ge.exec.allow_hf32 can be found in the model conversion log, the parameter settings are effective.
Dependencies and Restrictions
None