Skip to content

Fix test_lowrank_multivariate_normal_moments via larger sample#4419

Open
PatrykWilczewski wants to merge 4 commits into
intel:mainfrom
PatrykWilczewski:lowrank_test
Open

Fix test_lowrank_multivariate_normal_moments via larger sample#4419
PatrykWilczewski wants to merge 4 commits into
intel:mainfrom
PatrykWilczewski:lowrank_test

Conversation

@PatrykWilczewski

@PatrykWilczewski PatrykWilczewski commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

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

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
@github-actions github-actions Bot added disable_e2e Disable all e2e test jobs for the PR disable_distributed Disable distributed UT test jobs for the PR disable_build Disable source code build for CI test, use nightly wheel labels Jul 22, 2026

@kdrozd-dev kdrozd-dev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beside the comment length LGTM

Comment thread test/xpu/test_distributions_xpu.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

disable_build Disable source code build for CI test, use nightly wheel disable_distributed Disable distributed UT test jobs for the PR disable_e2e Disable all e2e test jobs for the PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test_distributions_xpu.py::TestDistributionsXPU::test_lowrank_multivariate_normal_moments_xpu AssertionError: Tensor-likes are not close!

5 participants