Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add workers argument to dask make_blobs #5057

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions python/cuml/dask/datasets/blobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def make_blobs(n_samples=100, n_features=2, centers=None, cluster_std=1.0,
n_parts=None, center_box=(-10, 10), shuffle=True,
random_state=None, return_centers=False,
verbose=False, order='F', dtype='float32',
client=None):
workers=None, client=None):
viclafargue marked this conversation as resolved.
Show resolved Hide resolved
"""
Makes labeled Dask-Cupy arrays containing blobs
for a randomly generated set of centroids.
Expand Down Expand Up @@ -89,6 +89,9 @@ def make_blobs(n_samples=100, n_features=2, centers=None, cluster_std=1.0,
The order of the generated samples
dtype : str, optional (default='float32')
Dtype of the generated samples
workers : optional, list of strings
Dask addresses of workers to use for computation.
If None, all available Dask workers will be used.
viclafargue marked this conversation as resolved.
Show resolved Hide resolved
client : dask.distributed.Client (optional)
Dask client to use
Expand All @@ -108,7 +111,8 @@ def make_blobs(n_samples=100, n_features=2, centers=None, cluster_std=1.0,

generator = _create_rs_generator(random_state=random_state)

workers = list(client.scheduler_info()['workers'].keys())
if workers is None:
workers = list(client.scheduler_info()['workers'].keys())

n_parts = n_parts if n_parts is not None else len(workers)
parts_workers = (workers * n_parts)[:n_parts]
Expand Down