dask / dask/distributed

Run local code remotely on a worker

Open
#4,003 35 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.7k
Forks
778
Avg merge
2h 50m
Merged PRs (30d)
3

Description

I find myself often wanting to run code on a worker, rather than on my local client. This happens in a few settings:

1. My workers have access to a data store that I don't, so I need to call something like `dd.read_parquet` remotely (cc @martindurant @jcrist )
2. My workers are far away from my client, so client-heavy operations like joblib or Hyperband incur a serious bottleneck from client-scheduler communication (cc @stsievert )
3. My workers have hardware or libraries like GPUs/RAPIDS that I don't have locally (cc @quasiben @kkraus14)

Today I can do this by writing a function and submitting that function as a task

```python
def f():
import dask_cudf
df = dask_cudf.read_parquet("s3://...")
return df.sum().compute()

result = client.submit(f).result()
```

It might make sense to provide syntax around this to make it more magical (or it might not). We might do something like the following:

```python
with dask.distributed.remote as result:
import dask_cudf
df = dask_cudf.read_parquet("s3://...")
result = df.sum().compute()
```

I know that @eriknw has done magic like this in the past. We could enlist this help. However, we may not want to do this due to the magical and novel behavior.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.