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 performance_report context manager for static report generation #3282

Merged
merged 1 commit into from
Nov 28, 2019

Conversation

mrocklin
Copy link
Member

@mrocklin mrocklin commented Nov 28, 2019

This generates a static HTML file with many of the same plots as the dashboard.

Example

from dask.distributed import Client, performance_report
client = Client()

import dask.array as da
x = da.random.random((30000, 30000), chunks=(1000, 1000))

with performance_report():
    x = x.persist()
    (x + x.T).sum().compute()

Result

https://matthewrocklin.com/raw-host/dask-report.html

This generates a static HTML file with many of the same plots as the dashboard.

Example
-------

```python
from dask.distributed import Client
client = Client()
import dask.array as da
x = da.random.random((30000, 30000), chunks=(1000, 1000))
from dask.distributed import Client, performance_report
with performance_report():
    x = x.persist()
    (x + x.T).sum().compute()
```
@mrocklin mrocklin merged commit e3731a6 into dask:master Nov 28, 2019
@mrocklin mrocklin deleted the performance-report branch November 28, 2019 21:45
@beckernick
Copy link
Member

beckernick commented Dec 2, 2019

@mrocklin , when I use this after installing dask.distributed with git+https://github.com/dask/distributed.git (in an environment that already has dask 2.8.1) I get a recursion error from an infinite loop of the following:

  File "/opt/conda/envs/rapids/lib/python3.6/site-packages/dask/sizeof.py", line 36, in sizeof_python_dict
    return getsizeof(d) + sum(map(sizeof, d.keys())) + sum(map(sizeof, d.values()))
  File "/opt/conda/envs/rapids/lib/python3.6/site-packages/dask/utils.py", line 505, in __call__
    return meth(arg, *args, **kwargs)

Larger traceback:

Traceback (most recent call last):
  File "/opt/conda/envs/rapids/lib/python3.6/site-packages/tornado/ioloop.py", line 743, in _run_callback
    ret = callback()
  File "/opt/conda/envs/rapids/lib/python3.6/site-packages/tornado/tcpserver.py", line 327, in <lambda>
    gen.convert_yielded(future), lambda f: f.result()
  File "/opt/conda/envs/rapids/lib/python3.6/site-packages/distributed/comm/tcp.py", line 442, in _handle_stream
    await self.comm_handler(comm)
  File "/opt/conda/envs/rapids/lib/python3.6/site-packages/distributed/core.py", line 415, in handle_comm
    await comm.write(result, serializers=serializers)
  File "/opt/conda/envs/rapids/lib/python3.6/site-packages/distributed/comm/tcp.py", line 226, in write
    context={"sender": self._local_addr, "recipient": self._peer_addr},
  File "/opt/conda/envs/rapids/lib/python3.6/site-packages/distributed/comm/utils.py", line 40, in to_frames
    if FRAME_OFFLOAD_THRESHOLD and sizeof(msg) > FRAME_OFFLOAD_THRESHOLD:
  File "/opt/conda/envs/rapids/lib/python3.6/site-packages/dask/utils.py", line 505, in __call__
    return meth(arg, *args, **kwargs)
  File "/opt/conda/envs/rapids/lib/python3.6/site-packages/dask/sizeof.py", line 36, in sizeof_python_dict
    return getsizeof(d) + sum(map(sizeof, d.keys())) + sum(map(sizeof, d.values()))
  File "/opt/conda/envs/rapids/lib/python3.6/site-packages/dask/utils.py", line 505, in __call__
    return meth(arg, *args, **kwargs)
  File "/opt/conda/envs/rapids/lib/python3.6/site-packages/dask/sizeof.py", line 36, in sizeof_python_dict
    return getsizeof(d) + sum(map(sizeof, d.keys())) + sum(map(sizeof, d.values()))
  File "/opt/conda/envs/rapids/lib/python3.6/site-packages/dask/utils.py", line 505, in __call__
    return meth(arg, *args, **kwargs)

...

RecursionError: maximum recursion depth exceeded
tornado.application - ERROR - Exception in callback functools.partial(<function TCPServer._handle_connection.<locals>.<lambda> at 0x7f8f7b09b8c8>, <Task finished coro=<BaseTCPListener._handle_stream() done, defined at /opt/conda/envs/rapids/lib/python3.6/site-packages/distributed/comm/tcp.py:433> exception=RecursionError('maximum recursion depth exceeded',)>)

Is there perhaps an additional step I may be missing?

@beckernick
Copy link
Member

Problem appears to be on my end 👍

@mrocklin
Copy link
Member Author

mrocklin commented Dec 2, 2019 via email

@KrishanBhasin
Copy link
Contributor

@beckernick Could you share how you fixed this? I've started running into this problem too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants