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] run one training task on each worker #4132

Merged
merged 4 commits into from
Mar 29, 2021
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: 10 additions & 0 deletions python-package/lightgbm/dask.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,13 @@ def _train(
num_machines = len(worker_address_to_port)

# Tell each worker to train on the parts that it has locally
#
# This code treates ``_train_part()`` calls as not "pure" because:
# 1. there is randomness in the training process unless parameters ``seed``
# and ``is_deterministic`` are set
# 2. even with those parameters set, the output of one ``_train_part()`` call
# relies on global state (it and all the other LightGBM training processes
# coordinate with each other)
futures_classifiers = [
client.submit(
_train_part,
Expand All @@ -391,6 +398,9 @@ def _train(
num_machines=num_machines,
time_out=params.get('time_out', 120),
return_model=(worker == master_worker),
workers=[worker],
allow_other_workers=False,
pure=False,
**kwargs
)
for worker, list_of_parts in worker_map.items()
Expand Down