8000 TST use aligned data with unstable openblas configuration (#21702) · glemaitre/scikit-learn@b0b8ccf · GitHub
[go: up one dir, main page]

Skip to content

Commit b0b8ccf

Browse files
jjerphanadrinjalaliogrisel
authored andcommitted
TST use aligned data with unstable openblas configuration (scikit-learn#21702)
* TST XFAIL test when unstable openblas configuration * Adapt versions parsing Co-authored-By: Adrin Jalali <adrin.jalali@gmail.com> * DOC Prefer ifskip and reference scikit-learn#21361 Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org> * Fix Julien's scheduler incorrect dispatch * Simplify Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org> * Do not remove blank line * fixup! Do not remove blank line * Retrigger CI * Prudently assume Prescott might be the architecture if it is unknown Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org> Co-authored-by: Adrin Jalali <adrin.jalali@gmail.com> Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
1 parent 3f00277 commit b0b8ccf

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

sklearn/utils/estimator_checks.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
from ..model_selection import ShuffleSplit
5454
from ..model_selection._validation import _safe_split
5555
from ..metrics.pairwise import rbf_kernel, linear_kernel, pairwise_distances
56+
from ..utils.fixes import threadpool_info
5657
from ..utils.validation import check_is_fitted
5758

5859
from . import shuffle
@@ -2085,7 +2086,19 @@ def check_classifiers_train(
20852086
X_b -= X_b.min()
20862087

20872088
if readonly_memmap:
2088-
X_m, y_m, X_b, y_b = create_memmap_backed_data([X_m, y_m, X_b, y_b])
2089+
# OpenBLAS is known to segfault with unaligned data on the Prescott architecture
2090+
# See: https://github.com/scipy/scipy/issues/14886
2091+
has_prescott_openblas = any(
2092+
True
2093+
for info in threadpool_info()
2094+
if info["internal_api"] == "openblas"
2095+
# Prudently assume Prescott might be the architecture if it is unknown.
2096+
and info.get("architecture", "prescott").lower() == "prescott"
2097+
)
2098+
2099+
X_m, y_m, X_b, y_b = create_memmap_backed_data(
2100+
data=[X_m, y_m, X_b, y_b], aligned=has_prescott_openblas
2101+
)
20892102

20902103
problems = [(X_b, y_b)]
20912104
tags = _safe_tags(classifier_orig)

0 commit comments

Comments
 (0)
0