rapidsai / cuml

cuML - RAPIDS Machine Learning Library
https://docs.rapids.ai/api/cuml/stable/
Apache License 2.0
4.26k stars 535 forks source link

Fix Dask estimators serialization prior to training #6065

Closed viclafargue closed 1 month ago

viclafargue commented 2 months ago

Partially answers https://github.com/rapidsai/cuml/issues/6046

dantegd commented 2 months ago

@viclafargue seems like the test ran into an issue in the pytest in some jobs:

=================================== FAILURES ===================================
________________________ test_serialize_before_training ________________________

client = <Client: 'tcp://127.0.0.1:45687' processes=1 threads=1, memory=251.77 GiB>

    def test_serialize_before_training(client):
        X, y = make_regression(n_samples=1000, n_features=20, random_state=0)
        X, y = da.from_array(X), da.from_array(y)

        model = LinearRegression(client=client)
>       pickled_model = pickle.dumps(model)

test_dask_serialization.py:90: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <cuml.dask.linear_model.linear_regression.LinearRegression object at 0x7fca696b4510>

    def __getstate__(self):
>       internal_model = self._get_internal_model().result()
E       AttributeError: 'NoneType' object has no attribute 'result'

/opt/conda/envs/test/lib/python3.11/site-packages/cuml/dask/common/base.py:60: AttributeError
viclafargue commented 2 months ago

@viclafargue seems like the test ran into an issue in the pytest in some jobs:

That's really strange, might possibly be missing something, but isn't there an issue with the CI?

codecov-commenter commented 1 month ago

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 67.15%. Comparing base (ef7a61d) to head (39af9c2).

Files with missing lines Patch % Lines
python/cuml/cuml/dask/common/base.py 0.00% 3 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## branch-24.12 #6065 +/- ## ================================================ - Coverage 68.33% 67.15% -1.18% ================================================ Files 193 193 Lines 12837 12839 +2 ================================================ - Hits 8772 8622 -150 - Misses 4065 4217 +152 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

divyegala commented 1 month ago

/merge