Google finally did it and now the dream came true: we are now able to run serverless Kubeflow pipelines from the former AI Platform

There is this big problem for Data Scientists and ML Engineers that work at small companies (or small teams): a tremendous lack of human resources and time. Because of that, we have a very limited scope on the technologies we can use, or even test.

On the MLOps side, scope was a problem. There weren’t any managed MLOps pipelines solutions on GCP and the only way to adopt experiment pipelining as a practice was to deploy a full-fledged Kubeflow instance. We could rely on AI Platform Pipelines, with a semi-managed deployment, but there were still issues with GKE Cluster babysitting, which takes time (and is boring).

Vertex AI came from the skies to solve our MLOps problem with a managed — and reasonably priced—alternative. Vertex AI comes with all the AI Platform classic resources plus a ML metadata store, a fully managed feature store, and a fully managed Kubeflow Pipelines runner.

In this post, we will talk about ML Pipelines, Kubeflow Pipelines, how to create them to fill your custom ML needs, and how to run them in Vertex AI Pipelines and analyze their results, with a small example code.

If you are just here for the example code, here it is.

A quick recap on MLOps

As Vertex AI docs state:

Machine learning operations (MLOps) is the practice of applying DevOps strategies to machine learning (ML) systems. DevOps strategies let you efficiently build and release code changes, and monitor systems to ensure you meet your reliability goals.

MLOps extends this practice to help you reduce the amount of time that it takes to reliably go from data ingestion to deploying your model in production, in a way that lets you monitor and understand your ML system.

As a summary, MLOps is the practice that lets your “organize” your Data Science and ML area to create reliable systems, in order to fulfill the needs of your company.

As a consequence, to apply good MLOps practices, you need reliable, easy to use tools, so you can govern, monitor and execute all your data jobs, from ingestion to modelling to monitoring.

Pipelines, Kubeflow and Vertex

To apply MLOps, one of the most important steps is experimentation, so we need a robust experimentation tool. We want to be able to track our experiments, compare them, reproduce them and save all the results and data used.

Kubeflow Pipelines comes to solve this problem. KFP, for short, is a toolkit dedicated to run ML Workflows (as experiments for model training) on Kubernetes, and it does it in a very clever way:

Along with other ways, Kubeflow lets us define a workflow as a series of Python functions that pass results, and Artifacts for one another.

For each Python function, we can define dependencies (for libs used) and Kubeflow will create a container to run each function in an isolated way, and passing any wanted object to a next step on the workflow. We can set needed resources, (as memory or GPUs) and it will provision them for our workflow step. It feels like magic.

Once you’ve ran your pipeline, you will be able to see it in a nice UI, like this:

Source: print by author, running example open source code

#data-science #machine-learning #mlops #serverless

Serverless Machine Learning Pipelines with Vertex AI: An Introduction
1.30 GEEK