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

Upgrade sklearnex #1378

Merged
merged 10 commits into from
Mar 5, 2022
Merged

Upgrade sklearnex #1378

merged 10 commits into from
Mar 5, 2022

Conversation

Innixma
Copy link
Contributor

@Innixma Innixma commented Nov 11, 2021

Issue #, if available:

Description of changes:

  • Upgrade sklearnex version
  • Added workaround to use sklearnex RF via setting oob_score=True
  • Refactor LinearRegression -> Add time_limit support, speedup inference by 10x, speedup training by 20x+
  • Enable sklearnex in LR -> 20x+ train speedup
  • Refactor OHE in LR -> 10x inf speedup
  • Refactor Preprocessing in LR -> 10x inf speedup
  • Fix boolean feature handling in LR

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@Innixma Innixma changed the title Upgrade sklearnex, default RF use_daal=True Upgrade sklearnex Nov 11, 2021
@szha
Copy link

szha commented Nov 11, 2021

Job PR-1378-1 is done.
Docs are uploaded to http://autogluon-staging.s3-website-us-west-2.amazonaws.com/PR-1378/1/index.html

@szha
Copy link

szha commented Nov 11, 2021

Job PR-1378-2 is done.
Docs are uploaded to http://autogluon-staging.s3-website-us-west-2.amazonaws.com/PR-1378/2/index.html

# FIXME: DAAL OOB score is broken, returns biased predictions. Without this optimization, can't compute Efficient OOF.
from daal4py.sklearn.ensemble import RandomForestClassifier, RandomForestRegressor
from sklearnex.ensemble import RandomForestClassifier, RandomForestRegressor
logger.log(15, '\tUsing daal4py RF backend...')

Choose a reason for hiding this comment

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

Suggested change
logger.log(15, '\tUsing daal4py RF backend...')
logger.log(15, '\tUsing sklernex RF backend...')

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good suggestion, I have updated this log for RF, KNN, and linear models.

@@ -35,9 +35,8 @@ def _get_model_type(self):
if self.params_aux.get('use_daal', False):
# Disabled by default because it appears to degrade performance
try:
# TODO: Use sklearnex instead once a suitable toggle option is provided that won't impact future models
# FIXME: DAAL OOB score is broken, returns biased predictions. Without this optimization, can't compute Efficient OOF.
Copy link

Choose a reason for hiding this comment

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

OOB score was fixed in scikit-learn-intelex=2021.5 version

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! This is very helpful. I added a new in-line comment to try the new version once it is released.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @agorshk , I tested 2021.5 and it is not yet fixed (train-time oob_score=True works, but not post-fit OOB).

Refer to uxlfoundation/scikit-learn-intelex#933 for more info

Copy link

Choose a reason for hiding this comment

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

Hi @agorshk , I tested 2021.5 and it is not yet fixed (train-time oob_score=True works, but not post-fit OOB).

Refer to intel/scikit-learn-intelex#933 for more info

Hi @Innixma, thanks for report and reproducer, we'll have a look on this problem.

@szha
Copy link

szha commented Nov 18, 2021

Job PR-1378-3 is done.
Docs are uploaded to http://autogluon-staging.s3-website-us-west-2.amazonaws.com/PR-1378/3/index.html

@szha
Copy link

szha commented Nov 22, 2021

Job PR-1378-4 is done.
Docs are uploaded to http://autogluon-staging.s3-website-us-west-2.amazonaws.com/PR-1378/4/index.html

@szha
Copy link

szha commented Dec 2, 2021

Job PR-1378-5 is done.
Docs are uploaded to http://autogluon-staging.s3-website-us-west-2.amazonaws.com/PR-1378/5/index.html

@szha
Copy link

szha commented Dec 16, 2021

Job PR-1378-6 is done.
Docs are uploaded to http://autogluon-staging.s3-website-us-west-2.amazonaws.com/PR-1378/6/index.html

@szha
Copy link

szha commented Dec 31, 2021

Job PR-1378-8 is done.
Docs are uploaded to http://autogluon-staging.s3-website-us-west-2.amazonaws.com/PR-1378/8/index.html

@Innixma Innixma added this to the 0.4 Release milestone Jan 13, 2022
@szha
Copy link

szha commented Mar 4, 2022

Job PR-1378-14 is done.
Docs are uploaded to http://autogluon-staging.s3-website-us-west-2.amazonaws.com/PR-1378/14/index.html

@szha
Copy link

szha commented Mar 4, 2022

Job PR-1378-15 is done.
Docs are uploaded to http://autogluon-staging.s3-website-us-west-2.amazonaws.com/PR-1378/15/index.html

@Innixma
Copy link
Contributor Author

Innixma commented Mar 4, 2022

Updates finalized

Note that RF does not yet use sklearnex by default due to a performance issue on KDDCup09-Upselling: uxlfoundation/scikit-learn-intelex#984

Copy link
Contributor

@yinweisu yinweisu left a comment

Choose a reason for hiding this comment

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

LGTM!

@szha
Copy link

szha commented Mar 4, 2022

Job PR-1378-16 is done.
Docs are uploaded to http://autogluon-staging.s3-website-us-west-2.amazonaws.com/PR-1378/16/index.html

@Innixma Innixma merged commit a7e7fa6 into master Mar 5, 2022
@Innixma Innixma deleted the rf_enable_daal branch March 10, 2022 02:01
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.

5 participants