YUFENG GUO: Are you looking to improve the reproducibility
and reliability of your data science and machine learning
workflows and training jobs?
Then you've got try out AI Platform Pipelines.
[MUSIC PLAYING]
Welcome to AI Adventures where we explore the art, science,
and tools of machine learning.
My name is Yufeng Guo, and on this episode
we're going to explore how to set up AI Platform Pipelines
to address your MLOps needs.
MLOps is all the rage these days--
a combination of machine learning and operations.
It applies many DevOps best practices
to the machine learning ecosystem.
We often hear about how important
it is to have a well-running continuous integration
and deployment pipeline for software development.
So as your machine learning setup matures,
you should begin to incorporate these best practices as well.
AI Platform Pipelines allows you to orchestrate your machine
learning workflows as reproducible and reusable
pipelines.
Specifically, it handles the process
of setting up Kubeflow Pipelines with TensorFlow Extended
on Google Kubernetes Engine.
Let's talk a little more about each of these terms.
Kubeflow is an open-source toolkit
for running machine learning workflows on Kubernetes.
Kubeflow Pipelines is a component of Kubeflow
that provides a platform for building and deploying
ML workflows, called pipelines, structured
as directed acyclic graphs.
TensorFlow Extended, or TFX, is also an open-source project,
which you can use to define your TensorFlow-based machine
learning workflows as a pipeline.
TFX provides a Pipeline Template that
includes components you can reuse to ingest and transform
data, train and evaluate a model,
deploy a train model for inference, and so on.
By reusing TFX components, you can orchestrate your machine
learning process without the need
to build custom components for every single step.
Setting up AI Platform Pipelines is quite easy.
The team has worked hard to make this step as
simple as possible, especially for those
who are not familiar with Kubernetes or DevOps.
There's a dedicated dashboard for our pipelines in the AI
Platform menu in Cloud Console.
From there, we can deploy a new pipeline.
This button will actually take us
to the Cloud Marketplace, which is the same place we get
our deep learning VM images.
After we click Launch, we are presented with a configuration
page which has two sections.
First, we need to either create a Kubernetes cluster
or select an existing cluster.
Notice that this is zone-specific.
If you're creating a new cluster,
be sure to check the box to allow access to cloud APIs.
This action grants the cluster access to your project
and saves you the effort of creating and managing
a service account or creating a Kubernetes secret.
Once that's all set, click Create Cluster
and then wait while the cluster is created.
During this time, the necessary VMs will be provisioned,
the Kubernetes cluster will be created,
and the Kubernetes software is installed.
What I really like about this process
is that Kubernetes has been abstracted away and automated.
Once your cluster is created, all we need to do
is give our pipelines instance a name and click Deploy.
Now, we wait some more while the Kubeflow pipeline
software is installed.
Once Pipelines is deployed to your cluster,
you end up mostly working in the Pipelines Dashboard UI.
The Pipelines Dashboard uses a left-hand navigation bar
with a number of different categories,
beginning with Getting Started which
contains a handful of useful demos and tutorials
with examples of both TFX and Kubeflow Pipelines.
Next up is the Pipelines Menu--
the main event and the reason we're here.
We can see a list of all our pipelines.
The setup process deployed a few demo and tutorial pipelines
to the cluster so you can get started right away.
Let's start by running the data passing pipeline
by clicking on its name and the Create Run button.
We can include it in an experiment
or just leave the field blank to associate
it with the default experiment which acts as a catchall.
Notice that this pipeline has no parameters,
so we can click Start without entering any additional fields.
Now we have a pipeline running.
Notice the dashboard is now showing us the list of runs
in the Experiments tab.
Let's click on our run and see it in progress.
Notice the graph will animate each component in the pipeline
as it runs.
After a little while, the job is finished.
And the green check replaces that timer icon.
Pipelines are like templates.
They define what needs to be run but don't represent
the actual execution of code.
That's what runs are for.
You must run a pipeline in order to get any output.
Each time you run a pipeline, a new set of outputs
are produced.
These runs are single executions of a pipeline.
And individual runs are associated together
into an experiment.
You can name your experiments whatever you want.
And you're not constrained to having
the same type of pipeline runs in one experiment.
So you can include different types
of pipelines in the same experiment if you want to.
Running pipelines can output artifacts.
These artifacts are viewed by drilling down
into an individual run, or by clicking the Artifacts
tab in the left-hand menu.
Kubeflow Pipelines supports the following output viewers
currently-- confusion matrix, markdown, ROC curve, table,
TensorBoard, and even a web app if you really
want to get fancy.
Now you might be thinking, this pipelines
thing sounds really awesome, but how
do I create my own pipeline?
At the end of the day, we have two different ways
to make pipelines.
AI Platform Pipelines supports both the TFX SDK
and the Kubeflow Pipelines SDK.
How do we choose which one to use?
Well, if you're working with TensorFlow, use TFX.
It's designed for TensorFlow and will make your TensorFlow code
run seamlessly.
Otherwise, use Kubeflow Pipelines.
It's designed for any arbitrary library.
So you can run everything from your scikit-learn models
to Py Torch in your pipeline.
TFX has the advantage of more pre-built components
and is a more opinionated approach,
while Kubeflow Pipelines is more open-ended
and allows you to design your own pipeline
components from scratch.
We'll be looking at more details on how
to use these two SDKs in future episodes of AI Adventures.
But for now, I've linked to two longer videos exploring
AI Platform Pipelines in more detail in the description
below.
Thanks for watching this episode of Cloud AI Adventures.
If you enjoyed it, click that Like button
and subscribe to get all the latest episodes right
when they come out.
I'm Yufeng Guo on Twitter @YufengG.
And if you're looking for longer form machine learning and cloud
content, be sure to check out the Adventures
in the Cloud YouTube channel, which I have linked below
in the description.
For now, try setting up your very own pipeline on GKE
using AI Platform Pipelines on Google Cloud Platform.
[MUSIC PLAYING]