- [Instructor] Building an ML application
involves developing models, data pipelines,
training pipelines, inference pipelines,
and a set of validation tests.
In this video, we will explore how you can manage
your models using SageMaker's Model Registry.
With the SageMaker Model Registry,
you can track model versions, their metadata,
group models by use case,
and track model performance metric baselines
in a central repository where it's easy to choose
the right model for deployment
based on your business requirements.
This is often a key feature to enable transitioning
the ML workflow from data scientists to ML engineers.
When data scientists are working in their notebook
or using training pipelines,
they can register the models they train
in a model group in SageMaker's Model Registry.
Model groups will typically contain
multiple versions of model,
each corresponding to a iteration of model training.
These new versions could correspond
to a new set of hyperparameters that was used to train
a model or a new version of a dataset.
When models are in the registry,
MLOps engineers can pick which models make it to production
by reviewing the performance metrics.
Then they can approve models for deployment
and they can integrate this approval workflow
with their CICD pipelines
and have automated model deployment.
They can view the lineage of these models as well,
all from a single place.
Now let's look at a notebook,
where we take a model that we've already trained
and catalog it in the model registry.
When we register our model in the model registry,
we first create the model by providing
the model artifact that's stored in S3,
and then we specify which group
the model needs to be added to in the model registry.
Along with specifying the group, we can provide information
such as custom metadata properties.
For example, here I'm specifying the model type as a CNN.
We specify our model_metrics
and, finally, we specify an approval_status.
The approval_status typically indicates
whether or not the model is a candidate for deployment.
When registering our model,
we register it with a state PendingManualApproval,
which means in the model registry users have the ability
to, through the UI, approve or reject
a model for deployment.
Now I'm gonna run all of the cells in this notebook,
and then we can take a look at what our new version
of the model looks like in the model registry.
Now that the notebook is done, let's look at our model.
We open the model group within the model registry,
and I can see there's one new version
of the model that's been added.
I have two previous versions, both have been Approved,
and this newly added version is in a state Pending.
When I double-click on this,
I can see some activity associated with the model,
I can see my model metrics, and under Settings,
I have lineage tracking of my model
automatically taken care of.
This Trial Component corresponds to the Trial Component
in the experiment that was used to train this model,
and that information is automatically captured
in the model registry.
Along with that, I see the Custom Properties
that I've added as well.
Now assuming this model is a good candidate for deployment,
I can update the status, set it as Approved,
and this action can be used to trigger
subsequent pipelines for deployment.
All of the actions that you take in the model registry
are integrated with EventBridge,
giving you the flexibility to string together
complex workflows for your model deployment.
Now that this model has been approved,
I see a new activity that's been logged to the model,
and when I go back to this list of model versions,
I can see now this third version
that we added just now has been Approved.
The model registry serves as a good handoff point
between data scientists and ML engineers
or people that are focused on model training
and people that are focused on model deployment.
I encourage you all to explore SageMaker Model Registry
as a central place to catalog and manage all of your models.