liveBook · Manning

Machine learning workflow

As explained in Distributed Machine Learning Patterns

The stages and activities involved in developing, deploying, operating, maintaining, and retiring machine learning models and systems.

A machine learning workflow, also called a machine learning pipeline, connects components into an end-to-end system. A simple flow ingests data, trains a model, and serves predictions; practical flows add branches, selection, aggregation, and performance controls. section 5.1 section 5.0

Figure 5.1 A diagram showing a simple machine learning workflow, including data ingestion, model training, and model serving. The arrows indicate directions. For example, the arrow on the right-hand side denotes the order of the step execution (e.g., the workflow executes the model serving step after the model training step is completed).
05-01

Follow the dependency chain from data ingestion through training to serving; each arrow establishes the next step’s execution order. section 5.1

Workflow structure determines what can run and when. A sequential workflow completes steps one after another. More complex workflows can launch multiple training paths after one ingestion step, then route selected models into separate serving steps. A DAG view applies only when dependencies contain no closed loop. section 5.1 section 5.2.1

Build scalable workflows by applying patterns to the bottlenecks created by component dependencies:

  • Use fan-out to distribute work across model-training paths and fan-in to compose results, such as selecting strong models or aggregating predictions. section 5.2 section 5.9
  • Use synchronous and asynchronous execution to avoid letting a slow training step delay every following step. section 5.3.1 section 5.9
  • Use step memoization to skip duplicate work, especially data ingestion when the cached dataset remains fresh. section 5.4.1 section 7.5.2
  • Plan failure handling around workflow dependencies: retrying an isolated failed step can preserve earlier ingestion work, while multi-branch failures require choices that balance completion time and user impact. section 6.3 section 6.3.1

Reusable image-classification pipeline

A reproducible pipeline can ingest and cache images, train three models, select the top model, serve it, and aggregate predictions for users. When data has not changed, a cache timestamp can omit ingestion; when training durations differ, execution patterns can reduce downstream blocking. section 7.1.2 section 7.5.1 section 7.5.2

A workflow is more than a fixed chain of jobs: it packages components so they can be rerun when data changes or models are revised, while making trade-offs among reuse, concurrency, efficiency, and failure recovery explicit. At production scale, operations add scheduling, metadata, observability, monitoring, deployment, and collaboration concerns. section 5.2 section 6.0 section 6.1

Argo-based implementation

An end-to-end workflow can be defined in Argo Workflows by connecting implemented components sequentially, then optimized for future runs with step memoization. Model serving may autoscale with request traffic. section 9.4

How Distributed Machine Learning Patterns covers it

How deep it goes
Defines pipelines and dependency forms, then elaborates composition, concurrency, memoization, and failure-handling trade-offs.
Examples
Uses YouTube-8M entity tagging and a Fashion-MNIST image-classification pipeline with multiple models, selection, serving, and aggregated predictions.
What it assumes
Assumes familiarity with Python and Bash scripting and refreshes basic Argo Workflows before implementation.
What you can do after
Apply it via Argo Workflows to compose and optimize an end-to-end pipeline with connected component steps and memoization.
How it connects
Connects data ingestion, distributed model training, model serving, DAGs, fan-in and fan-out, step memoization, and MLOps.

Also explained in

Compare how 7 books explain machine learning workflow →

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.