ExtendCfgInfo

Function

This function is used to configure parameters related to extended operators, providing more flexible parameter configuration capabilities.

Prototype

1
OpAICoreConfig &OpAICoreConfig::ExtendCfgInfo(const char *key, const char *value) 

Parameters

Table 1 Parameters

Parameter

Input/Output

Description

key

Input

Configuration item, for example, aclnnSupport.value.

value

Input

Value of the configuration item key, for example, aclnnSupport.value. It can be set to support_aclnn or aclnn_only.

The following table lists the parameters supported by ExtendCfgInfo.

Table 2 Parameters supported by ExtendCfgInfo

Parameter

Overview

aclnnSupport.value

  • support_aclnn: In the static shape scenario, the operator is executed through model offload; in the dynamic shape scenario, the fallback function is called on the host to deliver the operator. If EnableFallBack is called, this mode is used by default.
    // The following is an example of the dynamic shape scenario.
    OpAICoreConfig aicore_config;
    In the dynamic shape scenario, aicore_config.DynamicShapeSupportFlag(true) // must be set to true.
                 .ExtendCfgInfo("aclnnSupport.value", "support_aclnn");
    this->AICore().AddConfig("ascendxxx", aicore_config);
    
    // The following is an example of the static shape scenario.
    OpAICoreConfig aicore_config;
    In the static shape scenario, aicore_config.DynamicCompileStaticFlag(true) // must be set to true.
                 .ExtendCfgInfo("aclnnSupport.value", "support_aclnn");
    this->AICore().AddConfig("ascendxxx", aicore_config);
  • aclnn_only: Fallback-based operator delivery is used in both the dynamic and static shape scenarios. You are not advised to use this mode, which will be discarded in later versions.
    // The following is an example of the dynamic shape scenario.
    OpAICoreConfig aicore_config;
    In the aicore_config.DynamicShapeSupportFlag(true) // dynamic shape scenario, DynamicShapeSupportFlag must be set to true.
    			 .ExtendCfgInfo("aclnnSupport.value", "aclnn_only");
    this->AICore().AddConfig("ascendxxx", aicore_config);
    // The following is an example of the static shape scenario.
    OpAICoreConfig aicore_config; // You do not need to set DynamicCompileStaticFlag or DynamicShapeSupportFlag. The operator is delivered in fallback mode, that is, the mode for delivering a dynamic shape model.
    aicore_config.ExtendCfgInfo("aclnnSupport.value", "aclnn_only");
    this->AICore().AddConfig("ascendxxx", aicore_config);

For details about operators delivered in fallback mode, see section "Delivering Operators in Fallback Mode" in the .

Returns

For details about the definition of the OpAICoreConfig operator, see OpAICoreConfig.

Restrictions

None