Repository navigation
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #425 +/- ##
=========================================
Coverage ? 58.37%
=========================================
Files ? 70
Lines ? 8868
Branches ? 0
=========================================
Hits ? 5177
Misses ? 3691
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Thanks for the detailed PR. I checked master and no caller passes |
|
Thanks. I traced the current callers and your distinction is correct: value normalization slices The 40 cases here exercise the public masked normalizer API directly; they do not establish an in-repository training regression or a measured training impact. I also have no GPU profiling result that would justify dismissing the dynamic boolean-indexing/synchronization cost you identified. This therefore remains an API correctness case pending a concrete consumer and workload evidence. I will keep it separate from #379's actively used pooled-moment path and defer further changes until that evidence supports the extra masked-normalizer implementation. |
Problem
The masked
RunningMeanStdupdate delegates to a pooled scalar-moment helper, although the unmasked normalizer tracks separate feature/channel statistics. It also adds the full input batch length to its count, including masked-out rows. Depending on shape, row masks either broadcast incorrectly or produce pooled statistics; excluded NaN padding can also poison persistent state through multiplication by zero.Changes
Select valid rows before computing moments, use the normalizer's existing reduction axes and population-variance convention, and increment the running count by the number of selected rows. An empty masked selection leaves the prior unchanged. Both one-dimensional and column row masks are supported.
The 40 regression cases compare each update against feeding the actual valid rows to an unmasked normalizer. They cover feature and per-channel layouts, Boolean/float masks, eager/TorchScript execution, repeated updates, zero/one valid rows, NaN padding, normalization/denormalization, and state-dictionary restoration.
Validation
On Python 3.11 and 3.14, the full suite changes from 40 failed, 413 passed, 16 skipped to 453 passed, 16 skipped. All six existing CI jobs pass, including lock, lint, and Python 3.11–3.14 tests.
Related: #379 addresses pooled masked moments and #399 handles physically empty input batches. This change corrects featurewise statistics and sample counts for nonempty masked normalization calls.