Skip to content

Conversation

reunanen
Copy link
Contributor

@reunanen reunanen commented Sep 1, 2025

Problem: Calculating mean and variance in the CPU implementation of batch normalization is prone to losing some numerical precision (when the data is not zero mean, for example).

Solution: Use Welford's algorithm that is numerically more stable.

Note that the CUDA implementation should already be doing this (or something similar at least), so this change should make the CPU implementation better match the CUDA one.

…_normalize_conv` by computing variances using Welford's algorithm
@reunanen
Copy link
Contributor Author

reunanen commented Sep 1, 2025

Note that the CI error is addressed separately in PR #3112.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant