• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright 2019-2021 Huawei Technologies Co., Ltd
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef MINDSPORE_CCSRC_FRONTEND_PARALLEL_OPS_INFO_OPS_UTILS_H_
18 #define MINDSPORE_CCSRC_FRONTEND_PARALLEL_OPS_INFO_OPS_UTILS_H_
19 
20 #include "base/core_ops.h"
21 
22 namespace mindspore {
23 namespace parallel {
24 constexpr size_t MAX_RECURSIVE_DEPTH = 100000;
25 constexpr size_t PRELU_INPUTS_SIZE = 2;
26 constexpr size_t PRELU_OUTPUTS_SIZE = 1;
27 constexpr size_t PRELU_SECOND_INPUT_SIZE = 1;
28 constexpr int64_t PRELU_CHANNEL_INDEX = 1;
29 constexpr int64_t PRELU_CHANNEL_STRATEGY = 1;
30 constexpr int64_t NO_SPLIT_MAP = -1;
31 constexpr int64_t NO_SPLIT_STRATEGY = 1;
32 constexpr int64_t SPLIT_FLAG = 1;
33 constexpr int64_t NO_SPLIT_FLAG = 0;
34 constexpr size_t MATMUL_ATTRS_SIZE = 2;
35 constexpr size_t SLICE_BEGIN_INDEX = 1;
36 constexpr size_t SLICE_SIZE_INDEX = 2;
37 constexpr size_t SLICE_INPUTS_SIZE = 3;
38 constexpr size_t STRIDED_SLICE_ATTRS_SIZE = 5;
39 constexpr size_t STRIDED_SLICE_INPUTS_SIZE = 4;
40 constexpr size_t STRIDED_SLICE_ARGS_SIZE = 3;
41 constexpr size_t STRIDED_SLICE_BEGIN_INDEX = 1;
42 constexpr size_t STRIDED_SLICE_END_INDEX = 2;
43 constexpr size_t STRIDED_SLICE_STRIDES_INDEX = 3;
44 constexpr size_t MATMUL_INPUTS_SIZE = 2;
45 constexpr size_t MATMUL_OUTPUTS_SIZE = 1;
46 constexpr size_t LAYERNORM_INPUTS_SIZE = 3;
47 constexpr size_t ONEHOT_INPUTS_SIZE = 4;
48 constexpr size_t UNSORTEDSEGMENTSUM_INPUTS_SIZE = 3;
49 constexpr size_t GATHERV2_INPUTS_SIZE = 3;
50 constexpr size_t DROPOUTDOMASK_INPUTS_SIZE = 3;
51 constexpr size_t ACTIVATION_ATTR_SIZE = 1;
52 constexpr size_t SOFTMAX_ATTR_SIZE = 1;
53 constexpr size_t ACTIVATION_INPUTS_SIZE = 1;
54 constexpr size_t ACTIVATION_OUTPUTS_SIZE = 1;
55 constexpr size_t EXPANDDIMS_INPUT_SIZE = 2;
56 constexpr size_t DROPOUT_DO_MASK_CNODE_INPUT_SIZE = 4;
57 constexpr size_t DROPOUT_GEN_MASK_CNODE_INPUT_SIZE = 3;
58 constexpr size_t DROPOUT_GEN_MASK_INDEX = 2;
59 constexpr size_t DROPOUT_DO_MASK_KEEP_PROB_INDEX = 3;
60 constexpr size_t DSD_MATMUL_INPUTS_SIZE = 3;
61 constexpr size_t DSD_MATMUL_OUTPUTS_SIZE = 1;
62 constexpr size_t DSD_MATMUL_STRATEGY_W_SIZE = 7;
63 constexpr size_t DSD_MATMUL_STRATEGY_V_SIZE = 4;
64 constexpr size_t SoftmaxCrossEntropyWithLogitsAttrSize = 1;
65 constexpr size_t SoftmaxCrossEntropyWithLogitsInputsSize = 2;
66 constexpr size_t SoftmaxCrossEntropyWithLogitsOutputsSize = 2;
67 constexpr size_t UNIQUE_INPUTS_SIZE = 1;
68 constexpr size_t UNIQUE_INPUT_SIZE = 1;
69 constexpr size_t UNIQUE_OUTPUTS_SIZE = 2;
70 constexpr size_t TRANSFER_PERMUTE_ARGS_SIZE = 5;
71 constexpr size_t TRANSFER_PERMUTE_SPLIT_COUNT_INDEX = 0;
72 constexpr size_t TRANSFER_PERMUTE_SPLIT_DIM_INDEX = 1;
73 constexpr size_t TRANSFER_PERMUTE_CONCAT_DIM_INDEX = 2;
74 constexpr size_t TRANSFER_PERMUTE_DEV_DIM_INDEX = 3;
75 constexpr size_t TRANSFER_PERMUTE_DEV_NUM_INDEX = 4;
76 constexpr size_t TRANSFER_CONCAT_ARGS_SIZE = 3;
77 constexpr size_t TRANSFER_CONCAT_TENSOR_DIM_INDEX = 0;
78 constexpr size_t TRANSFER_CONCAT_DEV_DIM_INDEX = 1;
79 constexpr size_t TRANSFER_CONCAT_SPLIT_COUNT_INDEX = 2;
80 constexpr size_t TRANSFER_SPLIT_ARGS_SIZE = 3;
81 constexpr size_t MATMUL_DDS_INPUTS_SIZE = 4;
82 constexpr size_t MATMUL_DDS_OUTPUTS_SIZE = 2;
83 constexpr size_t MATMUL_DDS_STRATEGY_SIZE = 4;
84 constexpr double EPS = 1e-6;
85 constexpr double INF = 1e20;
86 constexpr double COST_FACTOR = 2.0;
87 
88 constexpr char AUTO_PARALLEL_RUN_ONCE_ONLY[] = "auto_parallel_run_once_only";
89 constexpr char SEMI_AUTO_PARALLEL_RUN_ONCE_ONLY[] = "semi_auto_parallel_run_once_only";
90 constexpr char CHECK_SET_STRATEGY_VALID_ONCE_ONLY[] = "check_set_strategy_valid_once_only";
91 constexpr char STRATEGY[] = "strategy";
92 constexpr char STAGE_ATTR[] = "stage";
93 constexpr char GEN_STRATEGY[] = "gen_strategy";
94 constexpr char REDUCE_OP_SUM[] = "sum";
95 constexpr char REDUCE_OP_MAX[] = "max";
96 constexpr char REDUCE_OP_MIN[] = "min";
97 constexpr char REDUCE_OP_ANY[] = "any";
98 constexpr char OP_PATH[] = "mindspore.ops.operations";
99 constexpr char INNER_OP_PATH[] = "mindspore.ops.operations._inner_ops";
100 constexpr char FUNCTIONAL_OP_PATH[] = "mindspore.ops.functional";
101 constexpr char GET_OP_FUNCTION_PATH[] = "mindspore.parallel._utils";
102 constexpr char GET_OP_FUNCTION[] = "_get_python_op";
103 constexpr char KEEP_DIMS[] = "keep_dims";
104 constexpr char CROSS_BATCH[] = "cross_batch";
105 constexpr char STEP_PARALLEL_BEGIN[] = "step_parallel_begin";
106 constexpr char STEP_PARALLEL_END[] = "step_parallel_end";
107 constexpr char STEP_AUTO_PARALLEL_BEGIN[] = "step_auto_parallel_begin.dot";
108 constexpr char REQUIRES_GRAD[] = "requires_grad";
109 constexpr char PARAM_NAME[] = "name";
110 constexpr char RESHAPEINFO[] = "ReshapeInfo";
111 constexpr char GETNEXTINFO[] = "GetNextInfo";
112 constexpr char VIRTUALDATASETINFO[] = "VirtualDatasetInfo";
113 
114 constexpr char RELU_TYPE[] = "relu";
115 constexpr char RELU6_TYPE[] = "relu6";
116 constexpr char SIGMOID_TYPE[] = "sigmoid";
117 constexpr char OP[] = "op";
118 constexpr char IDENTITY_INFO[] = "identity_info";
119 constexpr char DIVISOR[] = "divisor";
120 constexpr char NONE[] = "None";
121 constexpr char DEPEND[] = "Depend";
122 constexpr char BATCH_PARALLEL[] = "BatchParallel";
123 
124 constexpr char ACTIVATION_TYPE[] = "activation_type";
125 constexpr char TARGET[] = "primitive_target";
126 constexpr char CPU[] = "CPU";
127 constexpr char TRANSPOSE_A[] = "transpose_a";
128 constexpr char TRANSPOSE_B[] = "transpose_b";
129 constexpr char SHAPE[] = "shape";
130 constexpr char BEGIN_MASK[] = "begin_mask";
131 constexpr char END_MASK[] = "end_mask";
132 constexpr char ELLIPSIS_MASK[] = "ellipsis_mask";
133 constexpr char NEW_AXIS_MASK[] = "new_axis_mask";
134 constexpr char SHRINK_AXIS_MASK[] = "shrink_axis_mask";
135 constexpr char BEGIN[] = "begin";
136 constexpr char SIZE[] = "size";
137 constexpr char ALIGN_CORNERS[] = "align_corners";
138 constexpr char END[] = "end";
139 constexpr char STRIDES[] = "strides";
140 constexpr char GROUP[] = "group";
141 constexpr char FUSION[] = "fusion";
142 constexpr char DO_MIRROR[] = "do_mirror";
143 constexpr char RECOMPUTE[] = "recompute";
144 constexpr char RECOMPUTE_COMM_OP[] = "recompute_comm_op";
145 constexpr char NOT_RECOMPUTE[] = "not_recompute";
146 constexpr char NUM_SAMPLED[] = "num_sampled";
147 constexpr char NUM_TRUE[] = "num_true";
148 constexpr char SEED[] = "seed";
149 constexpr char SEED2[] = "seed2";
150 constexpr char RANGE_MAX[] = "range_max";
151 constexpr char REMOVE_ACCIDENTAL_HITS[] = "remove_accidental_hits";
152 constexpr char UNIQUE_STRING[] = "unique";
153 constexpr char AXIS[] = "axis";
154 constexpr char BS[] = "bs";
155 constexpr char HEADS[] = "heads";
156 constexpr char AXES[] = "axes";
157 constexpr char START[] = "start";
158 constexpr char LIMIT[] = "limit";
159 constexpr char DELTA[] = "delta";
160 constexpr char OUTPUT_NUM[] = "output_num";
161 constexpr char SPLIT_COUNT[] = "split_count";
162 constexpr char SPLIT_DIM[] = "split_dim";
163 constexpr char CONCAT_DIM[] = "concat_dim";
164 constexpr char FORWARD[] = "forward";
165 constexpr char BACKWARD[] = "backward";
166 constexpr char REDISTRIBUTION[] = "redistribution";
167 constexpr char SKIP_REDISTRIBUTION[] = "skip_redistribution";
168 constexpr char REPLACE[] = "replace";
169 constexpr char CONNSYMBOL[] = "/";
170 constexpr char INSTANCE_NAME[] = "instance_name";
171 constexpr char SPLIT_SENS[] = "split_sens";
172 constexpr char SEND_RNAK_IDS[] = "send_rank_ids";
173 constexpr char RECV_RNAK_IDS[] = "recv_rank_ids";
174 constexpr char RECV_SHAPES[] = "recv_shapes";
175 constexpr char SEND_SHAPES[] = "send_shapes";
176 constexpr char RECV_TYPE[] = "recv_type";
177 constexpr char SPLIT_TENSOR[] = "split_tensor";
178 constexpr char DEV_MAT[] = "dev_mat";
179 constexpr char TENSOR_MAP[] = "tensor_map";
180 constexpr char SEED0[] = "Seed0";
181 constexpr char SEED1[] = "Seed1";
182 constexpr char KEEP_PROB[] = "keep_prob";
183 constexpr char SRC[] = "src";
184 constexpr char CLONE_INFO[] = "clone_info";
185 constexpr char CLONED[] = "cloned";
186 constexpr char BE_CLONED[] = "be_cloned";
187 constexpr char CLONED_INDEX[] = "cloned_index";
188 constexpr char BE_CLONED_INDEX[] = "be_cloned_index";
189 constexpr char GROUP_RANKS[] = "group_ranks";
190 constexpr char IS_IN_FORWARD[] = "is_in_forward";
191 constexpr char DTYPE[] = "dtype";
192 constexpr char DEV_NUM[] = "dev_num";
193 constexpr char MEAN_FLAG[] = "mean_flag";
194 constexpr char GRAD_ACCUMULATION_STEP[] = "grad_accumulation_step";
195 constexpr char TYPES[] = "types";
196 constexpr char SHAPES[] = "shapes";
197 constexpr char ACCU_GRADS[] = "accu_grads";
198 constexpr char GETNEXT_NUM[] = "output_num";
199 constexpr char SHARED_NAME[] = "shared_name";
200 constexpr char MIRROR_OP[] = "mirror_op";
201 constexpr char FORWARD_OP[] = "forward_op";
202 constexpr char REDISTRIBUTION_OP[] = "redistribution_op";
203 constexpr char DARA_PARALLEL[] = "data_parallel";
204 constexpr char FORWARD_REDUCE_SCATTER[] = "forward_reduce_scatter";
205 constexpr char FIELD_SIZE[] = "field_size";
206 constexpr char OPTIMIZER_SUB_STRING[] = "optimizer";
207 constexpr char DEVICE[] = "Device";
208 constexpr char PARALLEL_OPTIMIZER_ALLGATHER[] = "parallel_optimizer_allgather";
209 constexpr char PARALLEL_OPTIMIZER_ALLGATHER_NOT_COMPUTE[] = "parallel_optimizer_allgather_not_recompute";
210 constexpr char PARALLEL_OPTIMIZER_COMM_OP[] = "parallel_optimizer_comm_op";
211 constexpr char CELLLIST_KEYWORD_PATTERN[] = "-CellList/(\\d+)-";
212 
213 constexpr char OUT_CHANNEL[] = "out_channel";
214 constexpr char KERNEL_SIZE[] = "kernel_size";
215 constexpr char MODE[] = "mode";
216 constexpr char PAD_MODE[] = "pad_mode";
217 constexpr char PAD_LIST[] = "pad_list";
218 constexpr char PAD[] = "pad";
219 constexpr char DATA_FORMAT[] = "data_format";
220 constexpr char STRIDE[] = "stride";
221 constexpr char DILATION[] = "dilation";
222 constexpr char FORMAT[] = "format";
223 constexpr char NCHW[] = "NCHW";
224 constexpr char IS_TRAINING[] = "is_training";
225 constexpr char EPSILON[] = "epsilon";
226 constexpr char MOMENTUM[] = "momentum";
227 constexpr char DEVICE_NUM[] = "device_num";
228 
229 // Operator
230 constexpr char VIRTUAL_DIV[] = "_VirtualDiv";
231 constexpr char GET_TENSOR_SLICE[] = "_GetTensorSlice";
232 constexpr char SPLIT[] = "Split";
233 constexpr char ALL_TO_ALL[] = "AlltoAll";
234 constexpr char NEIGHBOREXCHANGE[] = "NeighborExchange";
235 constexpr char PERMUTE_BY_AXIS[] = "PermuteByAxis";
236 constexpr char CONCAT_BY_AXIS[] = "ConcatByAxis";
237 constexpr char SPLIT_BY_AXIS[] = "SplitByAxis";
238 constexpr char ALL_REDUCE[] = "AllReduce";
239 constexpr char MIRROR_OPERATOR[] = "_MirrorOperator";
240 constexpr char MIRROR_MINI_STEP_OPERATOR[] = "_MirrorMiniStepOperator";
241 constexpr char LOCAL_STEP[] = "local_step";
242 constexpr char STRIDED_SLICE[] = "StridedSlice";
243 constexpr char ALL_GATHER[] = "AllGather";
244 constexpr char MINI_STEP_ALL_GATHER[] = "_MiniStepAllGather";
245 constexpr char MICRO_STEP_ALL_GATHER[] = "_MicroStepAllGather";
246 constexpr char REDUCE_SCATTER[] = "ReduceScatter";
247 constexpr char HOST_REDUCE_SCATTER[] = "_HostReduceScatter";
248 constexpr char EMBEDDING_LOOKUP[] = "EmbeddingLookup";
249 constexpr char CONCAT[] = "Concat";
250 constexpr char SELECT[] = "Select";
251 constexpr char SOFTMAX_CROSS_ENTROPY_WITH_LOGITS[] = "SoftmaxCrossEntropyWithLogits";
252 constexpr char SIGMOID_CROSS_ENTROPY_WITH_LOGITS[] = "SigmoidCrossEntropyWithLogits";
253 constexpr char MATMUL[] = "MatMul";
254 constexpr char GELU[] = "GeLU";
255 constexpr char TANH[] = "Tanh";
256 constexpr char RECEIVE[] = "Receive";
257 constexpr char SEND[] = "Send";
258 constexpr char SHAPE_OP[] = "Shape";
259 constexpr char SOFTMAX[] = "Softmax";
260 constexpr char LOG_SOFTMAX[] = "LogSoftmax";
261 constexpr char ACTIVATION[] = "Activation";
262 constexpr char PRELU[] = "PReLU";
263 constexpr char FLOORDIV[] = "FloorDiv";
264 constexpr char MAXPOOL[] = "MaxPool";
265 constexpr char AVGPOOL[] = "AvgPool";
266 constexpr char UNIFORMREAL[] = "UniformReal";
267 constexpr char MAXPOOLV2[] = "MaxPoolV2";
268 constexpr char L2_NORMALIZE[] = "L2Normalize";
269 constexpr char TRANSPOSE[] = "Transpose";
270 constexpr char RESHAPE[] = "Reshape";
271 constexpr char ADD[] = "Add";
272 constexpr char BIAS_ADD[] = "BiasAdd";
273 constexpr char SUB[] = "Sub";
274 constexpr char MUL[] = "Mul";
275 constexpr char DIV[] = "Div";
276 constexpr char REAL_DIV[] = "RealDiv";
277 constexpr char ASSIGN_SUB[] = "AssignSub";
278 constexpr char GREATER[] = "Greater";
279 constexpr char UNIFORM_CANDIDATE_SAMPLER[] = "UniformCandidateSampler";
280 constexpr char VIRTUAL_DATA_SET[] = "_VirtualDataset";
281 constexpr char VIRTUAL_OUTPUT[] = "_VirtualOutput";
282 constexpr char VIRTUAL_DATA_SET_INFO[] = "VirtualDatasetInfo";
283 constexpr char SPARSE_SOFTMAX_CROSS_ENTROPY_WITH_LOGITS[] = "SparseSoftmaxCrossEntropyWithLogits";
284 constexpr char RELU[] = "ReLU";
285 constexpr char REPEAT_ELEMENTS[] = "RepeatElements";
286 constexpr char TENSOR_DOT[] = "TensorDot";
287 constexpr char RANGE[] = "Range";
288 constexpr char ONEHOT[] = "OneHot";
289 constexpr char DROPOUT_DO_MASK[] = "DropoutDoMask";
290 constexpr char DROPOUT_GEN_MASK[] = "DropoutGenMask";
291 constexpr char TILE[] = "Tile";
292 constexpr char REDUCE_MAX[] = "ReduceMax";
293 constexpr char REDUCE_MIN[] = "ReduceMin";
294 constexpr char REDUCE_SUM[] = "ReduceSum";
295 constexpr char REDUCE_MEAN[] = "ReduceMean";
296 constexpr char ARGMAXWITHVALUE[] = "ArgMaxWithValue";
297 constexpr char ARGMINWITHVALUE[] = "ArgMinWithValue";
298 constexpr char CONV2D[] = "Conv2D";
299 constexpr char CONV2D_BACK_PROP_INPUT[] = "Conv2DBackpropInput";
300 constexpr char CONV2D_TRANSPOSE[] = "Conv2DTranspose";
301 constexpr char CONV2D_INFO[] = "Conv2DInfo";
302 constexpr char CONV2D_BACK_PROP_INPUT_INFO[] = "Conv2DBackpropInputInfo";
303 constexpr char CONV2D_TRANSPOSE_INFO[] = "Conv2DTransposeInfo";
304 constexpr char FUSE_BATCH_NORM[] = "FusedBatchNorm";
305 constexpr char FUSE_BATCH_NORM_EX[] = "FusedBatchNormEx";
306 constexpr char BATCH_NORM[] = "BatchNorm";
307 constexpr char SYNC_BATCH_NORM[] = "SyncBatchNorm";
308 constexpr char LAYER_NORM[] = "LayerNorm";
309 constexpr char POOLING[] = "Pooling";
310 constexpr char CAST[] = "Cast";
311 constexpr char MAX_POOL_WITH_ARGMAX[] = "MaxPoolWithArgmax";
312 constexpr char SIMPLE_MEAN[] = "SimpleMean";
313 constexpr char FLATTEN[] = "Flatten";
314 constexpr char J[] = "J";
315 constexpr char TMPIDENTITY_INFO_NAME[] = "identity_info";
316 constexpr char COS[] = "Cos";
317 constexpr char ACOS[] = "ACos";
318 constexpr char EXP[] = "Exp";
319 constexpr char LOG[] = "Log";
320 constexpr char SIGMOID[] = "Sigmoid";
321 constexpr char POW[] = "Pow";
322 constexpr char MAXIMUM[] = "Maximum";
323 constexpr char MINIMUM[] = "Minimum";
324 constexpr char EQUAL[] = "Equal";
325 constexpr char NOT_EQUAL[] = "NotEqual";
326 constexpr char LOGICALNOT[] = "LogicalNot";
327 constexpr char GATHERV2[] = "Gather";
328 constexpr char SPARSE_GATHERV2[] = "SparseGatherV2";
329 constexpr char STRIDEDSLICE[] = "StridedSlice";
330 constexpr char SLICE[] = "Slice";
331 constexpr char UNIFORM_REAL[] = "UniformReal";
332 constexpr char BROADCAST[] = "Broadcast";
333 constexpr char BROADCAST_TO[] = "BroadcastTo";
334 constexpr char SQRT[] = "Sqrt";
335 constexpr char ASSIGN[] = "Assign";
336 constexpr char GET_NEXT[] = "GetNext";
337 constexpr char MATMUL_DDS[] = "MatmulDDS";
338 constexpr char SQUEEZE[] = "Squeeze";
339 constexpr char NEG[] = "Neg";
340 constexpr char ABS[] = "Abs";
341 constexpr char ACOSH[] = "Acosh";
342 constexpr char ASIN[] = "Asin";
343 constexpr char ASINH[] = "Asinh";
344 constexpr char ATAN[] = "Atan";
345 constexpr char ATANH[] = "Atanh";
346 constexpr char CEIL[] = "Ceil";
347 constexpr char COSH[] = "Cosh";
348 constexpr char EXPM1[] = "Expm1";
349 constexpr char LOG1P[] = "Log1p";
350 constexpr char SIN[] = "Sin";
351 constexpr char SINH[] = "Sinh";
352 constexpr char TAN[] = "Tan";
353 constexpr char RSQRT[] = "Rsqrt";
354 constexpr char INV[] = "Inv";
355 constexpr char RECIPROCAL[] = "Reciprocal";
356 constexpr char ROUND[] = "Round";
357 constexpr char FLOOR[] = "Floor";
358 constexpr char SIGN[] = "Sign";
359 constexpr char ERF[] = "Erf";
360 constexpr char ERFC[] = "Erfc";
361 constexpr char ZEROSLIKE[] = "ZerosLike";
362 constexpr char ONESLIKE[] = "OnesLike";
363 constexpr char BESSELI0E[] = "BesselI0e";
364 constexpr char BESSELI1E[] = "BesselI1e";
365 constexpr char FLOORMOD[] = "FloorMod";
366 constexpr char ASSIGN_ADD[] = "AssignAdd";
367 constexpr char ATAN2[] = "Atan2";
368 constexpr char DIVNONAN[] = "DivNoNan";
369 constexpr char LOGICALAND[] = "LogicalAnd";
370 constexpr char LOGICALOR[] = "LogicalOr";
371 constexpr char ELU[] = "Elu";
372 constexpr char RELU6[] = "ReLU6";
373 constexpr char RELUV2[] = "ReLUV2";
374 constexpr char SOFTPLUS[] = "Softplus";
375 constexpr char SOFTSIGN[] = "Softsign";
376 constexpr char GREATEREQUAL[] = "GreaterEqual";
377 constexpr char LESSEQUAL[] = "LessEqual";
378 constexpr char LESS[] = "Less";
379 constexpr char APPROXIMATEEQUAL[] = "ApproximateEqual";
380 constexpr char MOD[] = "Mod";
381 constexpr char BATCH_MATMUL[] = "BatchMatMul";
382 constexpr char EXPAND_DIMS[] = "ExpandDims";
383 constexpr char SQUARE[] = "Square";
384 constexpr char BATCHMATMUL[] = "BatchMatMul";
385 constexpr char TOPK[] = "TopK";
386 constexpr char IN_TOPK[] = "InTopK";
387 constexpr char GATHER_ND[] = "GatherNd";
388 constexpr char UNSORTEF_SEGMENT_MIND[] = "UnsortedSegmentMinD";
389 constexpr char UNSORTEF_SEGMENT_PRODD[] = "UnsortedSegmentProdD";
390 constexpr char UNSORTED_SEGMENT_SUM[] = "UnsortedSegmentSum";
391 constexpr char UNSORTED_SEGMENT_MIN[] = "UnsortedSegmentMin";
392 constexpr char UNSORTED_SEGMENT_MAX[] = "UnsortedSegmentMax";
393 constexpr char DEPTHWISE_CONV2D_NATIVE[] = "DepthwiseConv2dNative";
394 constexpr char DEPTHWISE_CONV2D[] = "DepthwiseConv2D";
395 constexpr char DROPOUT[] = "Dropout";
396 constexpr char KStridedSlice[] = "StridedSlice";
397 constexpr char UNIQUE[] = "Unique";
398 constexpr char GATHERND[] = "GatherNd";
399 constexpr char SCATTER_UPDATE[] = "ScatterUpdate";
400 constexpr char GATHERD[] = "GatherD";
401 constexpr char DSD_MATMUL[] = "DSDMatmul";
402 constexpr char RESIZE_BILINEAR[] = "ResizeBilinear";
403 constexpr char RESIZE_NEAREST_NEIGHBOR[] = "ResizeNearestNeighbor";
404 
405 // pipeline
406 constexpr char MICRO[] = "micro";
407 constexpr char DEST_RANK[] = "dest_rank";
408 constexpr char SRC_RANK[] = "src_rank";
409 constexpr char PIPELINE_PARAM[] = "pipeline_param";
410 constexpr char PIPELINE_END[] = "pipeline_end";
411 constexpr char PIPELINE_BEGIN[] = "pipeline_begin";
412 constexpr char MAIN_GRAPH[] = "main_graph";
413 constexpr char SR_TAG[] = "sr_tag";
414 constexpr char NEED_GRAD[] = "need_grad";
415 constexpr char GROUP_BACK[] = "group_back";
416 constexpr char MIRROR_MICRO_STEP_OPERATOR[] = "_MirrorMicroStepOperator";
417 constexpr char PARAMETER_MICRO[] = "parameter_micro";
418 constexpr char VIRTUAL_ASSIGN_ADD[] = "_VirtualAssignAdd";
419 constexpr char VIRTUAL_ACCU_GRAD[] = "_VirtualAccuGrad";
420 constexpr char ACCU_GRAD[] = "accu_grad";
421 constexpr char PARAMETER_START[] = "parameter_start";
422 constexpr char PARAM_INDEX[] = "param_index";
423 constexpr char PARAMETER[] = "parameter";
424 
425 // Parallel don't care
426 constexpr char STRING_EQUAL[] = "string_equal";
427 constexpr char MAKE_TUPLE[] = "MakeTuple";
428 constexpr char MAKE_LIST[] = "make_list";
429 constexpr char MAKE_DICT[] = "make_dict";
430 constexpr char MAKE_SLICE[] = "make_slice";
431 constexpr char MAKE_RECORD[] = "make_record";
432 constexpr char LIST_GETITEM[] = "list_getitem";
433 constexpr char ARRAY_GETITEM[] = "array_getitem";
434 constexpr char TUPLE_SETITEM[] = "tuple_setitem";
435 constexpr char LIST_SETITEM[] = "list_setitem";
436 constexpr char ARRAY_SETITEM[] = "array_setitem";
437 constexpr char DICT_GETITEM[] = "dict_getitem";
438 constexpr char LIST_APPEND[] = "list_append";
439 constexpr char LIST_MAP[] = "list_map";
440 constexpr char LIST_REDUCE[] = "list_reduce";
441 constexpr char TUPLE_REVERSED[] = "tuple_reversed";
442 constexpr char TILE_SHAPE[] = "tile_shape";
443 constexpr char REDUCED_SHAPE[] = "reduced_shape";
444 constexpr char TUPLE_DIV[] = "tuple_div";
445 constexpr char TUPLE_TO_ARRAY[] = "tuple_to_array";
446 constexpr char VIRTUALLOSS[] = "VirtualLoss";
447 constexpr char RETURN[] = "Return";
448 constexpr char ENV_GETITEM[] = "env_getitem";
449 constexpr char IDENTITY[] = "identity";
450 constexpr char PARTIAL[] = "partial";
451 constexpr char ENVSETITEM[] = "env_setitem";
452 constexpr char ENVGETITEM[] = "env_getitem";
453 constexpr char ENVADD[] = "env_add";
454 constexpr char MAKEREFKEY[] = "MakeRefKey";
455 constexpr char MAKEREF[] = "make_ref";
456 constexpr char GETREFKEY[] = "get_ref_key";
457 constexpr char GETREFVALUE[] = "get_ref_value";
458 constexpr char GETREFORIGIN[] = "get_ref_origin";
459 constexpr char STATESETITEM[] = "state_setitem";
460 constexpr char SCALARSUMMARY[] = "ScalarSummary";
461 constexpr char IMAGESUMMARY[] = "ImageSummary";
462 constexpr char TENSORSUMMARY[] = "TensorSummary";
463 constexpr char HISTOGRAMSUMMARY[] = "HistogramSummary";
464 constexpr char DEBUG[] = "Debug";
465 constexpr char BROADCASTGRADIENTARGS[] = "BroadcastGradientArgs";
466 constexpr char INVERTPERMUTATION[] = "InvertPermutation";
467 constexpr char DOT[] = "dot";
468 constexpr char IM2COL[] = "im2col";
469 constexpr char COL2IM[] = "col2im";
470 constexpr char IM2COLV1[] = "im2col_v1";
471 constexpr char COL2IMV1[] = "col2im_v1";
472 constexpr char RESOLVE[] = "resolve";
473 constexpr char EMBED[] = "embed";
474 constexpr char CREATINSTANCE[] = "create_instance";
475 constexpr char REF_TO_EMBED[] = "RefToEmbed";
476 constexpr char STOP_GRADIENT[] = "stop_gradient";
477 constexpr char UPDATESTATE[] = "UpdateState";
478 constexpr char LOAD[] = "Load";
479 
480 // Batch parallel black list
481 constexpr char TENSOR_SCATTER_UPDATE[] = "TensorScatterUpdate";
482 constexpr char MIN_MAX_UPDATE_PER_LAYER[] = "MinMaxUpdatePerLayer";
483 constexpr char STACK[] = "Stack";
484 
LAST_INDEX(size_t s)485 constexpr size_t LAST_INDEX(size_t s) { return s - 1; }
SECOND_FROM_END(size_t s)486 constexpr size_t SECOND_FROM_END(size_t s) { return s - 2; }
THIRD_FROM_END(size_t s)487 constexpr size_t THIRD_FROM_END(size_t s) { return s - 3; }
488 }  // namespace parallel
489 }  // namespace mindspore
490 
491 #endif  // MINDSPORE_CCSRC_FRONTEND_PARALLEL_OPS_INFO_OPS_UTILS_H_
492