From 1b14f4a64425b00b262f78868e86e4553c624fc4 Mon Sep 17 00:00:00 2001 From: Patrick Hoefler <61934744+phofl@users.noreply.github.com> Date: Wed, 20 Nov 2024 12:28:50 +0100 Subject: [PATCH 1/2] Block fusion for barrier tasks --- distributed/shuffle/_core.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/distributed/shuffle/_core.py b/distributed/shuffle/_core.py index 010d7d880d..cf84b229de 100644 --- a/distributed/shuffle/_core.py +++ b/distributed/shuffle/_core.py @@ -584,6 +584,7 @@ def p2p_barrier(id: ShuffleId, *run_ids: int) -> int: class P2PBarrierTask(Task): spec: ShuffleSpec + block_fusion: bool __slots__ = tuple(__annotations__) @@ -598,6 +599,7 @@ def __init__( ): self.spec = spec super().__init__(key, func, *args, **kwargs) + self.block_fusion = True def __repr__(self) -> str: return f"P2PBarrierTask({self.key!r})" From 0f2f156fa899e6d56de32cbced1b182eeeddb86f Mon Sep 17 00:00:00 2001 From: Patrick Hoefler <61934744+phofl@users.noreply.github.com> Date: Wed, 20 Nov 2024 13:41:36 +0100 Subject: [PATCH 2/2] Migrate to property --- distributed/shuffle/_core.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/distributed/shuffle/_core.py b/distributed/shuffle/_core.py index cf84b229de..a3f9ce327d 100644 --- a/distributed/shuffle/_core.py +++ b/distributed/shuffle/_core.py @@ -584,7 +584,6 @@ def p2p_barrier(id: ShuffleId, *run_ids: int) -> int: class P2PBarrierTask(Task): spec: ShuffleSpec - block_fusion: bool __slots__ = tuple(__annotations__) @@ -599,7 +598,10 @@ def __init__( ): self.spec = spec super().__init__(key, func, *args, **kwargs) - self.block_fusion = True def __repr__(self) -> str: return f"P2PBarrierTask({self.key!r})" + + @property + def block_fusion(self) -> bool: + return True