liveBook · Manning

Sequential processing

As explained in Distributed Machine Learning Patterns

A workflow pattern in which dependent processing proceeds in coordinated order, with an operation waiting for required preceding work to complete.

Sequential processing runs dependent workflow steps one at a time: a later operation remains blocked until the required earlier operation completes. In a machine-learning pipeline, data ingestion must finish before model training can begin. This ordering is useful where a later step needs an earlier result, but it makes overall completion sensitive to the slowest required step. section 5.3.2 section 5.0

The cost appears when independent or partly independent work is forced into the sequence. If several model-training jobs feed model selection, one unusually long job delays selection and serving for all results. A single slow step can therefore block the rest of the workflow even when shorter jobs have already produced usable models. section 5.3 section 7.5.1

Choose the execution relationship from the dependency and delivery requirements:

  • Keep steps sequential when the next step cannot start without the preceding output, such as ingestion before training. section 5.3.2
  • Run synchronous steps concurrently after their shared dependencies are met when similar workloads can finish at roughly the same time. section 5.3.2
  • Use asynchronous continuation when completed partial results can serve users without waiting for remaining work. section 5.3.2 section 7.5.2

Training jobs that delay model selection

Three training steps begin after ingestion, but one takes two weeks while the others take one. If model selection requires every trained model, it waits an extra week for the slowest job. Where early results are acceptable, completed short-running models can instead be sent to serving while the long-running job continues; later models add aggregated inference results. This improves responsiveness, but early simpler models may identify fewer entities than the delayed model. section 5.3 section 5.3.3 section 7.5.2

Figure 5.14 A workflow that illustrates the duration differences for the three model training steps
05-14

Compare the unequal training durations to see how a required slow step extends a dependent workflow’s completion time. section 5.3

How Distributed Machine Learning Patterns covers it

How deep it goes
Defines blocking step order and contrasts it with concurrent synchronous and nonblocking asynchronous execution.
Examples
Uses ingestion before training and uneven model-training durations that delay selection and serving.
What it assumes
Assumes familiarity with machine-learning workflow steps such as ingestion, training, selection, and serving.
What you can do after
Evaluate whether dependent steps must wait or can proceed through synchronous or asynchronous execution.
How it connects
Connects data ingestion, model training, model selection, model serving, synchronous patterns, and asynchronous patterns.

Also explained in

Compare how 7 books explain sequential processing →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Distributed Machine Learning Patterns. The section links point to the parts of the book it draws on.