Description:
Collects the mean value and variance of data on all devices and updates the global mean value and the reciprocal of the standard deviation. The performance of BatchNorm is related to BatchSize. The larger the value of BatchSize is, the more accurate the statistics of BatchNorm will be. However, tasks such as detection occupy a large amount of Video RAM. A graphics card usually uses only a small number of images for training, for example, two images. As a result, the BatchNorm performance deteriorates. One solution is SyncBatchNorm, that is, all devices share the same BatchNorm to obtain the global statistics.
During aclnnBatchNormGatherStatsWithCounts computation, is used to compute the mean value and reciprocal of the standard deviation of a single device.
[object Object]Formula:
Where, the updated formulas for runningMean and runningVar are as follows:
Each operator has calls. First, aclnnBatchNormGatherStatsWithCountsGetWorkspaceSize is called to obtain the input parameters and compute the required workspace size based on the process. Then, aclnnBatchNormGatherStatsWithCounts is called to perform computation.
Parameters:
[object Object]- [object Object]Atlas training series products[object Object] and [object Object]Atlas inference series products[object Object]: The data types of
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object], and[object Object]cannot be BFLOAT16.
- [object Object]Atlas training series products[object Object] and [object Object]Atlas inference series products[object Object]: The data types of
Returns:
aclnnStatus: status code. For details, see .
The first-phase API implements input parameter verification. The following errors may be thrown.
[object Object]
- Deterministic compute:
- aclnnBatchNormGatherStatsWithCounts defaults to a deterministic implementation.
The following example is for reference only. For details, see .