aclCompileOpt
typedef enum {
ACL_PRECISION_MODE, // 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 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 a compiled operator binary file.
ACL_OP_DETERMINISTIC, //Determines whether to enable deterministic computing.
ACL_CUSTOMIZE_DTYPES, //Customizes the computation precision of one or more operators during model building.
ACL_OP_PRECISION_MODE, //Precision mode for internal operator processing. One or more operators can be specified.
ACL_ALLOW_HF32 //hf32 is a precision type of Ascend for the internal computation of operators. It is not supported in the current version.
ACL_PRECISION_MODE_V2, // Operator precision mode of a network model. Compared with ACL_PRECISION_MODE, ACL_PRECISION_MODE_V2 is added in the new version. There are more precision modes, and the semantics of the original precision mode options are clearer, facilitating understanding.
ACL_OP_DEBUG_OPTION // Currently, this parameter can only be set to oom, indicating that global memory out-of-bounds access detection is enabled.
} aclCompileOpt;
|
Build 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 in the current version is invalid. |
|
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 operator type list (multiple operators are separated by commas). This option is used in pair with ACL_OP_SELECT_IMPL_MODE. |
|
ACL_OP_DEBUG_LEVEL |
Enables 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 can contain letters, digits, underscores (_), hyphens (-), and periods (.).
NOTE:
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 build result of debugging. When you enable the operator build 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 building) or environment variables.
Caution: 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 are 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 path can contain only 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.
NOTE:
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. Defaults to normal. Selected from:
|
|
ACL_OP_JIT_COMPILE |
Determines whether to compile an operator online or use the binary file of a compiled operator.
For the For the |
|
ACL_OP_DETERMINISTIC |
Enables or disables 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 model accuracy needs to be tuned, you can enable deterministic computing to assist model debugging and tuning. |
|
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 calculation precision of one or more operators during model compilation. Configuration constraints:
|
|
ACL_OP_PRECISION_MODE |
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 |
Not supported in the current version. 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 Ascend 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 FP16 (10 bits). Replacing the original FP32 single-precision data type with the HF32 single-precision data type by precision reduction can greatly reduce the space occupied by data and achieve performance improvement.
NOTE:
|
|
ACL_PRECISION_MODE_V2 |
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, facilitating understanding.
|
|
ACL_OP_DEBUG_OPTION |
Currently, this parameter 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 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 or written (such as reading an operator to input data and writing an operator to output data) from the global memory, AscendCL returns the error code "EZ9999", indicating that an AI Core error occurs. |
