--oo_level
Applicable Products
All processors
Description
Extended parameter for debugging. It cannot be used in commercial products and will be released as a formal function in later versions.
Sets multi-level optimization options for graph build, including subgraph optimization, entire graph optimization, and static shape model offloading.
Static shape model offloading: In this approach, the input and output shapes of all operators in a static shape model can be determined at build time, allowing host-side computations such as model-level memory arrangement and operator tiling calculation to be completed. During model loading, these prepared resources and instructions are sent to the device stream as a whole, but are not executed immediately. Instead, a dedicated model execution task is issued to trigger the execution of all tasks in the model.
See Also
None
Arguments
- O1: Disables all graph fusion and UB fusion passes, and performs only optimizations related to static offloading, such as InferShape (output tensor shape inference), constant folding, dead-edge elimination, and other optimizations.
The
Ascend 950PR /Ascend 950DT does not support UB fusion. Only the graph fusion pass is disabled. - O3 (default): Enables all optimizations.
Suggestions and Benefits
None
Example
--oo_level=O1
Restrictions
If the value is O1, all graph fusion and UB fusion passes are disabled, and only passes related to static offloading are enabled. However, the graph fusion passes in the following file are enabled by default since disabling them will cause malfunctions:
All graph fusion passes under the ExceptionalPassOfO1Level field in the ${INSTALL_DIR}/x86_64-linux/lib64/plugin/opskernel/fusion_pass/config/fusion_config.json file.
Replace ${INSTALL_DIR} with the CANN component directory. For example, if the installation is performed by the root user, the default file storage path is /usr/local/Ascend/cann.