ExtendCfgInfo

Function

Extends the parameter configuration of an operator to provide 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. You can set this parameter 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 in the dynamic shape scenario:
    OpAICoreConfig aicore_config;
    aicore_config.DynamicShapeSupportFlag(true)   // DynamicShapeSupportFlag must be set to true in the dynamic shape scenario.
                 .ExtendCfgInfo("aclnnSupport.value", "support_aclnn");
    this->AICore().AddConfig("ascendxxx", aicore_config);
    
    // The following is an example in the static shape scenario:
    OpAICoreConfig aicore_config;
    aicore_config.DynamicCompileStaticFlag(true) // In the static shape scenario, DynamicCompileStaticFlag 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. This mode is not recommended and will be deprecated in later versions.
    // The following is an example in the dynamic shape scenario:
    OpAICoreConfig aicore_config;
    aicore_config.DynamicShapeSupportFlag(true)   // DynamicShapeSupportFlag must be set to true in the dynamic shape scenario.
    			 .ExtendCfgInfo("aclnnSupport.value", "aclnn_only");
    this->AICore().AddConfig("ascendxxx", aicore_config);
    // The following is an example in the static shape scenario:
    OpAICoreConfig aicore_config;              // DynamicCompileStaticFlag/DynamicShapeSupportFlag does not need to be configured. Operators are delivered in fallback mode, that is, the delivery mode of the dynamic shape model.
    aicore_config.ExtendCfgInfo("aclnnSupport.value", "aclnn_only");
    this->AICore().AddConfig("ascendxxx", aicore_config);

For details about the operator delivery in fallback mode, see "Delivering Operators in Fallback Mode" .

Returns

For details about the OpAICoreConfig operator definition, see OpAICoreConfig.

Restrictions

None