Skip to content

Commit

Permalink
revert docs change
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb committed Feb 19, 2021
1 parent eeb75f5 commit 0c81f60
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 20 deletions.
2 changes: 1 addition & 1 deletion docs/Parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,7 @@ Network Parameters

- this parameter is needed to be set in both **socket** and **mpi** versions

- ``local_listen_port`` :raw-html:`<a id="local_listen_port" title="Permalink to this parameter" href="#local_listen_port">&#x1F517;&#xFE0E;</a>`, default = ``12400``, type = int, aliases: ``local_port``, ``port``, constraints: ``local_listen_port > 0``
- ``local_listen_port`` :raw-html:`<a id="local_listen_port" title="Permalink to this parameter" href="#local_listen_port">&#x1F517;&#xFE0E;</a>`, default = ``12400 (random for Dask-package)``, type = int, aliases: ``local_port``, ``port``, constraints: ``local_listen_port > 0``

- TCP listen port for local machines

Expand Down
1 change: 1 addition & 0 deletions include/LightGBM/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,7 @@ struct Config {
int num_machines = 1;

// check = >0
// default = 12400 (random for Dask-package)
// alias = local_port, port
// desc = TCP listen port for local machines
// desc = **Note**: don't forget to allow this port in firewall settings before training
Expand Down
22 changes: 3 additions & 19 deletions python-package/lightgbm/dask.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,16 +556,6 @@ def _predict(
raise TypeError('Data must be either Dask Array or Dask DataFrame. Got %s.' % str(type(data)))


# relying on the default port being 12400 in a firewall-constrained environment will
# not work because by default the Dask interface searches for ports randomly to reduce the overhead of network setup
_dasklgbmmodel_doc_network_params_warning = (
' ' * 4 + '.. warning::\n'
+ '\n'
+ ' ' * 16 + 'If communication between the workers in your Dask cluster is constrained by firewall rules, set ``machines`` or ``local_listen_port`` explicitly. \n'
+ ' ' * 16 + 'If these are missing, LightGBM will use random open ports for communication between workers.\n'
)


class _DaskLGBMModel:

@property
Expand Down Expand Up @@ -708,9 +698,7 @@ def __init__(

# the note on custom objective functions in LGBMModel.__init__ is not
# currently relevant for the Dask estimators
_base_doc = _base_doc[:_base_doc.find('Note\n')]

__init__.__doc__ = _base_doc + _dasklgbmmodel_doc_network_params_warning
__init__.__doc__ = _base_doc[:_base_doc.find('Note\n')]

def __getstate__(self) -> Dict[Any, Any]:
return self._lgb_getstate()
Expand Down Expand Up @@ -861,9 +849,7 @@ def __init__(

# the note on custom objective functions in LGBMModel.__init__ is not
# currently relevant for the Dask estimators
_base_doc = _base_doc[:_base_doc.find('Note\n')]

__init__.__doc__ = _base_doc + _dasklgbmmodel_doc_network_params_warning
__init__.__doc__ = _base_doc[:_base_doc.find('Note\n')]

def __getstate__(self) -> Dict[Any, Any]:
return self._lgb_getstate()
Expand Down Expand Up @@ -995,9 +981,7 @@ def __init__(

# the note on custom objective functions in LGBMModel.__init__ is not
# currently relevant for the Dask estimators
_base_doc = _base_doc[:_base_doc.find('Note\n')]

__init__.__doc__ = _base_doc + _dasklgbmmodel_doc_network_params_warning
__init__.__doc__ = _base_doc[:_base_doc.find('Note\n')]

def __getstate__(self) -> Dict[Any, Any]:
return self._lgb_getstate()
Expand Down

0 comments on commit 0c81f60

Please sign in to comment.