Skip to content

feat(orchestrate): run the tasks of a batch as one job in one worker - #62

Merged
nichinichisou0609 merged 1 commit into
redesign/depotfrom
redesign/batch-jobs
Oct 14, 2026
Merged

nichinichisou0609 merged 1 commit into
redesign/depotfrom
redesign/batch-jobs

Conversation

@nichinichisou0609

Copy link
Copy Markdown
Collaborator

Summary

  • Stage.batch(task) names a batch; the tasks of a stage sharing one form a job that a single worker runs in order, loading shared data once. Stage.end_batch(batch) runs after the job's last task.
  • Scheduler, memory admission and depot plan estimates work per job (CPU summed, peak = largest task peak).
  • A worker dying inside a job fails the running task; the job's remaining tasks are queued again for another worker.
  • Run log start events carry the job id.

Tests

  • Toy batched stage: one process per batch, load/run/drop order, depot identical to an unbatched run, with 0 and 2 workers.
  • A worker dying mid-job; job grouping; scheduler with jobs, requeue and stop; plan peak for a batched stage.

Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com

A stage can now name a batch per task (Stage.batch). The tasks of a stage
that share a batch form one job: one worker runs them one after another, so
what they share (such as a loaded bundle) is loaded once, and calls
Stage.end_batch after the last of them to drop it. A task without a batch is a
job alone.

Scheduling, memory admission and the plan's estimates work on jobs: a job's
CPU is the sum of its tasks', its peak the largest of theirs. When a worker
dies inside a job, the task it was running fails and the job's remaining
tasks run in another worker. The run log names each task's job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nichinichisou0609
nichinichisou0609 merged commit 998e552 into redesign/depot Oct 14, 2026
8 checks passed
@nichinichisou0609
nichinichisou0609 deleted the redesign/batch-jobs branch October 14, 2026 19: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