aclSysParamOpt

1
2
3
4
5
typedef enum { 
    ACL_OPT_DETERMINISTIC = 0,
    ACL_OPT_ENABLE_DEBUG_KERNEL = 1,
    ACL_OPT_STRONG_CONSISTENCY = 2,
} aclSysParamOpt;
Table 1 Enumeration items

Enumeration Item

Description

ACL_OPT_DETERMINISTIC

Whether to enable deterministic computing.

  • 0: disables deterministic computing. It is the default value.
  • 1: enables deterministic computing.

When deterministic computing is enabled, the same output is generated if an operator is executed for multiple times with the same hardware and input. This often slows down operator execution.

By default, deterministic computing is disabled. The results of multiple executions of an operator with the same hardware and input may be different. This is generally caused by asynchronous multi-thread executions during operator implementation, which changes the accumulation sequence of floating-point numbers.

You are advised not to enable deterministic computing because it slows down operator execution and affects performance. If the execution results of a model are different for multiple times or the precision needs to be optimized, you can enable deterministic computing to assist model debugging and optimization.

ACL_OPT_ENABLE_DEBUG_KERNEL

Whether to enable detection for out-of-bounds global memory access in the operator execution phase.

  • 0: disables detection for out-of-bounds memory access. It is the default value.
  • 1: enables detection for out-of-bounds memory access.

Before compiling an operator, call aclSetCompileopt to set ACL_OP_DEBUG_OPTION to oom and call aclrtCtxSetSysParamOpt (with the scope of context) or aclrtSetSysParamOpt (with the scope of process) to set ACL_OPT_ENABLE_DEBUG_KERNEL to 1 to enable detection for out-of-bounds global memory access. During operator execution, if out-of-bounds access occurs when data is read from or written to the global memory (for example, reading the operator input data or writing the operator output data), the error code "EZ9999" is returned, indicating that the operator has an AI Core error.

ACL_OPT_STRONG_CONSISTENCY

Whether to enable strong consistency for computation.

0: disables strong consistency for computation. It is the default value.

1: enables strong consistency for computation.

If enabled, the computation result is deterministic, meaning that multiple executions will generate the same result. In addition, the computation result is irrelevant to the data location. For example, when performing matrix multiplication, the order of accumulation across different rows may vary, which can lead to slight differences in results for the same data in different rows. However, when strong consistency is enabled, the results will remain consistent across rows as long as the inputs are the same.

By default, strong consistency is not enabled, which may cause inconsistencies in results when the same data appears in different rows.

It is a convention not to enable strong consistency, as doing so slows down operator execution and downgrades performance. Enable this feature when you need strict consistency of results for identical data in different positions, or when you want to apply precision tuning to model debugging and optimization.

Note: This parameter is for trial use and may be changed in later versions. It is not available in commercial products.