Prediction and inference
Beam provides different ways to implement inference as part of your pipeline. You can run your ML model directly in your pipeline and apply it on big scale datasets, both in batch and streaming pipelines.
Use the RunInference API
The RunInference API is available with the Beam Python SDK versions 2.40.0 and later. You can use Apache Beam with the RunInference API to use machine learning (ML) models to do local and remote inference with batch and streaming pipelines. Starting with Apache Beam 2.40.0, PyTorch and Scikit-learn frameworks are supported. Tensorflow models are supported through
tfx-bsl. For more deatils about using RunInference with Python, see Machine Learning with Python.
The RunInference API is available with the Beam Java SDK versions 2.41.0 and later through Apache Beam’s Multi-language Pipelines framework. For information about the Java wrapper transform, see RunInference.java. To try it out, see the Java Sklearn Mnist Classification example.
You can create multiple types of transforms using the RunInference API: the API takes multiple types of setup parameters from model handlers, and the parameter type determines the model implementation.
|I want to use the RunInference transform||Modify a Python pipeline to use an ML model|
|I want to use RunInference with PyTorch||Use RunInference with PyTorch|
|I want to use RunInference with Sklearn||Use RunInference with Sklearn|
|I want to use pre-trained models (PyTorch, Scikit-learn, or TensorFlow)||Use pre-trained models|
|I want to build a pipeline with multiple models||Multi-Model Pipelines|
|I want to build a custom model handler with TensorRT||Use TensorRT with RunInference|
|I want to use LLM inference||Large Language Model Inference|
Last updated on 2023/09/29
Have you found everything you were looking for?
Was it all useful and clear? Is there anything that you would like to change? Let us know!