Skip to content

Commit 5337783

Browse files
Jutadamccorm
andauthored
AI/ML pipelines master page documentation (#23443)
* add AI/ML pipelines master page to documentation * Update website/www/site/content/en/documentation/ml/overview.md Co-authored-by: Danny McCormick <[email protected]> Co-authored-by: Danny McCormick <[email protected]>
1 parent 9c2fb3e commit 5337783

File tree

3 files changed

+79
-0
lines changed

3 files changed

+79
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
title: "Overview"
3+
---
4+
<!--
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
18+
# AI/ML pipelines
19+
20+
Beam <3 Machine Learning. Being productive and successful as a machine learning practitioner is often dependent on your ability to efficiently leverage large volumes of data in a way that is uniquely tailored to your resources, requirements and budget. When starting your next AI/ML project or upscaling an existing one, a vital tool you should consider adding to your project is Beam.
21+
22+
Beam enables you to process large volumes of data, both for preprocessing and for inference. It allows you to experiment with your data during the exploration phase of your project, while providing a seamless transition to upscaling your data pipelines as part of your MLOps ecosystem in a production environment. It allows you to run your model in production on a varying data load, both in batch and streaming.
23+
24+
## AI/ML workloads
25+
26+
Let’s take a look at the different building blocks that we need to build an end-to-end AI/ML use case, and where Beam will come in handy in building those blocks.
27+
28+
![Overview of AI/ML building blocks & where Beam can be used](/images/ml-workflows.svg)
29+
30+
1. Data ingestion: incoming new data will be stored in your filesystem, database or published on a messaging queue.
31+
2. **Data validation**: once you have received your data you need to check the quality of your data such as detecting outliers and reporting on standard deviations and class distributions.
32+
3. **Data preprocessing**: after validating your data, you need to transform it so that it is ready to be used for training your model.
33+
4. Model training: once your data is ready, you can start training your AI/ML model. This step will typically be repeated multiple times depending on the quality of your trained model.
34+
5. Model validation: before deploying your new model you need to validate its performance and accuracy.
35+
6. **Model deployment**: finally you can deploy your model, meaning it can run inference on any new or existing data.
36+
37+
All of these steps can be executed multiple times, as your data might grow and evolve over time and you want your model to stay up to date and guarantee its best performance. This is why it is very important to apply MLOps to your project, meaning that you aim to automate the AI/ML workflows throughout the model and data lifecycle. This can be achieved by using orchestrators that automate this flow and handle the transition between the different building blocks in your project.
38+
39+
Beam can be used for data validation, data preprocessing and model deployment/inference. We will now take a look at these different building blocks in more detail and at how they can be orchestrated. Finally, you can also find full examples of AI/ML pipelines in Beam.
40+
41+
## Data processing
42+
43+
Data validation and preprocessing can be done in Beam by setting up data pipelines that transform your data and output metrics computed from your data. Beam has a rich set of [IO connectors](https://beam.apache.org/documentation/io/built-in/) for ingesting and writing data, which means you can easily integrate it with your existing filesystem, database or messaging queue. When developing your ML model, you can also first explore your data with the [Beam DataFrame API](https://beam.apache.org/documentation/dsls/dataframes/overview/) so that you can identify and implement the required preprocessing steps allowing you to iterate faster towards production. Another common pattern is that the steps executed during preprocessing need to also be applied before running inference, in which case you can use the same Beam implementation twice. Lastly, if you need to do post-processing after running inference, this can also be done as part of your model inference pipeline.
44+
45+
## Inference
46+
47+
There are several ways to use and deploy your model:
48+
1. Making it available for online predictions via an API
49+
2. Running it in real-time as new data becomes available in a pipeline
50+
3. Running it in batch on an existing dataset
51+
52+
Beam is ideally suitable for the last 2 use cases. In this case your data will run through a pipeline (streaming or batch), and you can obtain predictions by running inference in one of the steps of your pipeline. Beam provides the [RunInference API](https://beam.apache.org/documentation/sdks/python-machine-learning/) to facilitate the integration of your model into a pipeline step. When running your model, a common requirement is to enable GPU execution. Beam also provides support for this.
53+
54+
## Orchestrators
55+
56+
In order to automate and track the AI/ML workflows throughout your project, you can use orchestrators such as [Kubeflow pipelines](https://www.kubeflow.org/docs/components/pipelines/introduction/) (KFP) or [TensorFlow Extended](https://www.tensorflow.org/tfx) (TFX) that automate your different building blocks and handle the transitions between them. When you use Beam as one of the building blocks in your project, these orchestrators will then be able to launch your Beam job and keep track of the input and output of your pipeline. This is essential when moving your AI/ML solution into production as it allows you to handle your model and data over time and to guarantee good results and reproducibility.
57+
58+
## Examples
59+
60+
You can find examples of end-to-end AI/ML pipelines for several use cases:
61+
* [Online Clustering in Beam](/documentation/ml/online-clustering)

website/www/site/layouts/partials/section-menu/en/documentation.html

+1
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@
212212
<li class="section-nav-item--collapsible">
213213
<span class="section-nav-list-title">AI/ML pipelines</span>
214214
<ul class="section-nav-list">
215+
<li><a href="/documentation/ml/overview/">Overview</a></li>
215216
<li><a href="/documentation/ml/online-clustering/">Online Clustering</a></li>
216217
</ul>
217218
</li>

0 commit comments

Comments
 (0)