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

Add smoke test for sklearnex #1143

Merged
merged 2 commits into from
Mar 29, 2022
Merged

Add smoke test for sklearnex #1143

merged 2 commits into from
Mar 29, 2022

Conversation

rosbo
Copy link
Contributor

@rosbo rosbo commented Mar 28, 2022

sklearnex was added in #1135

http:https://227237481

cc/ @napetrov

@rosbo
Copy link
Contributor Author

rosbo commented Mar 28, 2022

Confirmed the test do use the Intel extensions for scikit-learn:

test_dbscan (test_sklearnex.TestSklearnex) ... Intel(R) Extension for Scikit-learn* enabled (https://github.com/intel/scikit-learn-intelex)

@rosbo rosbo requested a review from Philmod March 28, 2022 21:55
@napetrov
Copy link
Contributor

@rosbo - thanks a lot, i thought that i've pushed tests as well.( Thanks for catching this!

Comment on lines 5 to 8
from sklearn.cluster import DBSCAN

class TestSklearnex(unittest.TestCase):
def test_dbscan(self):
from sklearnex import patch_sklearn
patch_sklearn()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
from sklearn.cluster import DBSCAN
class TestSklearnex(unittest.TestCase):
def test_dbscan(self):
from sklearnex import patch_sklearn
patch_sklearn()
class TestSklearnex(unittest.TestCase):
def test_dbscan(self):
from sklearnex.cluster import DBSCAN

I think that for package validation perspective - this would be the simplest way

There are 2 things related to patching:

  1. You have to reimport "from sklearn.cluster import" after patching. Because patching process wouldn't affect already existing instances.
  2. Patch would impact entire process - i'm not 100% sure how this would behave in case of the tests, but i'm afraid that it would have effect on following scikit calls, so unpatch would be required.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great suggestion. Applied. Thank you :)

sklearnex was added in #1135

http:https://227237481
@rosbo rosbo merged commit 98ca09f into main Mar 29, 2022
@rosbo rosbo deleted the add-sklearnex-test branch March 29, 2022 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants