AUTOFUSE_FLAGS Environment Variable and Its Control Points
--enable_autofuse
Controls whether to enable the overall automatic fusion function.
Value:
- true: enables the function.
- false (default): disables the function.
If this option is not specified, the overall automatic fusion function is disabled. In this case, all the following control points become invalid, regardless of whether they have been set.
Configuration example:
--enable_autofuse=true
Restrictions:
After the function is enabled, the automatic fusion of the Elemwise and Broadcast operators is enabled.
--autofuse_disable_pass
Controls whether to disable the extended fusion capability.
Value:
- reduce: disables the fusion capability for Reduce operators.
- concat: disables the fusion capability for Concat operators.
Use commas (,) to separate multiple values. By default, this option is left blank. The fusion capability is disabled for Reduce and Concat operators by default.
Configuration example:
--autofuse_disable_pass=reduce,concat
Restrictions:
The value cannot be the same as that of --autofuse_enable_pass.
--autofuse_enable_pass
Controls whether to enable the extended fusion capability.
Value:
- reduce: enables the fusion capability for Reduce operators.
- concat: enables the fusion capability for Concat operators.
Use commas (,) to separate multiple values. By default, this option is left blank. The fusion capability is disabled for Reduce and Concat operators by default.
Configuration example:
--autofuse_enable_pass=reduce,concat
Restrictions:
The value cannot be the same as that of --autofuse_disable_pass.
--autofuse_enhance_precision_blacklist
Controls whether to improve the precision on partial fusion nodes during automatic fusion.
The precision of an AscGraph will not be improved only when all AscIRs in the AscGraph are configured in the blacklist.
Value:
- A string of a combination of AscIR characters. Multiple types are separated by commas (,). The default value is an empty string, indicating that the precision of all AscGraphs is improved.
The AscIR type in this option is the value of type of the corresponding node in the dump graph. For example, if the value of type of a node in the dump graph is ge:Add, the value Add is configured here.
- all: indicates that all nodes are blacklisted to disable the precision improvement operation during automatic fusion, avoiding unnecessary overheads for precision improvement.
Configuration example:
--autofuse_enhance_precision_blacklist=Le,Where,Sub,Add,Sigmoid
Restrictions:
- Sum, Mean, and Prod do not support low precision. By default, the precision must be improved. They cannot be configured in the precision improvement blacklist. Even if they are configured as all, the precision is still improved.
- Not improving the precision can achieve higher performance, but may cause precision issues. Therefore, after configuring not to improve the precision, ensure that the precision meets service requirements.
- For details about how to dump graphs, see Environment Variables > Graph Building > DUMP_GE_GRAPH.
--recomputation_threshold
Controls the threshold for automatic fusion recomputation.
It is used to define the reference threshold of a single-output operator. When the number of references of a single-output node exceeds the threshold, the first fusion is truncated on the current node.
Value: an integer ranging from 0 to 255. The default value is 1.
Configuration example:
--recomputation_threshold=5
Restrictions:
None
--experimental_enable_jit_executor_v2
Controls whether to enable graph partitioning and build.
Value:
- true: enables the function.
- false (default): disables the function.
Through graph partitioning and build, the original graph is split into N graphs at the boundary where symbols cannot be inferred. The output of the upstream graph is used as the input hint of the downstream graph for subsequent symbol inference and execution.
--experimental_enable_jit_executor_v2=true
Restrictions:
Graph partitioning is not supported in the following scenarios:
- Dynamic profile scenario:
- Graphs that contain resource operators (the input or input type is DT_RESOURCE, for example, TensorArrayWrite)
- Graphs that contain V1 control operators (such as "Switch", "StreamSwitch", "Merge", "StreamMerge", "Enter", "Exit", "LoopCond", and "NextIteration")
- Data preprocessing offload enabled
- AOE tuning enabled
--autofuse_enable_pgo
Controls whether to enable profile-guided optimization (PGO).
Through pre-board sampling, PGO picks the better-performing tiling solution to speed up model execution.
Value:
- true: enables the function.
- false (default): disables the function.
Configuration example:
--autofuse_enable_pgo=true
Restrictions:
Only static graphs can be tuned. If you configure this option for the first time, do not enable this function together with other profiling functions. There are no restrictions on subsequent configurations.
--max_fusion_size
Sets the maximum number of nodes that can be fused.
Value range: [0, maximum value of the uint64_t type]. The value 0 indicates that no fusion is performed.
Configuration example:
--max_fusion_size=64
The preceding example indicates that a maximum of 64 AscIR nodes can be fused.
Restrictions:
None