-
Notifications
You must be signed in to change notification settings - Fork 174
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
BUG: fixing circular import in daal4py/sklearnex device_offloading #1832
Conversation
/intelci: run |
/intelci: run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the case we drop in the daal4py oneapi interfaces, is this movement of device_offload to daal4py necessary? Couldn't we just delete the sklearnex import of various aspects in daal4py/sklearn/_device_offload.py and it would remove the circular import problem? If true, how far away are we from being able to do that. As far as I see, none of the imported estimators from daal4py in sklearnex outside of Ridge can offload to GPU via daal4py. Its a question over aspects of:
Ridge
Lasso
ElasticNet
PairwiseDistances
train_test_split
roc_auc_score
or am I missing something?
In general just some minor naming convention stuff. Would like the thoughts of other reviewers on that.
@icfaust Thank you for the review!
Some minor updates are required, but overall PR is ready |
If I understood the question correctly, and if you asking why we need daal4py sycl_context, so then actually Kmeans and other estimators from daal4py.sklearn that is used on sklearnex main branch does GPU offloading via sycl_context. so that is why we need to leave it as is. If anything requires drop I would like to do this reduction in the next steps. |
Dear reviewers, Which estimator with daal4py backend do we use for GPU offloading? correct me if nothing other than Kmeans. Kmeans is in the active phase of moving out preview #1770, which should happen in the near future, perhaps already before the next release. In that case, does it make sense to support daal4py for usm_ndarray interop at all? if not, then it makes sense to make changes in my PR and transfer the necessary things for device offloading to onedal4py backend and reuse it in sklearnex. After the discussion we will decide to integrate is as is, or update it for onedal4py backend only. |
Dear reviewers, I am returning this PR to development. |
updated onedal4py _device_offload module sklearnex _device_oflload depends on onedal4py only
…imators with daal4py backend
remove unnecessary docstrings assignments
/azp run CI |
Azure Pipelines successfully started running 1 pipeline(s). |
/intelci: run |
@ethanglaser @icfaust @Alexsandruss thank you for the review! |
No major objections from my side at this point, looking good, seems like the queue/device offload will functionally remain the same. One remaining question I have is what separates functionality defined in onedal/_device_offload.py vs. sklearnex/_device_offload.py at this point? Seems like maybe these could all be moved to onedal4py. But if there is functionality in sklearnex for a reason then I guess not. |
Thank you! |
/intelci: run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, good work on this and good overall review process, let's wait for internal CI to make sure
/intelci: run |
1 similar comment
/intelci: run |
/intelci: run |
CI looks good. Fails are not related with changes on current PR. Merging it |
Description
Fixing circular import in daal4py/sklearnex device offloading.
The best way to resolve the issue here is to refactor the code to avoid it. This PR rethinking the design of sklearnex/daal4py/onedal4py import modules and their dependencies.
Changes proposed in the PR:
onedal4py
, just for exposing somesklearnex
's config settings intoonedal4py
leveldaal4py
/onedal4py
/sklearnex
:daal4py
, since after KMeans OOP #1770 and adding ENH: Adding Ridge Regression support intosklearnex.preview
#1843 there is no need for GPU offloading via daal4py syc_context.onedal4py
level.sklearnex
depends ononedal4py
_config and _device_oflload modules.Note: It is expected that it will not offload GPU validation Kmeans on main branch, since they are using daal4py GPU offloading, that is removed to call.
#1770 is considered fixe for this.
TODO