Skip to content

Commit

Permalink
Smarter stealing with dependencies (#7024)
Browse files Browse the repository at this point in the history
  • Loading branch information
hendrikmakait authored Sep 29, 2022
1 parent e7057c5 commit 4052350
Show file tree
Hide file tree
Showing 2 changed files with 480 additions and 23 deletions.
9 changes: 5 additions & 4 deletions distributed/stealing.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import logging
from collections import defaultdict, deque
from collections.abc import Container
from functools import partial
from math import log2
from time import time
from typing import TYPE_CHECKING, Any, ClassVar, TypedDict, cast
Expand Down Expand Up @@ -522,12 +523,12 @@ def _get_thief(
) -> WorkerState | None:
valid_workers = scheduler.valid_workers(ts)
if valid_workers is not None:
subset = potential_thieves & valid_workers
if subset:
return next(iter(subset))
valid_thieves = potential_thieves & valid_workers
if valid_thieves:
potential_thieves = valid_thieves
elif not ts.loose_restrictions:
return None
return next(iter(potential_thieves))
return min(potential_thieves, key=partial(scheduler.worker_objective, ts))


fast_tasks = {"split-shuffle"}
Loading

0 comments on commit 4052350

Please sign in to comment.