Skip to content

Conversation

@fjetter
Copy link
Member

@fjetter fjetter commented Jul 28, 2023

Working my way towards #7980

This makes a couple of methods static. This is mostly cosmetic to signal that they are in fact not relying on the scheduler and are not (supposed to) mutate any state.

The second thing is that this simplifies the way annotations are handled which is currently quite confusing. Haven't run any benchmarks but I'm pretty sure this is also faster than before. However, nothing here is flagged by #7980

@github-actions
Copy link
Contributor

github-actions bot commented Jul 28, 2023

Unit Test Results

See test report for an extended history of previous test failures. This is useful for diagnosing flaky tests.

       19 files   -        1         19 suites   - 1   10h 16m 35s ⏱️ - 1h 26m 17s
  3 747 tests +       6    3 634 ✔️ +       8     108 💤 +    2  5  -   4 
33 624 runs   - 2 560  31 994 ✔️  - 2 423  1 624 💤  - 126  6  - 11 

For more details on these failures, see this check.

Results for commit d5340c0. ± Comparison against base commit d6758bd.

This pull request removes 1 and adds 7 tests. Note that renamed tests count towards both.
distributed.deploy.tests.test_adaptive ‑ test_target_duration
distributed.cli.tests.test_dask_worker.test_listen_address_ipv6[tcp:..[ ‑ 1]:---nanny]
distributed.cli.tests.test_dask_worker.test_listen_address_ipv6[tcp:..[ ‑ 1]:---no-nanny]
distributed.deploy.tests.test_adaptive ‑ test_respect_average_nthreads
distributed.deploy.tests.test_adaptive ‑ test_scale_up_large_tasks[1]
distributed.deploy.tests.test_adaptive ‑ test_scale_up_large_tasks[inf]
distributed.deploy.tests.test_adaptive ‑ test_target_duration[1]
distributed.deploy.tests.test_adaptive ‑ test_target_duration[5]

♻️ This comment has been updated with latest results.

Comment on lines -4376 to -4377
pre_stringified_keys,
) = self.materialize_graph(graph)
Copy link
Member Author

Choose a reason for hiding this comment

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

previously I passed throuhg non-stringified keys to have them available when dealing with annotations at a later point. it's much better to get this out of the way and do this here.
Once/if stringification is removed this should simplify things with annotations a lot

Comment on lines +4379 to +4387
if internal_priority is None:
# Removing all non-local keys before calling order()
dsk_keys = set(dsk) # intersection() of sets is much faster than dict_keys
stripped_deps = {
k: v.intersection(dsk_keys)
for k, v in dependencies.items()
if k in dsk_keys
}
internal_priority = dask.order.order(dsk, dependencies=stripped_deps)
Copy link
Member Author

Choose a reason for hiding this comment

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

this is just a preparatory step. In the follow up PR I will rename the variables. This is just about the logical grouping of doing static/non-mutating operations first instead of grouping the operations by content

Comment on lines +4475 to +4479
annotations_for_plugin: defaultdict[str, dict[str, Any]] = defaultdict(dict)
for key in keys_with_annotations:
ts = self.tasks[key]
for annot, value in ts.annotations.items():
annotations_for_plugin[annot][key] = value
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm inclined to remove passing annotations to plugins. If a scheduler plugin wants to know what annotations are there, it should just look this up with the task itself. I wanted to separate this change from the refactoring so I decided to keep a slightly simplified version in

@hendrikmakait hendrikmakait self-requested a review July 31, 2023 08:52
@hendrikmakait
Copy link
Member

test_array_annotations still fails consistently, please investigate.

@fjetter
Copy link
Member Author

fjetter commented Aug 1, 2023

Done. tests should pass now

Copy link
Member

@hendrikmakait hendrikmakait left a comment

Choose a reason for hiding this comment

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

Generally LGTM with a couple of nits or questions for clarification that might lead to small code changes.

Co-authored-by: Hendrik Makait <hendrik.makait@gmail.com>
@fjetter fjetter merged commit 44c42e1 into dask:main Aug 2, 2023
@fjetter fjetter deleted the simplify_update_graph branch August 2, 2023 09:15
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.

2 participants