Fix test_lowrank_multivariate_normal_moments via larger sample#4419
Open
PatrykWilczewski wants to merge 4 commits into
Open
Fix test_lowrank_multivariate_normal_moments via larger sample#4419PatrykWilczewski wants to merge 4 commits into
PatrykWilczewski wants to merge 4 commits into
Conversation
Problem: test_lowrank_multivariate_normal_moments fails with "Tensor-likes are not close!" Root cause: underpowered test - N=100 000, atol=0.01 -> worst 3-sigma spread ~0.0168 > 0.01; Fix: Override sample count 100 000 -> 500 000 Fixes: intel#4253
kdrozd-dev
requested changes
Jul 23, 2026
kdrozd-dev
approved these changes
Jul 23, 2026
DamJanusz
approved these changes
Jul 24, 2026
jmamzax
approved these changes
Jul 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem: test_lowrank_multivariate_normal_moments fails with "Tensor-likes are not close!"
Root cause: underpowered test - N=100 000, atol=0.01 -> worst 3-sigma spread ~0.0168 > 0.01;
The upstream test draws only 100 000 samples and checks the empirical mean against the analytic mean with atol=0.01, rtol=0. For this fixture the worst per-element variance is ~3.15, so the standard error of the empirical mean is sqrt(3.15 / 100 000) ~= 0.0056 and its 3-sigma spread ~= 0.0168 already exceeds the 0.01 tolerance. The test is therefore statistically underpowered; it only appeared to "pass" on XPU because the exact seed-0 draws happened to land under the threshold, until PR #3725 (std::log -> sycl::log in the Box-Muller transform) legitimately perturbed those draws.
Fix: Raise the sample count to 500 000 shrinks the 3-sigma mean spread to ~0.0075 (< 0.01) and the variance spread comfortably under 0.02, making the check robust across seeds without weakening the tolerance.
Fixes: #4253