aclCompileOpt
typedef enum {
ACL_PRECISION_MODE, // Sets the operator precision mode of a network model.
ACL_AICORE_NUM, // Sets the number of AI Cores used for model compilation.
ACL_AUTO_TUNE_MODE, // Sets the operator auto tuning mode.
ACL_OP_SELECT_IMPL_MODE, // Sets the operator implementation mode.
ACL_OPTYPELIST_FOR_IMPLMODE, // Lists operator types. Operators in the list are implemented in the mode specified by ACL_OP_SELECT_IMPL_MODE.
ACL_OP_DEBUG_LEVEL, // Enables or disables TBE operator debug during operator compilation.
ACL_DEBUG_DIR, // Sets the debug directory, for saving the files generated during model conversion and network migration, including the .o, .json, and .cce files of operators.
ACL_OP_COMPILER_CACHE_MODE, // Sets the disk cache mode for operator compilation.
ACL_OP_COMPILER_CACHE_DIR, // Sets the disk cache directory for operator compilation.
ACL_OP_PERFORMANCE_MODE, // Determines whether to compile operators in high-performance mode.
ACL_OP_JIT_COMPILE, // Determines whether to compile an operator online or use the binary file of a compiled operator.
ACL_OP_DETERMINISTIC, // Determines whether to enable deterministic computing.
ACL_CUSTOMIZE_DTYPES, // Customizes the computation precision of one or more operators during model compilation.
ACL_OP_PRECISION_MODE, // Sets the precision mode for internal operator processing. One or more operators can be specified.
ACL_ALLOW_HF32, // HF32 is a precision type of the Ascend AI Processor for the internal computation of operators. It is not supported in the current version.
ACL_PRECISION_MODE_V2, // Sets the operator precision mode of a network model. Compared with ACL_PRECISION_MODE, ACL_PRECISION_MODE_V2 is added in the new version, offering more precision modes and clearer semantics for the existing precision mode options.
ACL_OP_DEBUG_OPTION // Currently, this option can only be set to oom, indicating that global memory out-of-bounds access detection is enabled.
} aclCompileOpt;
|
Compilation Option |
Description |
|---|---|
|
ACL_PRECISION_MODE |
Sets the operator precision mode of a network model. If it is not specified, allow_fp32_to_fp16 is used by default.
|
|
ACL_AICORE_NUM |
Sets the number of AI Cores used for model compilation. The setting is invalid in the current version. |
|
ACL_AUTO_TUNE_MODE |
Do not set this parameter because it will be deprecated. Otherwise, compatibility issues may occur in later versions. If tuning is involved, see AOE Instructions. Sets the operator auto tuning mode.
|
|
ACL_OP_SELECT_IMPL_MODE |
Sets the operator implementation mode. If it is not specified, high_precision is used by default.
|
|
ACL_OPTYPELIST_FOR_IMPLMODE |
Sets the list of operator types (multiple operators are separated by commas). This option is used together with ACL_OP_SELECT_IMPL_MODE to specify whether the operators in the list use the high-precision or high-performance implementation mode. |
|
ACL_OP_DEBUG_LEVEL |
Enables or disables TBE operator debug during operator compilation. The options are as follows:
The configuration constraints are as follows:
|
|
ACL_DEBUG_DIR |
Sets the path (defaults to Current path of the executed application/kernel_meta) for storing debugging information files generated after operator compilation during model conversion and network migration, including the .o, .json, and .cce files. The generated files depend on the value of ACL_OP_DEBUG_LEVEL. The directory name can contain letters, digits, underscores (_), hyphens (-), and periods (.). In addition to setting enumerated values, you can also configure the cache directory for operator compilation files by setting the environment variable ASCEND_WORK_PATH. The priorities of these methods are as follows: Setting enumerated values > Setting environment variables > Default directory. For details about how to set environment variables, see Environment Variables. |
|
ACL_OP_COMPILER_CACHE_MODE |
Sets the disk cache mode for operator compilation. This option must be used in conjunction with ACL_OP_COMPILER_CACHE_DIR.
If debugging is also enabled (ACL_OP_DEBUG_LEVEL is set to a non-zero value), the system ignores the configuration of ACL_OP_COMPILER_CACHE_MODE and does not cache the compilation result in the debugging scenario. When you enable the operator compilation cache function, you can set the disk space of the cache folder with the configuration file (the op_cache.ini configuration file is automatically generated in the path specified by ACL_OP_COMPILER_CACHE_DIR during operator compilation) or environment variables.
If both the op_cache.ini file and environment variable are configured, the configuration items in the op_cache.ini file are read first. If neither the op_cache.ini file nor the environment variable is configured, the system default values are read: 500 MB disk space and 50% reserved cache space. |
|
ACL_OP_COMPILER_CACHE_DIR |
Sets the cache directory of operator compilation files. The default directory is $HOME/atc_data. This option must be used in conjunction with ACL_OP_COMPILER_CACHE_MODE. The directory name can contain letters, digits, underscores (_), hyphens (-), and periods (.). If the ACL_OP_DEBUG_LEVEL option is set, the compilation cache function is enabled only when this option is set to 0. In addition to setting enumerated values, you can also configure the cache directory for operator compilation files by setting the environment variable ASCEND_CACHE_PATH. The priorities of these methods are as follows: Setting enumerated values > Setting environment variables > Default directory. For details about how to set environment variables, see Environment Variables. |
|
ACL_OP_PERFORMANCE_MODE |
Do not set this parameter because it has been deprecated. Otherwise, compatibility issues may occur in later versions. Sets the performance mode (high-performance) for operator compilation. The default value is normal. The options are as follows:
|
|
ACL_OP_JIT_COMPILE |
Determines whether to compile an operator online or use the binary file of a compiled operator.
For the For the For the For the For the |
|
ACL_OP_DETERMINISTIC |
Whether to enable deterministic computing.
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_CUSTOMIZE_DTYPES |
Sets the path (including the file name) of the *.cfg configuration file, which lists the names or types of operators whose calculation precisions need to be specified. Each operator occupies a line. With this configuration, you can customize the computation precision of one or more operators during model compilation. Configuration constraints:
|
|
ACL_OP_PRECISION_MODE |
Sets the path and file name of the configuration file (.ini format) for setting the operator precision mode. The path and file name can contain letters, digits, underscores (_), hyphens (-), and periods (.).
|
|
ACL_ALLOW_HF32 |
The current version does not support this option. Indicates whether to allow the HF32 type to replace the FP32 type during internal computation of operators. true indicates allowed, and false indicates not allowed. In the current version, this configuration takes effect only for Conv and Matmul operators. FP32-to-HF32 conversion is enabled for Conv operators and disabled for Matmul operators by default. HF32 is a single-precision floating-point type of the Ascend AI Processor for internal computation of operators. The following figure shows the comparison of HF32 with other common data types. HF32 shares the same value range with FP32, but its mantissa precision (11 bits) is close to that of FP16 (10 bits). Replacing the original FP32 single-precision data type with the HF32 single-precision data type by reducing precision can greatly reduce the space occupied by data and improve performance.
|
|
ACL_PRECISION_MODE_V2 |
Sets the operator precision mode of a network model. If this compilation option is not configured, fp16 is used by default. Compared with the ACL_PRECISION_MODE option, the ACL_PRECISION_MODE_V2 option is added in the new version, and semantics of the precision mode options are clearer, making them easier to understand.
|
|
ACL_OP_DEBUG_OPTION |
Currently, this option can only be set to oom, indicating that detection for out-of-bounds global memory access is enabled during operator compilation. Before compiling an operator, call aclSetCompileopt to set ACL_OP_DEBUG_OPTION to oom, and call aclrtCtxSetSysParamOptaclrtCtxSetSysParamOpt (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. |
