Skip to content

Merge global annotations on the client#4691

Merged
jrbourbeau merged 10 commits intodask:mainfrom
madsbk:merge_global_annotations_on_client
May 13, 2021
Merged

Merge global annotations on the client#4691
jrbourbeau merged 10 commits intodask:mainfrom
madsbk:merge_global_annotations_on_client

Conversation

@madsbk
Copy link
Contributor

@madsbk madsbk commented Apr 9, 2021

Fixes #4551 by merging global annotations on when packing layers on the client.

This must be merged together with dask/dask#7565

Closes #4692

  • Tests added / passed
  • Passes black distributed / flake8 distributed / isort distributed

@madsbk madsbk marked this pull request as ready for review April 9, 2021 09:56
Copy link
Member

@fjetter fjetter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few nitpicks but overall LGTM

Comment on lines +4091 to +4092
if not isinstance(v, (list, tuple, set)):
v = [v]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: We should have enough control about the other end to ensure this is always a tuple, don't we? I'm wondering if this is smth we rather want to do on the other end, i.e. keep code and types clean in this function since it is already quite large and complicated

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can do it when we pack the annotations but I am not sure that is a good idea. The annotation packing is very generic and doesn't know anything about the meaning of the annotations.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that some checking is already done client-side: https://github.com/dask/dask/blob/main/dask/base.py#L91-L102

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, but it is only when we unpack/expand the annotation that we know if the callable is indeed returning a list of workers.

@jrbourbeau
Copy link
Member

Also cc'ing @sjperkins for visibility

@jrbourbeau
Copy link
Member

I just merged the current main branch into this PR to include some fixes for unrelated test failures

madsbk added a commit to madsbk/dask that referenced this pull request Apr 16, 2021
@madsbk
Copy link
Contributor Author

madsbk commented Apr 16, 2021

@jrbourbeau I am now doing the merging when packing layers, which should fix the issue where global annotations would persist.
Can I get you to make the CI test use dask/dask#7565 ?

@madsbk
Copy link
Contributor Author

madsbk commented May 3, 2021

@jrbourbeau, the CI test failing is distributed/comm/tests/test_comms.py::test_register_backend_entrypoint. I am not able to reproduce the error locally. Do you know if this is a known flaky test?

@jrbourbeau
Copy link
Member

Apologies for the delayed reply. The test_register_backend_entrypoint is okay -- it has to do with the git tags present on https://github.com/madsbk/dask.git@merge_global_annotations_on_client. It won't be a problem on the main branch here.

@madsbk
Copy link
Contributor Author

madsbk commented May 7, 2021

Apologies for the delayed reply. The test_register_backend_entrypoint is okay -- it has to do with the git tags present on https://github.com/madsbk/dask.git@merge_global_annotations_on_client. It won't be a problem on the main branch here.

In that case, I think this PR and dask/dask#7565 are ready to be merged :)

@jrbourbeau jrbourbeau mentioned this pull request May 13, 2021
3 tasks
Copy link
Member

@jrbourbeau jrbourbeau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @madsbk! Apologies for the delay in getting this merged

Note that merging in dask/dask#7565 along with this PR will cause tests to pass

@jrbourbeau jrbourbeau merged commit d6f5609 into dask:main May 13, 2021
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.

Unable to provide workers as dict for client.persist()

5 participants