DUMP_GRAPH_FORMAT
Description
DUMP_GRAPH_FORMAT controls the type of the dump file to be generated.
Available values are as follows:
- onnx: model description structure based on ONNX. You can open this file using visualizer software such as Netron. The generated file name is ge_onnx*.pbtxt.
- ge_proto: text file stored in Protobuf format. The generated file name is ge_proto*.txt.
- readable: highly readable text file in Dynamo FX graph style. The generated file name is ge_readable*.txt. For details about the file content, see Readable File Parsing.
Usage:
The configuration is a character string separated by vertical bars (|). The type is in lowercase. Combined configuration is supported, for example, ge_proto|onnx|readable indicates that all types of files are dumped. Separate configuration is also supported, for example, ge_proto indicates that only ge_proto*.txt files of the ge_proto type are dumped.
DUMP_GRAPH_FORMAT takes effect only when DUMP_GE_GRAPH is enabled. The default value is ge_proto|onnx.
Example
export DUMP_GRAPH_FORMAT="ge_proto|onnx"
Restrictions
- If this environment variable is set to an invalid value, undefined behavior may occur.
- If the operator dump data collection function is enabled, see "ge.exec.enableDump" in the Graph Mode Development Guide.
The subgraph ge_proto_xxxx_Build.txt is dumped even if the value of DUMP_GRAPH_FORMAT does not contain ge_proto.
Readable File Parsing
The following is a complete ge_readable*.txt file:
graph("MakeTransformerSubGraph"):
%input_0 : [#users=1] = Node[type=Data] (attrs = {index: 0})
%input_1 : [#users=1] = Node[type=Data] (attrs = {index: 1})
%input_2 : [#users=1] = Node[type=Data] (attrs = {index: 2})
%Const_0 : [#users=1] = Node[type=Const] (attrs = {value: [-1 7168]})
%Reshape_1 : [#users=1] = Node[type=Reshape] (inputs = (%input_0, %Const_0), attrs = {axis: 0, num_axes: -1})
%Cast_2 : [#users=1] = Node[type=Cast] (inputs = (%Reshape_1), attrs = {dst_type: 0})
%Cast_3 : [#users=1] = Node[type=Cast] (inputs = (%input_1), attrs = {dst_type: 0})
%Const_4 : [#users=1] = Node[type=Const] (attrs = {value: [1 0]})
%Transpose_5 : [#users=1] = Node[type=Transpose] (inputs = (%Cast_3, %Const_4))
%MatMul_6 : [#users=1] = Node[type=MatMul] (inputs = (%Cast_2, %Transpose_5), attrs = {transpose_x1: false, transpose_x2: false})
%Sigmoid_7 : [#users=1] = Node[type=Sigmoid] (inputs = (%MatMul_6))
%Const_8 : [#users=1] = Node[type=Const] (attrs = {value: [-1 256]})
%Reshape_9 : [#users=1] = Node[type=Reshape] (inputs = (%Sigmoid_7, %Const_8), attrs = {axis: 0, num_axes: -1})
%Unsqueeze_10 : [#users=1] = Node[type=Unsqueeze] (inputs = (%input_2), attrs = {axes: {0}})
%Cast_11 : [#users=1] = Node[type=Cast] (inputs = (%Unsqueeze_10), attrs = {dst_type: 0})
%Add_12 : [#users=1] = Node[type=Add] (inputs = (%Reshape_9, %Cast_11))
%Const_13 : [#users=1] = Node[type=Const] (attrs = {value: [2]})
%TopKV2_14 : [#users=2] = Node[type=TopKV2] (inputs = (%Add_12, %Const_13), attrs = {sorted: true, dim: -1, largest: true, indices_dtype: 3})
%ret : [#users=1] = get_element[node=%TopKV2_14](0)
%ret_1 : [#users=0] = get_element[node=%TopKV2_14](1)
%Const_15 : [#users=1] = Node[type=Const] (attrs = {value: [-1]})
%ReduceSum_16 : [#users=1] = Node[type=ReduceSum] (inputs = (%ret, %Const_15), attrs = {keep_dims: false, noop_with_empty_axes: true})
%Const_17 : [#users=1] = Node[type=Const] (attrs = {value: [4]})
%TopKV2_18 : [#users=2] = Node[type=TopKV2] (inputs = (%ReduceSum_16, %Const_17), attrs = {sorted: false, dim: -1, largest: true, indices_dtype: 3})
%ret_2 : [#users=0] = get_element[node=%TopKV2_18](0)
%ret_3 : [#users=1] = get_element[node=%TopKV2_18](1)
%Cast_19 : [#users=1] = Node[type=Cast] (inputs = (%ret_3), attrs = {dst_type: 9})
%ZerosLike_20 : [#users=1] = Node[type=ZerosLike] (inputs = (%ReduceSum_16))
%Shape_21 : [#users=1] = Node[type=Shape] (inputs = (%Cast_19), attrs = {dtype: 3})
%Const_22 : [#users=1] = Node[type=Const] (attrs = {value: [1.000000]})
%Cast_23 : [#users=1] = Node[type=Cast] (inputs = (%Const_22), attrs = {dst_type: 0})
%Fill_24 : [#users=1] = Node[type=Fill] (inputs = (%Shape_21, %Cast_23))
%ScatterElements_25 : [#users=1] = Node[type=ScatterElements] (inputs = (%ZerosLike_20, %Cast_19, %Fill_24), attrs = {axis: 0, reduction: "none"})
%Unsqueeze_26 : [#users=1] = Node[type=Unsqueeze] (inputs = (%ScatterElements_25), attrs = {axes: {-1}})
%Const_27 : [#users=1] = Node[type=Const] (attrs = {value: [256 256]})
%BroadcastTo_28 : [#users=1] = Node[type=BroadcastTo] (inputs = (%Unsqueeze_26, %Const_27))
%Identity_29 : [#users=1] = Node[type=Identity] (inputs = (%BroadcastTo_28))
%Const_30 : [#users=1] = Node[type=Const] (attrs = {value: [256 256]})
%Reshape_31 : [#users=1] = Node[type=Reshape] (inputs = (%Identity_29, %Const_30), attrs = {axis: 0, num_axes: -1})
%Cast_32 : [#users=1] = Node[type=Cast] (inputs = (%Reshape_31), attrs = {dst_type: 12})
%LogicalNot_33 : [#users=1] = Node[type=LogicalNot] (inputs = (%Cast_32))
%Const_34 : [#users=1] = Node[type=Const] (attrs = {value: [0.000000]})
%MaskedFill_35 : [#users=1] = Node[type=MaskedFill] (inputs = (%Add_12, %LogicalNot_33, %Const_34))
%Const_36 : [#users=1] = Node[type=Const] (attrs = {value: [4]})
%TopKV2_37 : [#users=2] = Node[type=TopKV2] (inputs = (%MaskedFill_35, %Const_36), attrs = {sorted: false, dim: -1, largest: true, indices_dtype: 3})
%ret_4 : [#users=0] = get_element[node=%TopKV2_37](0)
%ret_5 : [#users=1] = get_element[node=%TopKV2_37](1)
%Cast_38 : [#users=1] = Node[type=Cast] (inputs = (%ret_5), attrs = {dst_type: 9})
%GatherElements_39 : [#users=1] = Node[type=GatherElements] (inputs = (%Sigmoid_7, %Cast_38), attrs = {dim: 1})
%Const_40 : [#users=1] = Node[type=Const] (attrs = {value: [0.000001]})
%RealDiv_41 : [#users=1] = Node[type=RealDiv] (inputs = (%GatherElements_39, %Const_40))
%Const_42 : [#users=1] = Node[type=Const] (attrs = {value: [2.500000]})
%Mul_43 : [#users=1] = Node[type=Mul] (inputs = (%RealDiv_41, %Const_42))
%Cast_44 : [#users=1] = Node[type=Cast] (inputs = (%Mul_43), attrs = {dst_type: 0})
return (%Cast_38, %Cast_44)
The fields are described as follows:
- Graph name: graph ("<Graph name>").
- Node instance: %<Node instance name> : [#users=<Outdegree>] = Node[type=<Node type>](inputs = (%<Node input instance 1>, %<Node input instance 2>, ...), attrs = {<Attribute name 1>: <Attribute value>, <Attribute name 2>: <Attribute value>, ...})
- <Node instance name>: name of a node instance.
- #users=<Outdegree>: number of node outputs.
- Node[type=<Node type>]: OP operator type of a node, for example, Node[type=MatMul] for the MatMul operator.
- inputs = (<Input node input instance#num>, ...): input node instance of a node. Optional and mandatory inputs are not distinguished. If the input is empty, the default value is used.
- attrs = {<Attribute name 1>: <Attribute value>, ...}: attribute name and value of a node. Optional and mandatory attributes are not distinguished. If the value is empty, the default value is used.
- Node with multiple outputs: %ret/ret_#cnt : [#users=<Number of consumers>] = get_element[node=%<Node instance name>](<Output index>)
- %ret/ret_#cnt: ret is used to indicate the multi-output scenario, where the outputs increase in ascending order in the format of ret, ret_1, and ret_2.
- #users=<Outdegree>: number of consumers of the output.
- get_element[node=%<Node instance name>]: name of the node corresponding to the output. get_element indicates the output, and node=%<Node instance name> indicates the node instance of the output.
- <Output index>: index of the output.
- Graph output: return (%<Graph output 1>, %<Graph output 2>, ...)
Graph output, corresponding to the input of the NetOutput graph.