-
-
Notifications
You must be signed in to change notification settings - Fork 26.2k
TST fix platform sensitive test: [all random seeds] test_float_precision #32035
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Hum. assert_allclose(Xt[np.float32], Xt[np.float64], atol=Xt[np.float64].max() * rtol) fails for seed 33 on the ubuntu atlas build with:
This seems well above the expected floating point rounding errors... |
I cannot reproduce locally, so maybe it's BLAS-implementation specific. |
Let's skip this test on Atlas. |
@@ -794,6 +795,13 @@ def test_k_means_function(global_random_seed): | |||
ids=data_containers_ids, | |||
) | |||
@pytest.mark.parametrize("Estimator", [KMeans, MiniBatchKMeans]) | |||
@pytest.mark.skipif( | |||
not [i for i in threadpool_info() if i["user_api"] == "blas"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
more readable imo
not [i for i in threadpool_info() if i["user_api"] == "blas"], | |
not any(i for i in threadpool_info() if i["user_api"] == "blas"), |
@@ -822,10 +830,11 @@ def test_float_precision(Estimator, input_data, global_random_seed): | |||
|
|||
# compare arrays with low precision since the difference between 32 and | |||
# 64 bit comes from an accumulation of rounding errors. | |||
assert_allclose(inertia[np.float32], inertia[np.float64], rtol=1e-4) | |||
assert_allclose(Xt[np.float32], Xt[np.float64], atol=Xt[np.float64].max() * 1e-4) | |||
rtol = 2e-4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we still need the increased rtol then ?
Closes #27846.