Skip to content

Design: pooled task execution for wide fan-out (nf-spawn#70) - #454

Merged
scttfrdmn merged 2 commits into
mainfrom
design/pooled-task-execution
Jul 31, 2026
Merged

scttfrdmn merged 2 commits into
mainfrom
design/pooled-task-execution

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

What

Adds docs/pooled-task-execution-design.md — a design (no code) for a reusable spawn pooled execution mode to fix dispatch-bound fan-out (nf-spawn#70).

Measured problem (real N=108 chr20 bcftools): peaked ~60/108 concurrent, took 5m44s just to dispatch. Root cause is two-layered: (a) serial dispatch, and (b) a boot-per-task tax — by Little's Law, short tasks self-terminate faster than new ones launch, so even instant dispatch can't reach N. Only worker reuse fixes (b).

The plan

Pool-first, bulk deferred. cohort's per-entity launch is already concurrent (reconcile.go:222), so a warm pool provisioned via cohort dissolves the dispatch bottleneck and attacks the boot tax; bulk RunInstances/CreateFleet is a constant-factor optimization → Phase 3.

Reusable spawn infra (all adapters share the fan-out shape):

  • pkg/taskcohort (new) — cohort adapter mirroring pkg/mpicohort; task fan-out is the easy per-entity-placement case.
  • pkg/queue (extend) — already runs many jobs from a queue on one instance; generalize to a pool-shared queue + per-task workspace reset.
  • cohort — expected zero core change (PartialCohort MinViable = best-effort/eventual; Actuator.Start = warm pool; rung/AZ chain = capacity fallback).
  • nf-spawn — needs a run-scoped lifecycle hook (shared with nf-spawn#69).

Phases: P0 cheap wins (nf-spawn non-blocking submit — spore-host/nf-spawn#75; spawn sizing-skip already merged #413) · P1 pooled workers (spawn, Substrate-tested) · P2 nf-spawn run-scoped integration + real N=108 validation · P3 optional bulk launch + fan-in.

Design only — no code in this PR. Refs nf-spawn#70.

@scttfrdmn
scttfrdmn force-pushed the design/pooled-task-execution branch from 899b22c to f379d90 Compare July 31, 2026 02:43
@scttfrdmn
scttfrdmn merged commit 8f34345 into main Jul 31, 2026
6 checks passed
@scttfrdmn
scttfrdmn deleted the design/pooled-task-execution branch July 31, 2026 02:45
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