[object Object]

[object Object][object Object]undefined
[object Object]
  • Description:

    Computes the gradient of the BatchNorm operation during backpropagation and performs reduction operations on some intermediate results to optimize the compute efficiency. The calculation result is as follows:

    • Computes the gradient lγ\frac{\partial l}{\partial γ} of the loss function l with respect to the scaling weight γ.
    • Computes the gradient lβ\frac{\partial l}{\partial β} of the loss function l with respect to the offset β.
    • Deduces the intermediate quantities sumDy and sumDyXmu required for computing lxi\frac{\partial l}{\partial x_i}, by using the deviation d[object Object]yi[object Object] of the loss function l with respect to the output y[object Object]i[object Object], where lxi\frac{\partial l}{\partial x_i} is the gradient of the loss function l with respect to the input x[object Object]i[object Object] of the corresponding layer.
  • Formula:

    gradWeight=lγ=i=0mlyi(xi)^=1σB2+epsi=0mlyi(xiμB)gradWeight = \frac{\partial l}{\partial γ} = \sum^m_{i=0} \frac{\partial l}{\partial y_i} \cdot \hat{(x_i)} = \frac{1}{{\sqrt{σ^2_B + eps}}} \cdot \sum^m_{i=0} \frac{\partial l} {\partial y_i} \cdot (x_i-μ_B) gradBias=lβ=i=0mlyigradBias = \frac{\partial l}{\partial β} = \sum^m_{i=0} \frac{\partial l}{\partial y_i} sumDy=sum(l,yi)=i=0mlyisumDy = sum(l, y_i) = \displaystyle \sum^m_{i=0} \frac{\partial l}{\partial y_i} sumDyXmu=sum(l,yi,xi,μB)=i=0mlyi(xiμB)sumDyXmu = sum(l, y_i, x_i, μ_B) = \displaystyle \sum^m_{i=0} \frac{\partial l}{\partial y_i} \cdot (x_i-μ_B)
[object Object]

Each operator has calls. First, aclnnBatchNormReduceBackwardGetWorkspaceSize is called to obtain the input parameters and compute the required workspace size based on the process. Then, aclnnBatchNormReduceBackward is called to perform computation.

[object Object]
[object Object]
[object Object]
  • Parameters

    [object Object]
    • [object Object]Atlas training products[object Object] and [object Object]Atlas inference products[object Object]: The data types of [object Object], [object Object], [object Object], [object Object], [object Object], [object Object], [object Object], [object Object], and [object Object] cannot be BFLOAT16.
  • Returns:

    [object Object]: status code. For details, see .

    The first-phase API implements input parameter verification. The following errors may be thrown.

    [object Object]
[object Object]
  • Parameters

    [object Object]
  • Returns:

    [object Object]: status code. For details, see .

[object Object]
  • If any input is an empty tensor, the output is an empty tensor.
  • Deterministic compute:
    • aclnnBatchNormReduceBackward defaults to a deterministic implementation.
[object Object]

The following example is for reference only. For details, see .

[object Object]