AUTOFUSE_DFX_FLAGS Environment Variable and Its Control Points

--codegen_compile_debug

Controls whether to retain the intermediate files generated during fused operator generation.

Value:

  • true: retains the files.
  • false (default): does not retain the files.

Configuration example:

--codegen_compile_debug=true

If this option is set to true and the files are retained, the kernel_meta_* folder is generated in the script execution directory. This folder contains the generated kernel source code, tiling source code, CMake project, and compilation result. In addition, the AscGraph dump graphs in each schedule process of the fusion operator are generated in the {debug_dir}/autofuse_compile_debug/ directory.

Restrictions: none

--debug_dir

Specifies the path for storing the AscGraph dump graph during fusion. The path can contain uppercase letters, lowercase letters, digits, underscores (_), hyphens (-), and periods (.). The user must have read, write, and execute permissions on the path. If this option is not specified, the file is saved to the current directory where the script is executed.

Configuration example:

--codegen_compile_debug=true;--debug_dir=/path/to/dump

Restrictions: You need to set --codegen_compile_debug to true first to enable the automatic fusion debug function.

--autofuse_att_algorithm

Controls the auto tiling algorithm.

Value:

  • HighPerf: The high-performance algorithm is selected.
  • AxesReorder: (default) The axis sorting algorithm is selected.

Configuration example:

--autofuse_att_algorithm=HighPerf

Restrictions:

  • The axis sorting algorithm is the default algorithm. As an experimental approach, the high-performance algorithm does not guarantee superior execution performance consistently, despite its higher theoretical upper limit.
  • If an invalid value is configured, the default value is used.

--att_accuracy_level

Controls the accuracy of the auto tiling algorithm. Theoretically, the higher the accuracy, the better the kernel performance.

Value:

  • 1 (default): high-accuracy solution
  • 0: low-accuracy solution

By default, the low-accuracy solution is used to ensure that the tiling time is not extended.

Configuration example:

--att_accuracy_level=1

Restrictions:

  1. A high-accuracy solution may result in a better tiling result, but requires a longer tiling execution time. It is reverse for a low-precision solution.
  2. If an invalid value is configured, the default value is used.

--att_enable_multicore_ub_tradeoff

Controls whether to enable the att_corenum_threshold and att_ub_threshold functions.

Value:

  • true: enables the functions.
  • false (default): disables the functions.

Configuration example:

--att_enable_multicore_ub_tradeoff=true

Restrictions: If an invalid value is configured, the default value is used.

--att_ub_threshold

Controls the tiling strategies for Auto Tiling to ensure that the tiling solution result is combined with the operator implementation. The UB usage is not lower than the value of this control point. If the UB usage does not meet the specified threshold, the maximum UB usage that can be solved is used. This control point helps locate performance-related problems.

Value: an integer ranging from 0 to 100. The default value is 20.

Configuration example:

--att_ub_threshold=20

Restrictions:

  1. This option must be used together with --att_enable_multicore_ub_tradeoff. The --att_ub_threshold control point takes effect only when --att_enable_multicore_ub_tradeoff is enabled.
  2. If an invalid value is configured, the default value is used.

--att_corenum_threshold

Controls the tiling strategies for Auto Tiling to ensure that the tiling solution result is combined with the operator implementation. The multi-core usage is not lower than the value set for this control point. If the multi-core usage does not meet the specified threshold, the maximum multi-core usage that can be solved is used. This control point helps locate performance-related problems.

Value: an integer ranging from 0 to 100. The default value is 40.

When --att_enable_multicore_ub_tradeoff is enabled, the default value is 40. Otherwise, no strategy is set.

Configuration example:

--att_corenum_threshold=40

Restrictions:

  1. This option must be used together with --att_enable_multicore_ub_tradeoff. The --att_corenum_threshold control point takes effect only when --att_enable_multicore_ub_tradeoff is enabled.
  2. If an invalid value is configured, the default value is used.

--att_profiling

Controls whether to enable profiling for Auto Tiling.

Value:

  • true: enables profiling.
  • false (default): disables profiling.

Configuration example:

--att_profiling=true

Restrictions:

  1. This control point is used only to locate execution time-relevant problems of the Auto Tiling module.
  2. If an invalid value is configured, the default value is used.

--disable_lifting

Controls whether to disable the lifting function.

Automatic fusion is used to fuse operators into a new operator named AscBackend, while lifting is used to roll back the AscBackend operator that does not meet the requirements to the original operators.

Value:

  • true: disables the lifting function.
  • false (default): enables the lifting function.

Configuration example:

--disable_lifting=true

Restrictions:

This control point is used only to locate the analysis problems of the Ascbackend rollback structure. Enabling this control point may cause the ApplyAdamD operator precision to be abnormal.

--autofuse_pgo_algo

Controls the PGO algorithm. The tiling method varies depending on the algorithm.

Value:

  • core_select: (default) The core control algorithm is used.
  • pruning: The pruning algorithm is used.

By default, the core control algorithm is used to ensure that the tiling time is not too long. Theoretically, the pruning algorithm may obtain a better tiling solution, but the tiling takes much longer.

Configuration example:

--autofuse_enable_pgo=true --autofuse_pgo_algo=core_select

Restrictions:

  1. This option must be used together with --autofuse_enable_pgo. The --autofuse_pgo_algo control point takes effect only when --autofuse_enable_pgo is enabled.
  2. If an invalid value is configured, the default value is used.

--autofuse_pgo_step_max

Controls the step of the PGO pruning algorithm.

Value: a power of 2 ranging from 2 to 1024. The default value is 16.

Configuration example:

--autofuse_enable_pgo=true --autofuse_pgo_algo=pruning --autofuse_pgo_step_max=16

Restrictions:

  1. This option must be used together with --autofuse_pgo_algo. The --autofuse_pgo_step_max control point takes effect only when --autofuse_pgo_algo is set to pruning and the setting takes effect.

    A smaller step value may result in a better tiling solution, but requires a longer tiling execution time. It is the reverse for a larger step value.

  1. If an invalid value is configured, the default value is used.

--autofuse_pgo_topn

Controls the number of solutions involved in PGO static tuning.

Value:

  • 0: All solutions are used for static tuning.
  • Any positive integer: indicates the number of solutions that can be selected. The default value is 5.

Configuration example:

--autofuse_enable_pgo=true --autofuse_pgo_topn=5

Restrictions:

  1. This option must be used together with --autofuse_enable_pgo. The --autofuse_pgo_topn control point takes effect only when --autofuse_enable_pgo is enabled.
  2. If an invalid value is configured, the default value is used.

--skip_node_names_cfg

Sets the name or type of the operator to be skipped during fusion.

Value: path and name of the configuration file (in .ini format) that contains the operator name or type. Each operator is displayed in a separate line. You can set the operator name and type at the same time. The operator type must be defined based on the Ascend IR.

Configuration example:

The following is an example of the .ini configuration file:

[ByNodeName]
op_name1
op_name2
[ByNodeType]
op_type1
op_type2

Example:

--skip_node_names_cfg=./skil_node.ini

Restrictions: This configuration item does not take effect when the content in the configuration file is invalid.