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

Skip to content

Commit 9defec7

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 8a0ffed commit 9defec7

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
@@ -2080,7 +2081,19 @@ def check_classifiers_train(
20802081
X_b -= X_b.min()
20812082

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

20852098
problems = [(X_b, y_b)]
20862099
tags = _safe_tags(classifier_orig)

0 commit comments

Comments
 (0)
0