Skip to content

Commit

Permalink
[dask] warn if attempting to use tree_learner other than data parallel (
Browse files Browse the repository at this point in the history
#3848)

* [dask] warn if attempting to use tree_learn other than data parallel

* add param
  • Loading branch information
jameslamb authored Jan 25, 2021
1 parent 36322ce commit 5cdaf1b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions python-package/lightgbm/dask.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ def _train(client, data, label, params, model_factory, sample_weight=None, group
for tree_learner_param in _ConfigAliases.get('tree_learner'):
tree_learner = params.get(tree_learner_param)
if tree_learner is not None:
params['tree_learner'] = tree_learner
break

allowed_tree_learners = {
Expand All @@ -261,6 +262,11 @@ def _train(client, data, label, params, model_factory, sample_weight=None, group
_log_warning('Parameter tree_learner set to %s, which is not allowed. Using "data" as default' % tree_learner)
params['tree_learner'] = 'data'

if params['tree_learner'] not in {'data', 'data_parallel'}:
_log_warning(
'Support for tree_learner %s in lightgbm.dask is experimental and may break in a future release. Use "data" for a stable, well-tested interface.' % params['tree_learner']
)

local_listen_port = 12400
for port_param in _ConfigAliases.get('local_listen_port'):
val = params.get(port_param)
Expand Down

0 comments on commit 5cdaf1b

Please sign in to comment.