Skip to content

Multiple CPU interop fixes for serialization and cloning#6223

Merged
rapids-bot[bot] merged 23 commits intorapidsai:branch-25.04from
dantegd:fix-interop-fixes
Feb 24, 2025
Merged

Multiple CPU interop fixes for serialization and cloning#6223
rapids-bot[bot] merged 23 commits intorapidsai:branch-25.04from
dantegd:fix-interop-fixes

Conversation

@dantegd
Copy link
Copy Markdown
Member

@dantegd dantegd commented Jan 14, 2025

No description provided.

@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented Jan 14, 2025

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@github-actions github-actions Bot added the Cython / Python Cython or Python issue label Jan 14, 2025
@dantegd dantegd added bug Something isn't working non-breaking Non-breaking change labels Feb 7, 2025
@dantegd
Copy link
Copy Markdown
Member Author

dantegd commented Feb 7, 2025

/ok to test

Comment thread python/cuml/cuml/experimental/accel/estimator_proxy.py Outdated
@dantegd dantegd changed the base branch from branch-25.02 to branch-25.04 February 14, 2025 04:50
Copy link
Copy Markdown
Contributor

@viclafargue viclafargue left a comment

Choose a reason for hiding this comment

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

LGTM

@betatim
Copy link
Copy Markdown
Member

betatim commented Feb 14, 2025

/ok to test

@betatim betatim marked this pull request as ready for review February 14, 2025 13:41
@betatim betatim requested a review from a team as a code owner February 14, 2025 13:41
@betatim betatim requested review from betatim and teju85 February 14, 2025 13:41
Comment thread python/cuml/cuml/internals/base.pyx Outdated
Comment thread python/cuml/cuml/internals/base.pyx Outdated
Comment thread python/cuml/cuml/internals/base.pyx
Co-authored-by: Simon Adorf <[email protected]>


def test_kernel_ridge():
import cupy as cp
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why move this here? Maybe we should leave a comment for people from the future to explain why it can't be imported at the top of the file (or move it back if this was just for debugging)

km = cluster.KMeans(n_clusters=13)
ckm = cuml.KMeans.from_sklearn(km)

assert ckm.n_clusters == 13
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Lucky number 13 :D

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we should merge this PR. It improves things and fixes several things.

We can keep improving the from_/as_sklearn round tripping. I think the test from https://github.com/rapidsai/cuml/pull/6342/files#r1963552769 still doesn't pass (even if you exclude the raft handle). But lets look at that in a new PR

Comment thread python/cuml/cuml/tests/experimental/accel/test_basic_estimators.py Outdated
Comment thread python/cuml/cuml/tests/experimental/accel/test_basic_estimators.py Outdated
@betatim
Copy link
Copy Markdown
Member

betatim commented Feb 21, 2025

The two not optional jobs both fail with this:

 =========================== short test summary info ============================
FAILED test_basic_estimators.py::test_kernel_ridge - AssertionError: y_pred should be a np.ndarray, but is a <class 'cupy.ndarray'>
assert not True
 +  where True = isinstance(array([ 0.95477083, -0.99923366, -0.49547406, ..., -0.99986215,\n        0.91445195,  0.88462877]), <class 'cupy.ndarray'>)
 +    where <class 'cupy.ndarray'> = <module 'cupy' from '/opt/conda/envs/test/lib/python3.10/site-packages/cupy/__init__.py'>.ndarray
= 1 failed, 529 passed, 5 xfailed, 6 xpassed, 119 warnings in 96.05s (0:01:36) =

I added this test in #6327 where it passed. But, I am wondering if this test should always pass or only it he accelerator is enabled (it should be skipped if the accelerator is disabled)? When I wrote the test I meant "when the accelerator is active, it should always output a Numpy array". I didn't think about the "accelerator off" case, so happy to just skip this test in that case. I guess it depends on what the default output type is, mirror?, when the accelerator is off.

The failures in the optional jobs look more serious. They are of this type:

FAILED test_random_forest.py::test_create_classification_model[8-10-10-1.0] - AttributeError: _cpu_model

For several estimators :-/

There is also a CUDA error but maybe that is a spurious one?

@dantegd
Copy link
Copy Markdown
Member Author

dantegd commented Feb 21, 2025

@betatim it was late last night, the error on the optional jobs is a small one, pushing a fix

@betatim
Copy link
Copy Markdown
Member

betatim commented Feb 24, 2025

I'll merge this now. I think this is a good way forward to see what is what in combination with all the other PRs that are still open. There are things here that we could discuss/improve, let's do that in follow up PRs.

@betatim
Copy link
Copy Markdown
Member

betatim commented Feb 24, 2025

/merge

@betatim betatim dismissed csadorf’s stale review February 24, 2025 14:35

I think those comments have been addressed/we can come back to it

@rapids-bot rapids-bot Bot merged commit 9a9bf6d into rapidsai:branch-25.04 Feb 24, 2025
dantegd added a commit to dantegd/cuml that referenced this pull request Feb 24, 2025
dantegd added a commit to dantegd/cuml that referenced this pull request Feb 26, 2025
raydouglass pushed a commit that referenced this pull request Feb 28, 2025
PRs being backported: 

- [x] #6234
- [x] #6306
- [x] #6320
- [x] #6319
- [x] #6327
- [x] #6333
- [x] #6142 
- [x] #6223
- [x] #6235
- [x] #6317 
- [x] #6331
- [x] #6326
- [x] #6332
- [x] #6347
- [x] #6348
- [x] #6337
- [x] #6355
- [x] #6354
- [x] #6322
- [x] #6353
- [x] #6359
- [x] #6364
- [x] #6363
- [x] [FIL BATCH_TREE_REORG fix for SM90, 100 and
120](a3e419a)

---------

Co-authored-by: William Hicks <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Cython / Python Cython or Python issue non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants