Skip to content

DESIGN: a plan for keyed partitions in flows (Partition and Reduce) - #175

Merged
winding-lines merged 1 commit into
mainfrom
flow-partition-plan
Nov 29, 2026
Merged

winding-lines merged 1 commit into
mainfrom
flow-partition-plan

Conversation

@winding-lines

Copy link
Copy Markdown
Contributor

Docs only: the plan for a keyed-partition operator in dista.flow, the base for group-by (and later joins and sort), as a new section of DESIGN.md after "Flows". No implementation.

What it settles:

  • Shape: Partition[T: ManyLike, parts] (a TaskMany per input, on all of its batches, returning parts pieces; the merge before splitting is the combiner) followed by Reduce[T: WithLike] (a TaskWith[Int, Piece, R] per partition on that piece from every input). The bench's group-by written as a flow is in the section.
  • Executor: two chains joined by a barrier; results handed out by partition index; the pieces are bounded by spilling, not budgets.
  • Memory: counts for the bench (384 pieces locally, 39,936 on AWS at 96 reducers), the head's 64 KiB inline limit as a hazard for small pieces (PR 3 keeps them on workers), spans not a limit here.
  • Failures: a loss before the barrier reruns the input (today's machinery); after it, v1 fails the flow; what the later rerun costs.
  • Keys: a stable unseeded partition_of, skew, empty partitions, exact checks; groups and a compile-time parts.
  • PRs: five, each with a gate, ending with bench/shuffle as a flow on sai beside the hand-written version and Ray, with proposed bars.
  • Open questions for the user, each with a default.

Two claims were compiled on Mojo 1.3.0.dev2026112605: the Seq[...] name check between operators works (and fails to compile on a mismatch), and ManyLike.Part's current Movable bound doesn't satisfy OpLike.Out.

🤖 Generated with Claude Code

https://claude.ai/code/session_017TycsyUqdnuDeZrYc3z6wV

A docs-only plan for a group-by inside dista.flow: a Partition operator
(a TaskMany per input, on its batches, making one piece per partition)
and a Reduce (a TaskWith per partition, on that piece from every input),
joined by a barrier. It settles the types and checks, the executor's two
chains, memory and spilling, losses before and after the barrier, the
hash, groups and sizing, and lists five PRs ending with bench/shuffle as
a flow on sai beside the hand-written version and Ray.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017TycsyUqdnuDeZrYc3z6wV
@winding-lines
winding-lines merged commit d4f6935 into main Nov 29, 2026
12 checks passed
@winding-lines
winding-lines deleted the flow-partition-plan branch November 29, 2026 13:14
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.

1 participant