From 976ffc14cca633306fdfbe004d32b573676a75a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Est=C3=A8ve?= Date: Fri, 13 Jan 2023 12:01:56 +0100 Subject: [PATCH 1/5] [azure parallel] More stringent test of no-OpenMP --- build_tools/azure/install.sh | 2 ++ sklearn/_isotonic.pyx | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/build_tools/azure/install.sh b/build_tools/azure/install.sh index 1c76a7a4aa5d3..81fef7e6b99a4 100755 --- a/build_tools/azure/install.sh +++ b/build_tools/azure/install.sh @@ -104,6 +104,8 @@ scikit_learn_install() { # Without openmp, we use the system clang. Here we use /usr/bin/ar # instead because llvm-ar errors export AR=/usr/bin/ar + # delete omp.h + find $CONDA_PREFIX -name omp.h -delete -print fi if [[ "$UNAMESTR" == "Linux" ]]; then diff --git a/sklearn/_isotonic.pyx b/sklearn/_isotonic.pyx index c3a6685eb8f90..6f2d5d76287c7 100644 --- a/sklearn/_isotonic.pyx +++ b/sklearn/_isotonic.pyx @@ -9,7 +9,7 @@ cimport numpy as cnp from cython cimport floating cnp.import_array() - +cimport openmp def _inplace_contiguous_isotonic_regression(floating[::1] y, floating[::1] w): cdef: From e9c23ccd2642ca7f1add005f122037c704b03e34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Est=C3=A8ve?= Date: Fri, 13 Jan 2023 13:48:38 +0100 Subject: [PATCH 2/5] [azure parallel] Remove cimport openmp and improve comment --- build_tools/azure/install.sh | 6 +++++- sklearn/_isotonic.pyx | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/build_tools/azure/install.sh b/build_tools/azure/install.sh index 81fef7e6b99a4..a7c43e6d0923b 100755 --- a/build_tools/azure/install.sh +++ b/build_tools/azure/install.sh @@ -104,7 +104,11 @@ scikit_learn_install() { # Without openmp, we use the system clang. Here we use /usr/bin/ar # instead because llvm-ar errors export AR=/usr/bin/ar - # delete omp.h + # Make sure omp.h is not present in the conda environment, so that + # using an unprotected "cimport openmp" will make this build fail. At + # the time of writing, on OSX, blas (mkl or openblas) brings in openmp + # so that you end up having the omp.h include inside the conda + # environment. find $CONDA_PREFIX -name omp.h -delete -print fi diff --git a/sklearn/_isotonic.pyx b/sklearn/_isotonic.pyx index 6f2d5d76287c7..fb23ec466dc4c 100644 --- a/sklearn/_isotonic.pyx +++ b/sklearn/_isotonic.pyx @@ -9,7 +9,6 @@ cimport numpy as cnp from cython cimport floating cnp.import_array() -cimport openmp def _inplace_contiguous_isotonic_regression(floating[::1] y, floating[::1] w): cdef: From 0bceb278571efd5599f5606d773038d1fe7a62ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Est=C3=A8ve?= Date: Fri, 13 Jan 2023 14:12:12 +0100 Subject: [PATCH 3/5] [azure parallel] Tweak comment --- build_tools/azure/install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build_tools/azure/install.sh b/build_tools/azure/install.sh index a7c43e6d0923b..c9cbe05f0d6d4 100755 --- a/build_tools/azure/install.sh +++ b/build_tools/azure/install.sh @@ -106,9 +106,9 @@ scikit_learn_install() { export AR=/usr/bin/ar # Make sure omp.h is not present in the conda environment, so that # using an unprotected "cimport openmp" will make this build fail. At - # the time of writing, on OSX, blas (mkl or openblas) brings in openmp - # so that you end up having the omp.h include inside the conda - # environment. + # the time of writing (2022-01-13), on OSX, blas (mkl or openblas) + # brings in openmp so that you end up having the omp.h include inside + # the conda environment. find $CONDA_PREFIX -name omp.h -delete -print fi From b3e1375208a1ae2b4b150e25f7a7f7ee696c2a76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Est=C3=A8ve?= Date: Fri, 13 Jan 2023 14:12:29 +0100 Subject: [PATCH 4/5] [azure parallel] Tweak comment --- build_tools/azure/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_tools/azure/install.sh b/build_tools/azure/install.sh index c9cbe05f0d6d4..3bbc4b07a6f57 100755 --- a/build_tools/azure/install.sh +++ b/build_tools/azure/install.sh @@ -106,7 +106,7 @@ scikit_learn_install() { export AR=/usr/bin/ar # Make sure omp.h is not present in the conda environment, so that # using an unprotected "cimport openmp" will make this build fail. At - # the time of writing (2022-01-13), on OSX, blas (mkl or openblas) + # the time of writing (2023-01-13), on OSX, blas (mkl or openblas) # brings in openmp so that you end up having the omp.h include inside # the conda environment. find $CONDA_PREFIX -name omp.h -delete -print From 247c609703202ff7c286cd45a5edbd12d53ba718 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20du=20Boisberranger?= <34657725+jeremiedbb@users.noreply.github.com> Date: Fri, 13 Jan 2023 14:59:26 +0100 Subject: [PATCH 5/5] Update sklearn/_isotonic.pyx --- sklearn/_isotonic.pyx | 1 + 1 file changed, 1 insertion(+) diff --git a/sklearn/_isotonic.pyx b/sklearn/_isotonic.pyx index fb23ec466dc4c..c3a6685eb8f90 100644 --- a/sklearn/_isotonic.pyx +++ b/sklearn/_isotonic.pyx @@ -10,6 +10,7 @@ from cython cimport floating cnp.import_array() + def _inplace_contiguous_isotonic_regression(floating[::1] y, floating[::1] w): cdef: Py_ssize_t n = y.shape[0], i, k