diff --git a/python-package/xgboost/core.py b/python-package/xgboost/core.py index 1722670fd..e8bc735e6 100644 --- a/python-package/xgboost/core.py +++ b/python-package/xgboost/core.py @@ -7,7 +7,6 @@ import json import os import re import sys -import uuid import warnings import weakref from abc import ABC, abstractmethod @@ -3144,9 +3143,3 @@ class Booster: UserWarning, ) return nph_stacked - - def __dask_tokenize__(self) -> uuid.UUID: - # TODO: Implement proper tokenization to avoid unnecessary re-computation in - # Dask. However, default tokenzation causes problems after - # https://github.com/dask/dask/pull/10883 - return uuid.uuid4() diff --git a/python-package/xgboost/dask/__init__.py b/python-package/xgboost/dask/__init__.py index c74caecdb..c5140a1fe 100644 --- a/python-package/xgboost/dask/__init__.py +++ b/python-package/xgboost/dask/__init__.py @@ -1237,10 +1237,12 @@ def _infer_predict_output( async def _get_model_future( client: "distributed.Client", model: Union[Booster, Dict, "distributed.Future"] ) -> "distributed.Future": + # See https://github.com/dask/dask/issues/11179#issuecomment-2168094529 for + # the use of hash. if isinstance(model, Booster): - booster = await client.scatter(model, broadcast=True) + booster = await client.scatter(model, broadcast=True, hash=False) elif isinstance(model, dict): - booster = await client.scatter(model["booster"], broadcast=True) + booster = await client.scatter(model["booster"], broadcast=True, hash=False) elif isinstance(model, distributed.Future): booster = model t = booster.type