|
| 1 | +--- |
| 2 | +title: ML Pipeline Architecture |
| 3 | +weight: 8 |
| 4 | + |
| 5 | +### FIXED, DO NOT MODIFY |
| 6 | +layout: learningpathall |
| 7 | +--- |
| 8 | + |
| 9 | +# ML Pipeline Architecture |
| 10 | + |
| 11 | +In this section, you explore the architecture behind the distributed machine learning pipeline built using Flyte and gRPC on Google Axion Arm-based infrastructure. |
| 12 | + |
| 13 | +This architecture demonstrates how modern ML workflows are orchestrated using workflow engines while delegating specific tasks to distributed services. |
| 14 | + |
| 15 | +Flyte manages the pipeline orchestration, while gRPC enables efficient communication between workflow tasks and external services. |
| 16 | + |
| 17 | + |
| 18 | +## System architecture |
| 19 | + |
| 20 | +The ML pipeline consists of several tasks executed sequentially within the Flyte workflow. |
| 21 | + |
| 22 | +```text |
| 23 | +Flyte Workflow Engine |
| 24 | + │ |
| 25 | + ▼ |
| 26 | +Dataset Loader Task |
| 27 | + │ |
| 28 | + ▼ |
| 29 | +Data Preprocessing Task |
| 30 | + │ |
| 31 | + ▼ |
| 32 | +Feature Engineering Service (gRPC) |
| 33 | + │ |
| 34 | + ▼ |
| 35 | +Model Training Task |
| 36 | + │ |
| 37 | + ▼ |
| 38 | +Model Evaluation Task |
| 39 | + │ |
| 40 | + ▼ |
| 41 | +Pipeline Result |
| 42 | +``` |
| 43 | + |
| 44 | +Each component in the workflow performs a specific function within the machine learning pipeline. |
| 45 | + |
| 46 | +## Components |
| 47 | + |
| 48 | +### Flyte workflow engine |
| 49 | +Flyte orchestrates the pipeline execution. It manages task dependencies, workflow execution, and data flow between tasks. |
| 50 | + |
| 51 | +Key capabilities include: |
| 52 | + |
| 53 | +- defining ML pipelines as Python workflows |
| 54 | +- managing task dependencies |
| 55 | +- enabling reproducible ML experiments |
| 56 | +- scaling pipeline execution |
| 57 | + |
| 58 | +### Dataset loader |
| 59 | +The dataset loader task simulates loading a training dataset that will be used for model training. |
| 60 | + |
| 61 | +In real ML systems, this step might include: |
| 62 | + |
| 63 | +- loading datasets from object storage |
| 64 | +- retrieving data from data lakes |
| 65 | +- accessing distributed datasets |
| 66 | + |
| 67 | +### Data preprocessing |
| 68 | +Data preprocessing transforms raw data into a format suitable for model training. |
| 69 | + |
| 70 | +Typical preprocessing steps include: |
| 71 | + |
| 72 | +- cleaning data |
| 73 | +- normalizing values |
| 74 | +- handling missing data |
| 75 | +- encoding categorical variables |
| 76 | + |
| 77 | +### Feature engineering service (gRPC) |
| 78 | +Feature engineering is implemented as a gRPC microservice. |
| 79 | + |
| 80 | +This design allows feature-generation logic to run independently of the workflow engine. |
| 81 | + |
| 82 | +Benefits include: |
| 83 | + |
| 84 | +- scalable feature generation |
| 85 | +- reusable feature services |
| 86 | +- independent scaling of compute resources |
| 87 | +- low-latency communication using gRPC |
| 88 | + |
| 89 | +### Model training |
| 90 | +The training task uses generated features to train a machine learning model. |
| 91 | + |
| 92 | +In production systems, this stage might include: |
| 93 | + |
| 94 | +- training regression models |
| 95 | +- training classification models |
| 96 | +- training deep learning models |
| 97 | + |
| 98 | +### Model evaluation |
| 99 | +The evaluation step measures model performance. |
| 100 | + |
| 101 | +Typical evaluation metrics include: |
| 102 | + |
| 103 | +- accuracy |
| 104 | +- precision |
| 105 | +- recall |
| 106 | +- F1 score |
| 107 | + |
| 108 | +Based on the results, the workflow can determine whether to retrain the model. |
| 109 | + |
| 110 | +## Pipeline execution flow |
| 111 | + |
| 112 | +The ML pipeline follows this execution sequence. |
| 113 | + |
| 114 | +```text |
| 115 | +Load Dataset |
| 116 | + │ |
| 117 | + ▼ |
| 118 | +Preprocess Data |
| 119 | + │ |
| 120 | + ▼ |
| 121 | +Feature Engineering (gRPC Service) |
| 122 | + │ |
| 123 | + ▼ |
| 124 | +Model Training |
| 125 | + │ |
| 126 | + ▼ |
| 127 | +Model Evaluation |
| 128 | + │ |
| 129 | + ▼ |
| 130 | +Pipeline Result |
| 131 | +``` |
| 132 | + |
| 133 | +Each task executes sequentially while Flyte manages the workflow orchestration. |
| 134 | + |
| 135 | +## Benefits of this architecture |
| 136 | + |
| 137 | +This architecture provides several advantages: |
| 138 | + |
| 139 | +- scalable ML pipeline orchestration |
| 140 | +- distributed feature engineering services |
| 141 | +- modular pipeline components |
| 142 | +- efficient task communication using gRPC |
| 143 | +- reproducible machine learning workflows |
| 144 | + |
| 145 | +## Running on Axion |
| 146 | +This example demonstrates how machine learning workflows can run efficiently on Google Axion Arm-based processors. |
| 147 | + |
| 148 | +Benefits include: |
| 149 | + |
| 150 | +- high performance per watt |
| 151 | +- efficient execution of data pipelines |
| 152 | +- scalable infrastructure for ML workloads |
| 153 | +- optimized performance for modern cloud applications |
| 154 | + |
| 155 | +## What you've learned |
| 156 | + |
| 157 | +In this section, you explored the architecture behind the ML training pipeline. |
| 158 | + |
| 159 | +You learned how: |
| 160 | + |
| 161 | +- Flyte orchestrates ML workflows |
| 162 | +- gRPC services enable distributed feature engineering |
| 163 | +- pipeline tasks interact through workflow dependencies |
| 164 | +- ML pipelines can scale across distributed infrastructure |
| 165 | + |
| 166 | +This architecture underpins modern distributed machine learning systems running on Arm-based cloud infrastructure. |
0 commit comments