You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When .persist(resources={...}) is called on a Dask DataFrame, the specified resources will be ignored for scheduling. In particular, no task in the corresponding dashboard pages will outline the resources. In my setup, the following example triggers the issue (using python 3.6 and distributed 1.28.1):
importpandasaspdimportdask.dataframeasddfromdask.distributedimportClientdeftest_resources():
client=Client(n_workers=1, resources={"MyRes": 1000})
test_input_frame=dd.from_pandas(pd.DataFrame({"A": [1, 2], "B": [3, 4]}), npartitions=1)
test_output_frame=test_input_frame.apply(lambdarow: row.sum(), axis=1)
output=test_output_frame.persist(resources={"MyRes": 1})
print(output)
# The task pages of the dashboard do not display the resource dependencies.input("Press any key to exit...")
client.close()
if__name__=='__main__':
test_resources()
I quickly ran the debugger on the Dask distributed code and discovered that in client.Client._graph_to_futures(...), self._expand_resources(...) returns a dict where the keys are tuples identifying the task. When I manually convert the keys to their string representation, i.e. call:
resources= {tokey(k): vfork,vinresources.items()}
after _expand_resources(...), the task dashboard will display the associated resources. (But I don't know whether converting the keys will have any other side effects)
Thank you very much for your response! I tried the example on distributed master (commit d202e62) but the issue is still there. In my worker's page, the resources are also listed but on the task's page, they are not:
When I apply the described line, the task's page expectedly shows the following resource restriction:
I'll create a brief pull-request to better describe my changes.
Activity
TomAugspurger commentedon May 28, 2019
Sorry for the lack of response here. Can you try your example (which was great btw) on distributed master? This may be fixed. Locally, I see
jakirkham commentedon May 29, 2019
@Spiegel0, have you had a chance to restest this on
master? Please let us know if there is a way to help.Fix the resource key representation before sending graphs
Spiegel0 commentedon May 30, 2019
Thank you very much for your response! I tried the example on distributed master (commit d202e62) but the issue is still there. In my worker's page, the resources are also listed but on the task's page, they are not:


When I apply the described line, the task's page expectedly shows the following resource restriction:

I'll create a brief pull-request to better describe my changes.
Adds a test case triggering the resource restriction issue dask#2716
Fix the resource key representation before sending graphs
Merge remote-tracking branch 'upstream/master'
Merge remote-tracking branch 'upstream/master'