小编den*_*s-w的帖子

虽然我正在使用建议的方法,但Dask打印警告以使用client.scatter

在分布式的dask中,我收到以下警告,这是我不希望的:

/home/miniconda3/lib/python3.6/site-packages/distributed/worker.py:739: UserWarning: Large object of size 1.95 MB detected in task graph: 
  (['int-58e78e1b34eb49a68c65b54815d1b158', 'int-5cd ... 161071d7ae7'],)
Consider scattering large objects ahead of time
with client.scatter to reduce scheduler burden and 
keep data on workers

    future = client.submit(func, big_data)    # bad

    big_future = client.scatter(big_data)     # good
    future = client.submit(func, big_future)  # good
  % (format_bytes(len(b)), s))
Run Code Online (Sandbox Code Playgroud)

我感到惊讶的原因是,我正在按照警告的提示进行操作:

import dask.dataframe as dd
import pandas
from dask.distributed import Client, LocalCluster

c = Client(LocalCluster())
dask_df = dd.from_pandas(pandas.DataFrame.from_dict({'A':[1,2,3,4,5]*1000}), npartitions=10)
filter_list = c.scatter(list(range(2,100000,2)))
mask = c.submit(dask_df['A'].isin, …
Run Code Online (Sandbox Code Playgroud)

python python-3.x dask dask-distributed

6
推荐指数
1
解决办法
1006
查看次数

标签 统计

dask ×1

dask-distributed ×1

python ×1

python-3.x ×1