[DF] Make sure the Dask scheduler has information about the workers#9431
Merged
vepadulano merged 1 commit intoroot-project:masterfrom Dec 13, 2021
Merged
Conversation
The current implementation of `optimize_npartitions` of the Dask backend queries information about the workers from the Dask client object. The information is stored in the `client.scheduler_info()` return value which is a dictionary that can have the key `workers`. Supposedly, when this key exists it means the Dask client has the needed information. This is not always true. In certain scenarios, for example when waiting for a batch system to return the available workers to the dask client, the `workers` key will be present but its value will be an empty dictionary. This is because the scheduler doesn't already know which nodes of the cluster will become workers (this can be mitigated by calling the `client.wait_for_workers` function beforehand). This commit makes the check a bit stronger, getting the value of the dictionary key `workers` and then checking if that value actually contains something.
Member
Author
|
@phsft-bot build |
|
Starting build on |
Member
Author
|
Unsure why the build system wasn't triggered previously |
etejedor
approved these changes
Dec 13, 2021
1 task
|
Build failed on mac1015/python3. Failing tests: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The current implementation of
optimize_npartitionsof the Dask backendqueries information about the workers from the Dask client object. The
information is stored in the
client.scheduler_info()return valuewhich is a dictionary that can have the key
workers.Supposedly, when this key exists it means the Dask client has the needed
information. This is not always true. In certain scenarios, for example
when waiting for a batch system to return the available workers to the
dask client, the
workerskey will be present but its value will be anempty dictionary. This is because the scheduler doesn't already know
which nodes of the cluster will become workers (this can be mitigated by
calling the
client.wait_for_workersfunction beforehand).This commit makes the check a bit stronger, getting the value of the
dictionary key
workersand then checking if that value actuallycontains something.
fixes #9429