Skip to content

Commit

Permalink
[dask] run one training task on each worker (#4132)
Browse files Browse the repository at this point in the history
* [dask] run one training task on each worker

* add comment on pure

* missing ticks

* empty commit
  • Loading branch information
jameslamb authored Mar 29, 2021
1 parent 9cab93a commit 337103d
Showing 1 changed file with 10 additions and 0 deletions.
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

0 comments on commit 337103d

Please sign in to comment.