From 0ccaad815b3d675893aa655c2f4c0226d060f253 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sun, 24 Jan 2021 21:19:49 -0600 Subject: [PATCH 1/2] [dask] warn if attempting to use tree_learn other than data parallel --- python-package/lightgbm/dask.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/python-package/lightgbm/dask.py b/python-package/lightgbm/dask.py index 4acbf10702d7..166cf819f148 100644 --- a/python-package/lightgbm/dask.py +++ b/python-package/lightgbm/dask.py @@ -261,6 +261,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 currently untested, and should be considered experimental' % params['tree_learner'] + ) + local_listen_port = 12400 for port_param in _ConfigAliases.get('local_listen_port'): val = params.get(port_param) From 5657a3604004c4442e383ae3aa9e261c75ee7f19 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sun, 24 Jan 2021 21:41:52 -0600 Subject: [PATCH 2/2] add param --- python-package/lightgbm/dask.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python-package/lightgbm/dask.py b/python-package/lightgbm/dask.py index 166cf819f148..cfa5f79d9bbd 100644 --- a/python-package/lightgbm/dask.py +++ b/python-package/lightgbm/dask.py @@ -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 = { @@ -263,7 +264,7 @@ def _train(client, data, label, params, model_factory, sample_weight=None, group if params['tree_learner'] not in {'data', 'data_parallel'}: _log_warning( - 'Support for tree_learner %s in lightgbm.dask is currently untested, and should be considered experimental' % params['tree_learner'] + '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