Skip to content

Commit

Permalink
Transmit verbosity level to Dask workers (#5062)
Browse files Browse the repository at this point in the history
Authors:
  - Victor Lafargue (https://github.com/viclafargue)

Approvers:
  - Carl Simon Adorf (https://github.com/csadorf)
  - Corey J. Nolet (https://github.com/cjnolet)
  - Dante Gama Dessavre (https://github.com/dantegd)

URL: #5062
  • Loading branch information
viclafargue committed Dec 8, 2022
1 parent 276cb62 commit e59e339
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 2 additions & 3 deletions python/cuml/dask/cluster/dbscan.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ def __init__(self, *, client=None, verbose=False, **kwargs):
@staticmethod
@mnmg_import
def _func_fit(out_dtype):
def _func(sessionId, data, verbose, **kwargs):
def _func(sessionId, data, **kwargs):
from cuml.cluster.dbscan_mg import DBSCANMG as cumlDBSCAN
handle = get_raft_comm_state(sessionId)["handle"]

return cumlDBSCAN(handle=handle, verbose=verbose, **kwargs
return cumlDBSCAN(handle=handle, **kwargs
).fit(data, out_dtype=out_dtype)
return _func

Expand Down Expand Up @@ -118,7 +118,6 @@ def fit(self, X, out_dtype="int32"):
dbscan_fit = [self.client.submit(DBSCAN._func_fit(out_dtype),
comms.sessionId,
data,
self.verbose,
**self.kwargs,
workers=[worker],
pure=False)
Expand Down
5 changes: 5 additions & 0 deletions python/cuml/dask/common/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,12 @@ def __init__(self, *, client=None, verbose=False, **kwargs):
Constructor for distributed estimators.
"""
self.client = get_client(client)

# set client verbosity
self.verbose = verbose

# kwargs transmits the verbosity level to workers
kwargs["verbose"] = verbose
self.kwargs = kwargs

self.internal_model = None
Expand Down

0 comments on commit e59e339

Please sign in to comment.