Basic Functions

INPUT_FORMAT

Sets the input format. The corresponding options parameter is input_format.

Parameter values:

NCHW, NHWC, ND, NCDHW, and NDHWC

Configuration example:

{ge::ir_option::INPUT_FORMAT, "NHWC"}

To enable AIPP during inference, the input graph data must be in NHWC format. In this scenario, the data format specified by INPUT_FORMAT does not take effect.

This parameter applies only to the dynamic batch size, dynamic image size, and dynamic dimension scenarios.

In these scenarios, INPUT_FORMAT must be the same as the format of all data operators. Otherwise, model build fails.

Applicable products:

All processors

OP_NAME_MAP

Sets the directory (including the file name) of the mapping configuration file of a custom operator. The function of a custom operator varies according to the network. You can specify the mapping between the custom operator and the actual custom operator running on the network. The corresponding options parameter is op_name_map.

For example, the Caffe network has layers of the same type but different computing functions, such as the DetectionOutput layer. You need to use operator mapping to specify the detection operator type, such as FSRDetectionOutput and SSDDetectionOutput. Otherwise, the generated offline model will fail to be executed.

This parameter applies only to the Caffe framework.

The path (including the file name) can contain letters (a–z, A–Z), digits (0–9), underscores (_), hyphens (-), and periods (.).

Configuration example:

{ge::ir_option::OP_NAME_MAP, "/home/test/opname_map.cfg"}

The following is an example of the content in the mapping configuration file of a custom operator:

OpA:Network1OpA

Applicable products:

  • Ascend 950PR / Ascend 950DT : not supported
  • Atlas A3 training products / Atlas A3 inference products : not supported
  • Atlas A2 training products / Atlas A2 inference products : not supported
  • Atlas 200I/500 A2 inference products : supported
  • Atlas inference products : supported
  • Atlas training products : supported

INSERT_OP_FILE

Sets the path of the configuration file of the input pre-processing operator, for example, the AIPP operator. The corresponding options parameter is ge.insertOpFile. For details about the parameter, see "Additional Features" > "AIPP".

This parameter is mutually exclusive with INPUT_FP16_NODES.

The configuration file path can contain only letters, digits, and underscores (_). The file name can contain letters, digits, underscores (_), and periods (.).

Configuration example:

{ge::ir_option::INSERT_OP_FILE, "/home/test/aipp.cfg"}

The following is an example of the configuration file:

aipp_op {
    aipp_mode:static
    input_format:YUV420SP_U8
    csc_switch:true
    var_reci_chn_0:0.00392157
    var_reci_chn_1:0.00392157
    var_reci_chn_2:0.00392157
}

For details about the configuration file, see Ascend Tensor Compiler (ATC).

Applicable products:

  • Ascend 950PR / Ascend 950DT : supported
  • Atlas A3 training products / Atlas A3 inference products : supported
  • Atlas A2 training products / Atlas A2 inference products : supported
  • Atlas 200I/500 A2 inference products : supported
  • Atlas inference products : supported
  • Atlas training products : supported

OUTPUT_TYPE

Sets the network output data type. The corresponding options parameter is ge.outputDatatype.

Parameter values:

  • FP32: recommended for classification and object detection networks.
  • FP16: recommended for classification and object detection networks. It is usually used when the output of one network is used as the input of another.
  • UINT8: recommended for image super-resolution networks for better inference performance.
  • INT8
  • UINT16
  • INT16
  • UINT32
  • INT32
  • UINT64
  • INT64
  • DOUBLE
  • HIF8: supported only by the Ascend 950PR / Ascend 950DT .
  • FP8E5M2: supported only by the Ascend 950PR / Ascend 950DT .
  • FP8E4M3FN: supported only by the Ascend 950PR / Ascend 950DT .

After model build, the preceding data types are displayed in the corresponding *.om model file as follows:

  • DT_FLOAT
  • DT_FLOAT16
  • DT_UINT8
  • DT_INT8
  • DT_UINT16
  • DT_INT16
  • DT_UINT32
  • DT_INT32
  • DT_UINT64
  • DT_INT64
  • DT_DOUBLE
  • DT_HIFLOAT8
  • DT_FLOAT8_E5M2
  • DT_FLOAT8_E4M3FN

Configuration example:

{ge::ir_option::OUTPUT_TYPE, "FP32"}

Restrictions:

  • If no data type is specified, the data type of the operator output at the last layer of the original network model is used.
  • If the data type is specified, the type specified by this parameter is used.

Applicable products:

All processors

INPUT_FP16_NODES

Sets the input nodes to specify as FP16 nodes. The corresponding options parameter is ge.INPUT_NODES_SET_FP16.

The format is "node_name1;node_name2". Enclose the specified nodes in double quotation marks ("") and separate the nodes with semicolons (;). This parameter is mutually exclusive with INSERT_OP_FILE.

Configuration example:

{ge::ir_option::INPUT_FP16_NODES, "node_name1;node_name2"}

Applicable products:

All processors