Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shuffle p2p #8813

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions distributed/shuffle/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ async def _receive(self, data: list[tuple[_T_partition_id, Any]]) -> None:
"""Receive shards belonging to output partitions of this shuffle run"""

def add_partition(
self, data: _T_partition_type, partition_id: _T_partition_id
self, data: _T_partition_type, partition_id: _T_partition_id, **kwargs: Any
) -> int:
self.raise_if_closed()
if self.transferred:
Expand All @@ -351,13 +351,13 @@ def add_partition(
context_meter.meter("p2p-shard-partition-noncpu"),
context_meter.meter("p2p-shard-partition-cpu", func=thread_time),
):
shards = self._shard_partition(data, partition_id)
shards = self._shard_partition(data, partition_id, **kwargs)
sync(self._loop, self._write_to_comm, shards)
return self.run_id

@abc.abstractmethod
def _shard_partition(
self, data: _T_partition_type, partition_id: _T_partition_id
self, data: _T_partition_type, partition_id: _T_partition_id, **kwargs: Any
) -> dict[str, tuple[_T_partition_id, Any]]:
"""Shard an input partition by the assigned output workers"""

Expand Down
2 changes: 1 addition & 1 deletion distributed/shuffle/_rechunk.py
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,7 @@ async def _receive(
raise

def _shard_partition(
self, data: np.ndarray, partition_id: NDIndex
self, data: np.ndarray, partition_id: NDIndex, **kwargs: Any
) -> dict[str, tuple[NDIndex, list[tuple[NDIndex, tuple[NDIndex, np.ndarray]]]]]:
out: dict[str, list[tuple[NDIndex, tuple[NDIndex, np.ndarray]]]] = defaultdict(
list
Expand Down
Loading
Loading