Skip to content

feat: re-expose the embedder public API a distributed driver needs#29

Draft
mdashti wants to merge 1 commit into
moe/protocol-grpc-shmfrom
moe/embedder-api
Draft

feat: re-expose the embedder public API a distributed driver needs#29
mdashti wants to merge 1 commit into
moe/protocol-grpc-shmfrom
moe/embedder-api

Conversation

@mdashti

@mdashti mdashti commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

This PR re-exposes the public API an out-of-crate driver/embedder needs to run distributed execution, which datafusion-contrib#512 removed. It stacks on the transport-completion PR (#27).

What

  • DistributedExec::prepare_in_process_plan: routes and dispatches every stage through the registered transport and returns the head stage, for an embedder that owns the runtime and drives it synchronously (no background execute() task).
  • DistributedExec::metrics_store() + public MetricsStore / MetricsStore::insert: so a driver can collect worker metrics out of crate.
  • NetworkBoundary::route_partition / partitions_per_consumer_task + PartitionRoute: the shuffle routing a transport or embedder that places produced partitions reads, instead of re-deriving it. NetworkCoalesceExec overrides route_partition with an error (its consumers read per-producer-task groups, not slices).
  • decode_task_metrics: the worker-metrics proto to plain TaskMetrics decode.

Why

datafusion-contrib#512 dropped these as not-transport-concerns, with "what's worth making public in a follow up." This is that follow-up: a real embedder (pg_search) and a real transport's own in-process test need them. If a transport or embedder cannot be written without re-adding core API, the abstraction was not complete; this is the missing surface.

Note

prepare_in_process_plan dispatches through the internal QueryCoordinator, which spawns background tasks, so it stashes the coordinator and the caller must keep the DistributedExec alive while driving the head stage. Surfacing the end-of-query / metrics-drain lifecycle for an embedder-owned runtime is a follow-up.

An out-of-crate driver dispatches a query and drives the head stage itself,
so it needs prepare_in_process_plan, the metrics store and a public insert,
the partition-routing seam on NetworkBoundary, and a no-gRPC
decode_task_metrics to file proto metric frames into the plain store.
@mdashti mdashti force-pushed the moe/embedder-api branch from 328e142 to 3439f34 Compare July 1, 2026 23:15
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