Skip to content
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

[TESTING] Reproduce SVM segfaults on Windows in CI #2088

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions deselected_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,6 @@ deselected_tests:
# scikit-learn expects an exception for sparse matrices with 64-bit integer indices,
# scikit-learn-intelex works correctly with 64-bit integer indices
- tests/test_common.py::test_estimators[NuSVC()-check_estimator_sparse_data]
- tests/test_common.py::test_estimators[NuSVC()-check_estimator_sparse_array]
- tests/test_common.py::test_estimators[NuSVC()-check_estimator_sparse_matrix]
- utils/tests/test_estimator_checks.py::test_xfail_ignored_in_check_estimator

# SVC._dual_coef_ is changing after fitting, but the result of prediction is still the same
Expand Down
13 changes: 2 additions & 11 deletions sklearnex/svm/nusvc.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,8 @@ def __init__(
def fit(self, X, y, sample_weight=None):
if sklearn_check_version("1.2"):
self._validate_params()
elif self.nu <= 0 or self.nu > 1:
# else if added to correct issues with
# sklearn tests:
# svm/tests/test_sparse.py::test_error
# svm/tests/test_svm.py::test_bad_input
# for sklearn versions < 1.2 (i.e. without
# validate_params parameter checking)
# Without this, a segmentation fault with
# Windows fatal exception: access violation
# occurs
raise ValueError("nu <= 0 or nu > 1")
if sklearn_check_version("1.0"):
self._check_feature_names(X, reset=True)
dispatch(
self,
"fit",
Expand Down
13 changes: 2 additions & 11 deletions sklearnex/svm/nusvr.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,8 @@ def __init__(
def fit(self, X, y, sample_weight=None):
if sklearn_check_version("1.2"):
self._validate_params()
elif self.nu <= 0 or self.nu > 1:
# else if added to correct issues with
# sklearn tests:
# svm/tests/test_sparse.py::test_error
# svm/tests/test_svm.py::test_bad_input
# for sklearn versions < 1.2 (i.e. without
# validate_params parameter checking)
# Without this, a segmentation fault with
# Windows fatal exception: access violation
# occurs
raise ValueError("nu <= 0 or nu > 1")
if sklearn_check_version("1.0"):
self._check_feature_names(X, reset=True)
dispatch(
self,
"fit",
Expand Down
13 changes: 2 additions & 11 deletions sklearnex/svm/svc.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,8 @@ def __init__(
def fit(self, X, y, sample_weight=None):
if sklearn_check_version("1.2"):
self._validate_params()
elif self.C <= 0:
# else if added to correct issues with
# sklearn tests:
# svm/tests/test_sparse.py::test_error
# svm/tests/test_svm.py::test_bad_input
# for sklearn versions < 1.2 (i.e. without
# validate_params parameter checking)
# Without this, a segmentation fault with
# Windows fatal exception: access violation
# occurs
raise ValueError("C <= 0")
if sklearn_check_version("1.0"):
self._check_feature_names(X, reset=True)
dispatch(
self,
"fit",
Expand Down
13 changes: 2 additions & 11 deletions sklearnex/svm/svr.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,8 @@ def __init__(
def fit(self, X, y, sample_weight=None):
if sklearn_check_version("1.2"):
self._validate_params()
elif self.C <= 0:
# else if added to correct issues with
# sklearn tests:
# svm/tests/test_sparse.py::test_error
# svm/tests/test_svm.py::test_bad_input
# for sklearn versions < 1.2 (i.e. without
# validate_params parameter checking)
# Without this, a segmentation fault with
# Windows fatal exception: access violation
# occurs
raise ValueError("C <= 0")
if sklearn_check_version("1.0"):
self._check_feature_names(X, reset=True)
dispatch(
self,
"fit",
Expand Down
Loading