Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dask] Disable broadcast in the scatter call. #10632

Merged
merged 1 commit into from
Jul 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions python-package/xgboost/dask/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1223,12 +1223,14 @@ 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.
# See https://github.com/dask/dask/issues/11179#issuecomment-2168094529 for the use
# of hash.
# https://github.com/dask/distributed/pull/8796 Don't use broadcast in the `scatter`
# call, otherwise, the predict function might hang.
if isinstance(model, Booster):
booster = await client.scatter(model, broadcast=True, hash=False)
booster = await client.scatter(model, hash=False)
elif isinstance(model, dict):
booster = await client.scatter(model["booster"], broadcast=True, hash=False)
booster = await client.scatter(model["booster"], hash=False)
elif isinstance(model, distributed.Future):
booster = model
t = booster.type
Expand Down
Loading