Usage Constraints During Operator Parallel

View Source On Gitee

API name

constraints

Config layout constraints

mindspore.ops.Abs

None

Not support config layout

mindspore.ops.ACos

None

Not support config layout

mindspore.ops.Acosh

None

Not support config layout

mindspore.ops.Add

None

Layout configuration is supported. The input layout should be the same or broadcastable. The output layout cannot be configured.

mindspore.ops.AddN

None

Not support config layout

mindspore.ops.ApproximateEqual

None

Not support config layout

mindspore.ops.ArgMaxWithValue

When the input_x is splited on the axis dimension, the distributed result may be inconsistent with that on the single machine.

Not support config layout

mindspore.ops.ArgMinWithValue

When the input_x is splited on the axis dimension, the distributed result may be inconsistent with that on the single machine.

Not support config layout

mindspore.ops.Asin

None

Not support config layout

mindspore.ops.Asinh

None

Not support config layout

mindspore.ops.Assign

None

Not support config layout

mindspore.ops.AssignAdd

None

Not support config layout

mindspore.ops.AssignSub

None

Not support config layout

mindspore.ops.Atan

None

Not support config layout

mindspore.ops.Atan2

None

Not support config layout

mindspore.ops.Atanh

None

Not support config layout

mindspore.ops.AvgPool

1. The data format only supports 'NCHW';
2. The shapes of output H/W dimension must be divisible by the split strategies of input H/W dimension;
3. If H/W is split:
1) If the kernel_size <= stride, the input slice size must be divisible by stride;
2) It does not support kernel_size > stride;
4. In auto_parallel mode, the dual recursive algorithm is not supported.

Not support config layout

mindspore.ops.AvgPool3D

1. The data format only supports 'NCDHW';
2. If data exchange between adjacent nodes is involved, only Ascend is supported;
3. The W dimensions can not be split;
4. The output shape of D/H dimension must be divisible by the strategy of input D/H dimensions;
5. In valid mode: If D/H dimension is split:
1) When the kernel_size <= stride, the input‘s slice shape of D/H dimension must be divisible by stride;
2) It does not support that kernel_size > stride;
6. In the same/pad mode: If D/H dimension is split:
1) If kernel_size >= stride, (Total input length including pad - kernel_size) must be divisible by stride. Otherwise, the pad must be 0 and the slice shape of D/H dimension must be divisible by stride;
2) (Output length* stride - input length) must be divisible by strategy:
3) The length of data sent and received between adjacent cards must be greater than or equal to 0 and less than or equal to the slice size;
7. In auto_parallel mode, the dual recursive algorithm is not supported.

Not support config layout

mindspore.ops.BatchMatMul

Not support config layout

None

Not support config layout

mindspore.ops.BatchNorm

It does not support GPU.

Not support config layout

mindspore.ops.BesselI0e

None

Not support config layout

mindspore.ops.BesselI1e

None

Not support config layout

mindspore.ops.BiasAdd

None

Support config layout. The second input, bias, should have ths same tensor layout as the last dimension of input_x. Output Layout is not open for configuration.

mindspore.ops.BitwiseAnd

None

Not support config layout

mindspore.ops.BitwiseOr

None

Not support config layout

mindspore.ops.BitwiseXor

None

Not support config layout

mindspore.ops.BoundingBoxEncode

1. The first dimension of input (anchor_box) and input (groundtruth_box) can be split;
2. The sharding strategies of input (anchor_box) and input (groundtruth_box) must be the same.

Not support config layout

mindspore.ops.BroadcastTo

None

Not support config layout

mindspore.ops.Cast

The shard strategy is ignored in the Auto Parallel and Semi Auto Parallel mode.

Not support config layout

mindspore.ops.Cdist

1. The strategy for 'B' dimension must be the same;
2.M dimension can't be split.

Not support config layout

mindspore.ops.Ceil

None

Not support config layout

mindspore.ops.Concat

The input_x can't be split into the dimension of axis, otherwise it's inconsistent with the single machine in the mathematical logic.

Not support config layout

mindspore.ops.Conv2D

1. The data format only supports 'NCHW';
2. If data exchange between adjacent nodes is involved, only Ascend is supported;
3. When the value of group is not 1, can not split C-in or C-out;
4. The last two dimensions of weight can not be split;
5. The output shape of H/W dimension must be divisible by the strategy of input H/W dimensions;
6. In valid mode: If H/W dimension is split:
1) When the kernel_size <= stride (kernel_size is dilation (kernel_size - 1) + 1, the same below), the input‘s slice shape of H/W dimension must be divisible by stride;
2) It does not support that kernel_size > stride;
7. In the same/pad mode: If H/W dimension is split:
1) If kernel_size >= stride, (Total input length including pad - kernel_size) must be divisible by stride. Otherwise, the pad must be 0 and the slice shape of H/W dimension must be divisible by stride;
2) (Output length
stride - input length) must be divisible by strategy:
3) The length of data sent and received between adjacent cards must be greater than or equal to 0 and less than or equal to the slice size;

Not support config layout

mindspore.ops.Conv3D

1. The data format only supports 'NCDHW';
2. If data exchange between adjacent nodes is involved, only Ascend is supported;
3. When the value of group is not 1, can not split C-in or C-out;
4. The W dimension and the last three dimensions of weight can not be split;
5. The output shape of D/H dimension must be divisible by the strategy of input D/H dimensions;
6. In valid mode: If D/H dimension is split:
1) When the kernel_size <= stride (kernel_size is dilation (kernel_size - 1) + 1, the same below), the input‘s slice shape of D/H dimension must be divisible by stride;
2) It does not support that kernel_size > stride;
7. In the same/pad mode: If D/H dimension is split:
1) If kernel_size >= stride, (Total input length including pad - kernel_size) must be divisible by stride. Otherwise, the pad must be 0 and the slice shape of D/H dimension must be divisible by stride;
2) (Output length
stride - input length) must be divisible by strategy:
3) The length of data sent and received between adjacent cards must be greater than or equal to 0 and less than or equal to the slice size;
8. In auto_parallel mode, the dual recursive algorithm is not supported.

Not support config layout

mindspore.ops.Cos

None

Not support config layout

mindspore.ops.Cosh

None

Not support config layout

mindspore.ops.CropAndResize

1. Sharding of the H/W dimension of input (x) and the second dimension of input (boxes) is not supported.
2. The shard strategy for the first dimension of inputs (boxes) and (box_index) must be the same.

Not support config layout

mindspore.ops.CumProd

The axis dimension for input can't be split.

Not support config layout

mindspore.ops.CumSum

The same as CumProd.

Not support config layout

mindspore.ops.Div

None

Layout configuration is supported. The input layout should be the same or broadcastable. The output layout cannot be configured.

mindspore.ops.DivNoNan

None

Not support config layout

mindspore.ops.Dropout

None

Not support config layout

mindspore.ops.Elu

None

Not support config layout

mindspore.ops.EmbeddingLookup

The same as Gather.

Not support config layout

mindspore.ops.Equal

None

Not support config layout

mindspore.ops.Erf

None

Not support config layout

mindspore.ops.Erfc

None

Not support config layout

mindspore.ops.Erfinv

None

Not support config layout

mindspore.ops.Exp

None

Not support config layout

mindspore.ops.ExpandDims

None

Not support config layout

mindspore.ops.Expm1

None

Not support config layout

mindspore.ops.Floor

None

Not support config layout

mindspore.ops.FloorDiv

None

Not support config layout

mindspore.ops.FloorMod

None

Not support config layout

mindspore.ops.Gamma

1. Set the strategy for shape. e.g shape=(8, 16), the corresponding policy can be (2, 4);
2. The strategy for alpha and beta must be all-1;
3. When the setting for shard is not all-1 strategy, the result is inconsistent with standalone.

Not support config layout

mindspore.ops.Gather

1. When batch_dims > 0:
1) The axis dimension of input_params can not be split;
2) Non-uniform split is not supported;
2. When batch_dims = 0:
1) If uniform split:
a) and if the axis dimensions of input_params is not split, other dimensions can be split;
b) If the axis dimensions of input_params is split: The input_params only supports 1 and 2 dimensions; The input_indices can not be scalar tensor; Does not support to split input_params and input_indices at the same time; When axis = 0 and the parameter is split in the dimension of axis, the output strategy can be configured. The legal output shard strategy is (indices_strategy, param_strategy[1:]) or ((indices_strategy[0]*param_strategy[0], indices_strategy[1:]), param_strategy[1:])
2) Non-uniform split:
a) Only support axis = 0;
b) The non-uniform split only represents the non-uniformity of the 0th dimension of input_params, and the last dimension of the params slice should be aligned by 32 bytes;
c) The number of slices in the 0th dimension of input_params should be equal to that of the last dimension of input_indices;
d) Each dimension of input_params can be split, but input_indices can only split the last dimension, and does not support repeated calculations;
e) Input_indices shall meet the following requirements: the Tensor value of the next slice shall be greater than that of the previous slice.

Not support config layout

mindspore.ops.GatherD

The dimension corresponding to dim cannot be segmented; In auto_parallel mode, the dual recursive algorithm is not supported.

Not support config layout

mindspore.ops.GatherNd

The first input can't be split, and the last dimension of the second input can't be split; In auto_parallel mode, the dual recursive algorithm is not supported.

Not support config layout

mindspore.ops.GeLU

None

Support config input layout. Output Layout is not open for configuration.

mindspore.ops.Greater

None

Not support config layout

mindspore.ops.GreaterEqual

None

Not support config layout

mindspore.ops.HShrink

None

Not support config layout

mindspore.ops.HSigmoid

None

Not support config layout

mindspore.ops.InplaceAdd

The first dimension of x and input_v can't be split.

Not support config layout

mindspore.ops.InplaceSub

The same as InplaceAdd.

Not support config layout

mindspore.ops.InplaceUpdate

The same as InplaceAdd.

Not support config layout

mindspore.ops.Inv

None

Not support config layout

mindspore.ops.IOU

The first dimension of the anchor_boxes and gt_boxes can be spilt.

Not support config layout

mindspore.ops.IsFinite

None

Not support config layout

mindspore.ops.KLDivLoss

None

Not support config layout

mindspore.ops.LayerNorm

The strategy for the second input gamma and the third input beta needs to be equal to the input_x_strategy[begin_params.axis:], input_x_strategy is the strategy for the first input.

Support config layout. The layout configuration for the second input gamma and the third input beta needs to be equal to the input_x_layout_tuple[begin_params.axis:], input_x_layout_tuple is the layout configuration for the first input.

mindspore.ops.L2Loss

None

Not support config layout

mindspore.ops.L2Normalize

The input_x can't be split into the dimension of axis, otherwise it's inconsistent with the single machine in the mathematical logic.

Not support config layout

mindspore.ops.Lerp

None

Not support config layout

mindspore.ops.Less

None

Not support config layout

mindspore.ops.LessEqual

None

Not support config layout

mindspore.ops.LinSpace

You don't need to configure strategy for start and end. You just need to pass in a strategy of length 1 whose value divisible into num.

Not support config layout

mindspore.ops.LogicalAnd

None

Not support config layout

mindspore.ops.LogicalNot

None

Not support config layout

mindspore.ops.LogicalOr

None

Not support config layout

mindspore.ops.Log

None

Not support config layout

mindspore.ops.Log1p

None

Not support config layout

mindspore.ops.LogSoftmax

The logits can't be split into the dimension of axis, otherwise it's inconsistent with the single machine in the mathematical logic.

Not support config layout

mindspore.ops.MaskedFill

None

Not support config layout

mindspore.ops.MatMul

1. When transpose_b=True is set, the input's split strategy must be in the form of ((A, B), (C, B));
2. When transpose_b=False is set, the input's split strategy must be in the form of ((A, B), (B, C));
3. It is supported to set the output's split strategy, the legal output's split strategy is ((A, C),) or ((A * B, C),)

Support config layout.
1. When transpose_b=True is set, the input's layout configuration must be in the form of (layout(A, B), layout(C, B)), A/B/C is the alias name of device axis or the alias name tuple;
2. When transpose_b=False is set, the input's layout configuration must be in the form of (layout(A, B), layout(B, C)), A/B/C is the alias name of device axis or the alias name tuple;
3. It is supported to config the output's layout, the legal output's layout configuration is (layout(A, C),) or (layout((A, B), C),), A/B/C is the alias name of device axis; When A is tuple of alias name (A1, A2), the legal output's layout configuration is (layout((A1, A2), C),) or (layout((A1, A2, B), C),)

mindspore.ops.Maximum

None

Not support config layout

mindspore.ops.MaxPool

1. The data format only supports 'NCHW';
2. The shapes of output H/W dimension must be divisible by the split strategies of input H/W dimension;
3. If H/W is split:
1) If the kernel_size <= stride, the input slice size must be divisible by stride;
2) It does not support kernel_size > stride;
4. In auto_parallel mode, the dual recursive algorithm is not supported.

Not support config layout

mindspore.ops.MaxPool3D

The same as AvgPool3D.

Not support config layout

mindspore.ops.Minimum

None

Not support config layout

mindspore.ops.Mish

None

Not support config layout

mindspore.ops.Mod

None

Not support config layout

mindspore.ops.Mul

None

Layout configuration is supported. The input layout should be the same or broadcastable. The output layout cannot be configured.

mindspore.ops.MulNoNan

None

Not support config layout

mindspore.ops.Neg

None

Not support config layout

mindspore.ops.NotEqual

None

Not support config layout

mindspore.ops.OneHot

Only support 1-dim indices. Must configure strategy for the output and the first and second inputs.

Not support config layout

mindspore.ops.OnesLike

None

Not support config layout

mindspore.ops.Pow

None

Not support config layout

mindspore.ops.PReLU

When the shape of weight is not [1], the shard strategy in channel dimension of input_x should be consistent with weight.

Not support config layout

mindspore.ops.RandomChoiceWithMask

Only the all-1 strategy is supported.

Not support config layout

mindspore.ops.RealDiv

None

Not support config layout

mindspore.ops.Reciprocal

None

Not support config layout

mindspore.ops.ReduceMax

When the input_x is splited on the axis dimension, the distributed result may be inconsistent with that on the single machine.

Not support config layout

mindspore.ops.ReduceMin

When the input_x is splited on the axis dimension, the distributed result may be inconsistent with that on the single machine.

Not support config layout

mindspore.ops.ReduceSum

None

Not support config layout

mindspore.ops.ReduceMean

None

Not support config layout

mindspore.ops.ReLU

None

Support config input layout. Output layout is not open for configuration.

mindspore.ops.ReLU6

None

Not support config layout

mindspore.ops.Reshape

Configuring sharding strategy is not supported. In auto parallel mode, if multiple operators are followed by the reshape operator, different shard strategys are not allowed to be configured for these operators.

Not support config layout

mindspore.ops.Rint

None

Not support config layout

mindspore.ops.ResizeNearestNeighbor

When align_corners=True is set, only the first dimension and the second dimension can be split.

Not support config layout

mindspore.ops.ROIAlign

Sharding the H/W dimension of the input(features) and the second dimension of input(rois) is not supported.

Not support config layout

mindspore.ops.Round

None

Not support config layout

mindspore.ops.Rsqrt

None

Not support config layout

mindspore.ops.ScatterAdd

The second input cannot be split, and the top n dimensions of the third input (n is the dimension of the second input) cannot be split; In auto_parallel mode, the dual recursive algorithm is not supported.

Not support config layout

mindspore.ops.ScatterDiv

The second input cannot be split, and the top n dimensions of the third input (n is the dimension of the second input) cannot be split; In auto_parallel mode, the dual recursive algorithm is not supported.

Not support config layout

mindspore.ops.ScatterMax

The first dimension of the first input cannot be split, the second input cannot be split, and the top n dimensions of the third input (n is the dimension of the second input) cannot be split; In auto_parallel mode, the dual recursive algorithm is not supported.

Not support config layout

mindspore.ops.ScatterMin

The first dimension of the first input cannot be split, the second input cannot be split, and the top n dimensions of the third input (n is the dimension of the second input) cannot be split; In auto_parallel mode, the dual recursive algorithm is not supported.

Not support config layout

mindspore.ops.ScatterMul

The second input cannot be split, and the top n dimensions of the third input (n is the dimension of the second input) cannot be split; In auto_parallel mode, the dual recursive algorithm is not supported.

Not support config layout

mindspore.ops.ScatterNdAdd

The second input cannot be split, the top n-1 dimension of the third input (n is the dimension of the second input) cannot be split, and the remaining k dimensions (excluding the top n-1 dimension) of the third input are consistent with the last k partitions of the first input; In auto_parallel mode, the dual recursive algorithm is not supported.

Not support config layout

mindspore.ops.ScatterNdSub

The second input cannot be split, the top n-1 dimension of the third input (n is the dimension of the second input) cannot be split, and the remaining k dimensions (excluding the top n-1 dimension) of the third input are consistent with the last k partitions of the first input; In auto_parallel mode, the dual recursive algorithm is not supported.

Not support config layout

mindspore.ops.ScatterNdUpdate

The top m dimension of the first input cannot be cut (m is the value of the last dimension of the second input indexes [- 1]). The second input cannot be split. The top n-1 dimension of the third input (n is the dimension of the second input) cannot be split. The partitions of the remaining k dimensions (excluding the top n-1 dimension) of the third input is consistent with the last k partitions of the first input; In auto_parallel mode, the dual recursive algorithm is not supported.

Not support config layout

mindspore.ops.ScatterSub

The second input cannot be split, and the top n dimensions of the third input (n is the dimension of the second input) cannot be split; In auto_parallel mode, the dual recursive algorithm is not supported.

Not support config layout

mindspore.ops.ScatterUpdate

The first dimension of first input can not be split, the second input can not be split, and the first n dimensions (n is the dimension size of the second input) of the third input can not be split; In auto_parallel mode, the dual recursive algorithm is not supported.

Not support config layout

mindspore.ops.TensorScatterAdd

The second input cannot be split, the top n-1 dimension of the third input (n is the dimension of the second input) cannot be split, and the remaining k dimensions (excluding the top n-1 dimension) of the third input are consistent with the last k partitions of the first input; In auto_parallel mode, the dual recursive algorithm is not supported.

Not support config layout

mindspore.ops.TensorScatterDiv

The second input cannot be split, the top n-1 dimension of the third input (n is the dimension of the second input) cannot be split, and the remaining k dimensions (excluding the top n-1 dimension) of the third input are consistent with the last k partitions of the first input; In auto_parallel mode, the dual recursive algorithm is not supported.

Not support config layout

mindspore.ops.TensorScatterMax

The top m dimension of the first input cannot be cut (m is the value of the last dimension of the second input indexes [- 1]). The second input cannot be split. The top n-1 dimension of the third input (n is the dimension of the second input) cannot be split. The partitions of the remaining k dimensions (excluding the top n-1 dimension) of the third input is consistent with the last k partitions of the first input; In auto_parallel mode, the dual recursive algorithm is not supported.

Not support config layout

mindspore.ops.TensorScatterMax

The top m dimension of the first input cannot be cut (m is the value of the last dimension of the second input indexes [- 1]). The second input cannot be split. The top n-1 dimension of the third input (n is the dimension of the second input) cannot be split. The partitions of the remaining k dimensions (excluding the top n-1 dimension) of the third input is consistent with the last k partitions of the first input; In auto_parallel mode, the dual recursive algorithm is not supported.

Not support config layout

mindspore.ops.TensorScatterMul

The second input cannot be split, the top n-1 dimension of the third input (n is the dimension of the second input) cannot be split, and the remaining k dimensions (excluding the top n-1 dimension) of the third input are consistent with the last k partitions of the first input; In auto_parallel mode, the dual recursive algorithm is not supported.

Not support config layout

mindspore.ops.TensorScatterAdd

The second input cannot be split, the top n-1 dimension of the third input (n is the dimension of the second input) cannot be split, and the remaining k dimensions (excluding the top n-1 dimension) of the third input are consistent with the last k partitions of the first input; In auto_parallel mode, the dual recursive algorithm is not supported.

Not support config layout

mindspore.ops.TensorScatterUpdate

The top m dimension of the first input cannot be cut (m is the value of the last dimension of the second input indexes [- 1]). The second input cannot be split. The top n-1 dimension of the third input (n is the dimension of the second input) cannot be split. The partitions of the remaining k dimensions (excluding the top n-1 dimension) of the third input is consistent with the last k partitions of the first input; In auto_parallel mode, the dual recursive algorithm is not supported.

Not support config layout

mindspore.ops.Select

In auto_parallel mode, the dual recursive algorithm is not supported.

Not support config layout

mindspore.ops.SeLU

None

Not support config layout

mindspore.ops.Sigmoid

None

Support config input layout. Output layout is not open for configuration.

mindspore.ops.SigmoidCrossEntropyWithLogits

None

Not support config layout

mindspore.ops.Sign

None

Not support config layout

mindspore.ops.Sin

None

Not support config layout

mindspore.ops.Sinh

None

Not support config layout

mindspore.ops.Softmax

The logits can't be split into the dimension of axis, otherwise it's inconsistent with the single machine in the mathematical logic.

Support config input layout. Output layout is not open for configuration, and can't config layout on the dimension of axis.

mindspore.ops.SoftmaxCrossEntropyWithLogits

The last dimension of logits and labels can't be splited; Only supports using output[0].

Not support config layout

mindspore.ops.Softplus

None

Not support config layout

mindspore.ops.Softsign

None

Not support config layout

mindspore.ops.SoftShrink

None

Not support config layout

mindspore.ops.SparseGatherV2

The same as Gather.

Not support config layout

mindspore.ops.Split

The input_x can't be split into the dimension of axis, otherwise it's inconsistent with the single machine in the mathematical logic.

Not support config layout

mindspore.ops.Sqrt

None

Not support config layout

mindspore.ops.Square

None

Not support config layout

mindspore.ops.SquaredDifference

None

Not support config layout

mindspore.ops.Squeeze

None

Not support config layout

mindspore.ops.Stack

None

Not support config layout

mindspore.ops.StridedSlice

Only support mask with all 0 values; The dimension needs to be split should be all extracted; Split is supported when the strides of dimension is 1.

Not support config layout

mindspore.ops.Slice

The dimension needs to be split should be all extracted.

Not support config layout

mindspore.ops.Sub

None

Layout configuration is supported. The input layout should be the same or broadcastable. The output layout cannot be configured.

mindspore.ops.Tan

None

Not support config layout

mindspore.ops.Tanh

None

Not support config layout

mindspore.ops.Tile

Only support configuring shard strategy for multiples.

Not support config layout

mindspore.ops.TopK

The input_x can't be split into the last dimension, otherwise it's inconsistent with the single machine in the mathematical logic.

Not support config layout

mindspore.ops.Transpose

None

Support config layout, and both device matrix transpose and tensor map transpose are allowed.

mindspore.ops.TruncateDiv

None

Not support config layout

mindspore.ops.TruncateMod

None

Not support config layout

mindspore.ops.Unique

Only support the repeat calculate shard strategy (1,).

Not support config layout

mindspore.ops.UnsortedSegmentSum

The shard of input_x and segment_ids must be the same as the dimension of segment_ids.

Not support config layout

mindspore.ops.UnsortedSegmentMin

The shard of input_x and segment_ids must be the same as the dimension of segment_ids. Note that if the segment id i is missing, then the output[i] will be filled with the maximum of the input type. The user needs to mask the maximum value to avoid value overflow. The communication operation such as AllReudce will raise an Run Task Error due to overflow.

Not support config layout

mindspore.ops.UnsortedSegmentMax

The shard of input_x and segment_ids must be the same as the dimension of segment_ids. Note that if the segment id i is missing, then the output[i] will be filled with the minimum of the input type. The user needs to mask the minimum value to avoid value overflow. The communication operation such as AllReudce will raise an Run Task Error due to overflow.

Not support config layout

mindspore.ops.Xdivy

None

Not support config layout

mindspore.ops.Xlogy

None

Not support config layout

mindspore.ops.ZerosLike

None

Not support config layout

Repeated calculation means that the device is not fully used. For example, the cluster has 8 devices to run distributed training, the splitting strategy only cuts the input into 4 copies. In this case, double counting will occur.