cuml icon indicating copy to clipboard operation
cuml copied to clipboard

CPU/GPU interoperability POC

Open viclafargue opened this issue 2 years ago • 3 comments

viclafargue avatar Aug 23 '22 08:08 viclafargue

Gave this a test locally. It's really smooth! Quick comment:

  • When dispatching linear regression to CPU, the weights/bias attributes are not propagated back up to the cuML estimator -- they're accessible only via the underlying sk_model_. Ideally, cuML users won't need to think about the distinction between PGU and CPU dispatched models. They can access attributes in the same way regardless of hardware.
import cuml
from cuml.common.device_selection import using_device_type, set_global_device_type
from sklearn.datasets import make_regression

X, y = make_regression(
    n_samples=100000,
    noise=50,
    n_features=100,
)

set_global_device_type("cpu")

clf = cuml.linear_model.LinearRegression()
clf.fit(X,y)
print(clf.score(X, y))
print(clf.coef_, clf.intercept_)
0.9451533686273299
None None

beckernick avatar Sep 07 '22 20:09 beckernick

rerun tests

divyegala avatar Sep 09 '22 17:09 divyegala

rerun tests

dantegd avatar Sep 12 '22 19:09 dantegd

rerun tests

dantegd avatar Sep 28 '22 17:09 dantegd

@viclafargue @divyegala could you fix the copyright year so that CI can run a set of tests?:

python/cuml/common/array_descriptor.py:2 Issue: Current year not included in the copyright header

dantegd avatar Sep 28 '22 17:09 dantegd

rerun tests

cjnolet avatar Oct 04 '22 13:10 cjnolet

rerun tests

dantegd avatar Oct 05 '22 16:10 dantegd

I'm waiting on the raft packages to deploy to the rapidsai-nightly channel and then we should be able to rerun this PR.

cjnolet avatar Oct 06 '22 16:10 cjnolet

I'm waiting on the raft packages to deploy to the rapidsai-nightly channel and then we should be able to rerun this PR.

Should we remove the latest commit?

viclafargue avatar Oct 06 '22 16:10 viclafargue

Should we remove the latest commit?

Yes. Though it might be easier to revert the commit so you don't have to rebase / force push.

cjnolet avatar Oct 06 '22 17:10 cjnolet

JFYI: We're still waiting for pylibraft / raft-dask to be deployed to conda, which could take another 25-40mins. I reverted the last commit in the meantime.

cjnolet avatar Oct 06 '22 19:10 cjnolet

rerun tests

cjnolet avatar Oct 06 '22 20:10 cjnolet

rerun tests

viclafargue avatar Oct 07 '22 11:10 viclafargue

Codecov Report

Base: 79.26% // Head: 79.30% // Increases project coverage by +0.04% :tada:

Coverage data is based on head (495c676) compared to base (d65121a). Patch coverage: 95.12% of modified lines in pull request are covered.

Additional details and impacted files
@@               Coverage Diff                @@
##           branch-22.10    #4874      +/-   ##
================================================
+ Coverage         79.26%   79.30%   +0.04%     
================================================
  Files               181      183       +2     
  Lines             11540    11618      +78     
================================================
+ Hits               9147     9214      +67     
- Misses             2393     2404      +11     
Flag Coverage Δ
dask 46.10% <58.53%> (+0.07%) :arrow_up:
non-dask 68.77% <93.90%> (+0.11%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
python/cuml/common/array_descriptor.py 100.00% <ø> (ø)
python/cuml/common/input_utils.py 93.85% <50.00%> (-0.39%) :arrow_down:
python/cuml/internals/global_settings.py 91.89% <86.36%> (-8.11%) :arrow_down:
python/cuml/common/__init__.py 100.00% <100.00%> (ø)
python/cuml/common/device_selection.py 100.00% <100.00%> (ø)
python/cuml/common/memory_utils.py 82.35% <100.00%> (+2.47%) :arrow_up:
python/cuml/dask/common/base.py 94.44% <100.00%> (+0.03%) :arrow_up:
python/cuml/experimental/common/__init__.py 100.00% <100.00%> (ø)
python/cuml/explainer/common.py 88.57% <100.00%> (+0.16%) :arrow_up:
python/cuml/testing/utils.py 89.19% <100.00%> (+0.07%) :arrow_up:
... and 1 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov-commenter avatar Oct 07 '22 12:10 codecov-commenter

@viclafargue webare past code freeze for 22.10 and decided to push this to 22.12. Can you base this ok the 22.12 branch?

cjnolet avatar Oct 07 '22 12:10 cjnolet

rerun tests

dantegd avatar Oct 17 '22 18:10 dantegd

@gpucibot merge

dantegd avatar Oct 18 '22 19:10 dantegd