Skip to content

Commit

Permalink
Speed up
Browse files Browse the repository at this point in the history
  • Loading branch information
crusaderky committed Feb 6, 2024
1 parent f541fd7 commit 2e302a1
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions distributed/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -4773,16 +4773,19 @@ def _generate_taskstates(
# run_spec in the submitted graph may be None. This happens
# when an already persisted future is part of the graph
elif k in dsk:

Check warning on line 4775 in distributed/scheduler.py

View check run for this annotation

Codecov / codecov/patch

distributed/scheduler.py#L4775

Added line #L4775 was not covered by tests
with dask.config.set({"tokenize.ensure-deterministic": True}):
# The tokenize output _could_ be stored as an attribute if this
# becomes too slow, but it's nice if we don't need to store this for
# every task
try:
tok_lhs = tokenize(ts.run_spec)
tok_rhs = tokenize(dsk[k])
except RuntimeError:
# Non-deterministic token
tok_lhs = tok_rhs = None
# The tokenize output _could_ be stored as an attribute if this
# becomes too slow, but it's nice if we don't need to store this for
# every task
tok_lhs = tokenize(ts.run_spec)
tok_rhs = tokenize(dsk[k])
if tok_lhs != tok_rhs:

Check warning on line 4781 in distributed/scheduler.py

View check run for this annotation

Codecov / codecov/patch

distributed/scheduler.py#L4779-L4781

Added lines #L4779 - L4781 were not covered by tests
# FIXME this is prone to threaded race conditions
with dask.config.set({"tokenize.ensure-deterministic": True}):
try:
tokenize(ts.run_spec, dsk[k])
except RuntimeError:

Check warning on line 4786 in distributed/scheduler.py

View check run for this annotation

Codecov / codecov/patch

distributed/scheduler.py#L4783-L4786

Added lines #L4783 - L4786 were not covered by tests
# Non-deterministic token
tok_lhs = tok_rhs = None

Check warning on line 4788 in distributed/scheduler.py

View check run for this annotation

Codecov / codecov/patch

distributed/scheduler.py#L4788

Added line #L4788 was not covered by tests

# Additionally check dependency names. This should only be necessary
# if run_specs can't be tokenized deterministically.
Expand Down

0 comments on commit 2e302a1

Please sign in to comment.