Skip to content

Compatibility with Dask 2025.4.1#6614

Merged
rapids-bot[bot] merged 6 commits intorapidsai:branch-25.06from
TomAugspurger:tom/dask-2025-4-1-compat
May 7, 2025
Merged

Compatibility with Dask 2025.4.1#6614
rapids-bot[bot] merged 6 commits intorapidsai:branch-25.06from
TomAugspurger:tom/dask-2025-4-1-compat

Conversation

@TomAugspurger
Copy link
Copy Markdown
Contributor

@TomAugspurger TomAugspurger commented May 5, 2025

This PR is another attempt at fixing compatibility with dask upstreaming, targeting dask==2025.4.1

rapidsai/dask-upstream-testing#44 and linked CI runs as the list of failures. This PR fixes the first two classes of failures, one set in LabelBinarizer and one set in kneighbors. See the commit messages for links to failures.

There's one remaining class of failures in cuml/python/cuml/cuml/tests/dask/test_dask_random_forest.py::test_rf_broadcast[True-True-classification]. I'm currently planning to fix those in a separate PR since it looks more complicated. These should be fixed by 1d75861 and 22393bb.

This fixes the tests `packages/cuml/python/cuml/cuml/tests/dask/test_dask_kneighbors_regressor.py::test_predict_and_score[dataset0-parameters0-dask_cudf]`
failing at https://github.com/rapidsai/dask-upstream-testing/actions/runs/14830363253/job/41630210318#step:10:783.

Most likely, a Future wasn't living long enough, and something wasn't
capturing that ref. Workaround by keeping the reference around until
we're done with it.
Fixes the failures in, e.g. packages/cuml/python/cuml/cuml/tests/dask/test_dask_label_binarizer.py::test_basic_functions[True-labels0]
observed at https://github.com/rapidsai/dask-upstream-testing/actions/runs/14830363253/job/41630210318#step:10:788
@TomAugspurger TomAugspurger requested a review from a team as a code owner May 5, 2025 14:08
@TomAugspurger TomAugspurger requested review from divyegala and jcrist May 5, 2025 14:08
@github-actions github-actions Bot added the Cython / Python Cython or Python issue label May 5, 2025
Comment thread python/cuml/cuml/dask/_compat.py
Comment thread python/cuml/cuml/dask/datasets/blobs.py
Comment thread python/cuml/cuml/dask/neighbors/kneighbors_classifier.py
Comment thread python/cuml/cuml/dask/preprocessing/label.py
@csadorf csadorf added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels May 6, 2025
@TomAugspurger
Copy link
Copy Markdown
Contributor Author

CI failure at https://github.com/rapidsai/cuml/actions/runs/14882476121/job/41794658828?pr=6614#step:9:3455

_______________ test_qn[True-0.1-0.1-elasticnet-float64-softmax] _______________
[gw6] linux -- Python 3.10.17 /opt/conda/envs/test/bin/python
Traceback (most recent call last):
  File "/opt/conda/envs/test/lib/python3.10/site-packages/_pytest/runner.py", line 341, in from_call
    result: Optional[TResult] = func()
  File "/opt/conda/envs/test/lib/python3.10/site-packages/_pytest/runner.py", line 262, in <lambda>
    lambda: ihook(item=item, **kwds), when=when, reraise=reraise
  File "/opt/conda/envs/test/lib/python3.10/site-packages/pluggy/_hooks.py", line 513, in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
  File "/opt/conda/envs/test/lib/python3.10/site-packages/pluggy/_manager.py", line 120, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "/opt/conda/envs/test/lib/python3.10/site-packages/pluggy/_callers.py", line 182, in _multicall
    return outcome.get_result()
  File "/opt/conda/envs/test/lib/python3.10/site-packages/pluggy/_result.py", line 100, in get_result
    raise exc.with_traceback(exc.__traceback__)
  File "/opt/conda/envs/test/lib/python3.10/site-packages/pluggy/_callers.py", line 103, in _multicall
    res = hook_impl.function(*args)
  File "/opt/conda/envs/test/lib/python3.10/site-packages/_pytest/runner.py", line 177, in pytest_runtest_call
    raise e
  File "/opt/conda/envs/test/lib/python3.10/site-packages/_pytest/runner.py", line 169, in pytest_runtest_call
    item.runtest()
  File "/opt/conda/envs/test/lib/python3.10/site-packages/_pytest/python.py", line 1792, in runtest
    self.ihook.pytest_pyfunc_call(pyfuncitem=self)
  File "/opt/conda/envs/test/lib/python3.10/site-packages/pluggy/_hooks.py", line 513, in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
  File "/opt/conda/envs/test/lib/python3.10/site-packages/pluggy/_manager.py", line 120, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "/opt/conda/envs/test/lib/python3.10/site-packages/pluggy/_callers.py", line 139, in _multicall
    raise exception.with_traceback(exception.__traceback__)
  File "/opt/conda/envs/test/lib/python3.10/site-packages/pluggy/_callers.py", line 103, in _multicall
    res = hook_impl.function(*args)
  File "/opt/conda/envs/test/lib/python3.10/site-packages/_pytest/python.py", line 194, in pytest_pyfunc_call
    result = testfunction(**testargs)
  File "/__w/cuml/cuml/python/cuml/cuml/tests/test_qn.py", line 71, in test_qn
    assert cuml_score >= 0.50
AssertionError: assert 0.456 >= 0.5

That appears to be unrelated but I'm not sure.

@betatim
Copy link
Copy Markdown
Member

betatim commented May 7, 2025

I've restarted the failed test. I think the failure of the QN test is a sign of a flaky test, I've had it fail a few times (and then not) in another PR this week

Copy link
Copy Markdown
Member

@jcrist jcrist left a comment

Choose a reason for hiding this comment

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

:shipit:

@jcrist
Copy link
Copy Markdown
Member

jcrist commented May 7, 2025

/merge

@rapids-bot rapids-bot Bot merged commit f03b84b into rapidsai:branch-25.06 May 7, 2025
88 checks passed
@TomAugspurger TomAugspurger deleted the tom/dask-2025-4-1-compat branch May 8, 2025 02:24
TomAugspurger added a commit to TomAugspurger/cuml that referenced this pull request May 8, 2025
TomAugspurger added a commit to TomAugspurger/cuml that referenced this pull request May 8, 2025
rapidsai#6614 broke BaseRandomForestModel
for the "regressoin" op type. In this case, the shape we provided
Dask was wrong, which eventually caused errors in
`dask.array.concatenate` trying to convert cupy arrays to ndarrays.

I'm not sure why CI didn't catch this. Perhaps older versions of dask
weren't susceptible to this issue.
Ofek-Haim pushed a commit to Ofek-Haim/cuml that referenced this pull request May 13, 2025
This PR is another attempt at fixing compatibility with dask upstreaming, targeting dask==2025.4.1

rapidsai/dask-upstream-testing#44 and linked CI runs as the list of failures. This PR fixes the first two classes of failures, one set in `LabelBinarizer` and one set in kneighbors. See the commit messages for links to failures.

~There's one remaining class of failures in `cuml/python/cuml/cuml/tests/dask/test_dask_random_forest.py::test_rf_broadcast[True-True-classification]`. I'm currently planning to fix those in a separate PR since it looks more complicated.~ These should be fixed by [1d75861](rapidsai@1d75861) and [22393bb](rapidsai@22393bb).

Authors:
  - Tom Augspurger (https://github.com/TomAugspurger)

Approvers:
  - Jim Crist-Harif (https://github.com/jcrist)

URL: rapidsai#6614
rapids-bot Bot pushed a commit to rapidsai/rapids-dask-dependency that referenced this pull request May 15, 2025
For the next rapids release (25.06) I'd like to target Dask==2025.4.1.

Currently, the only known failures with dask main are at rapidsai/dask-upstream-testing#44, which should be fixed by rapidsai/cuml#6614. My rough plan is

1. Get that cuml PR merged.
2. Confirm a successful run against dask main
3. Confirm a successful run against dask==2025.4.1 (using rapidsai/dask-upstream-testing#45, hopefully; hardcoding the branch temporaily if not)
4. Monitor CI for downstream libraries to confirm that dask==2025.4.1 is picked up and CI passes.

Closes rapidsai/cudf#18122

Authors:
  - Tom Augspurger (https://github.com/TomAugspurger)

Approvers:
  - Richard (Rick) Zamora (https://github.com/rjzamora)

URL: #95
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Cython / Python Cython or Python issue improvement Improvement / enhancement to an existing function non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants