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

Client.compute(df) operates on larger task graphs than df.compute() #8833

Open
hendrikmakait opened this issue Aug 15, 2024 · 2 comments
Open
Labels
bug Something is broken

Comments

@hendrikmakait
Copy link
Member

Describe the issue:

Minimal Complete Verifiable Example:

from dask.distributed import Client
import dask

if __name__ == "__main__":
    client = Client()

    task_counts = []
    
    def capture_task_counts(event):
        _, msg = event
        if not isinstance(msg, dict):
            return
        if msg.get("action", None) != "update_graph":
            return
        task_counts.append(msg["count"])
    client.subscribe_topic("all", capture_task_counts)

    df = dask.datasets.timeseries(
        start="2000-01-01",
        end="2001-01-01",
        dtypes={"x": float, "y": float},
        freq="10 s",
    )
    total = df.x.sum()

    total.compute()
    client.compute(total, sync=True)
    assert task_counts[0] == task_counts[1], task_counts

raises AssertionError: [367, 1466].

From what it looks like, client.compute(...) does not perform (all) task fusion.

Anything else we need to know?:

Environment:

  • Dask version:
  • Python version:
  • Operating System:
  • Install method (conda, pip, source):
@hendrikmakait hendrikmakait added the bug Something is broken label Aug 15, 2024
@hendrikmakait
Copy link
Member Author

@hendrikmakait
Copy link
Member Author

hendrikmakait commented Aug 15, 2024

Injecting .optimize(fuse=True) (client.compute(total.optimize(fuse=True), sync=True)) reduces the difference to 1: AssertionError: [367, 368]

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

No branches or pull requests

1 participant