Hands-on MLOps with PyTorch
Published by Pearson
Serving Transformers in Real Time with PyTorch to Combat Model Drift
This training is a hands-on look at the end-to-end Natural Language Processing pipeline with a case study focusing on model training and evaluation, deployment and model-serving in production, and combatting model drift. The session is mostly hands-on which means that a majority of it will be spent looking at code examples and running code to train and deploy state of the art NLP models.
We will use tools including TorchServe, TorchDrift, and mlflow to manage model versions and deploy them to Databricks, an industry leading Data Science and ML platform. We will also see several code examples throughout the training around an intent classification use-case using BERT to help solidify the theoretical concepts being introduced.
What you’ll learn and how you can apply it
By the end of the live online course, you’ll understand:
- The MLOps pipeline and deep learning model life cycles
- How to train and compile transformer models in PyTorch with production use-cases in mind
- Model drift and different methods to detect and fix it
- Model versioning and how to track the lifecycle of deep learning models
And you’ll be able to:
- Deploy transformer models using both open source and proprietary platforms
- Put model drift detection methods in place to catch deteriorating models
- Write code to compile models in a format that is optimal for serving
This live event is for you because...
- You are an experienced machine learning engineer and are comfortable using deep learning libraries like TensorFlow and PyTorch
- You want to better understand the post-training aspects of model training
- You want to deploy state of the art NLP architectures to the cloud
Prerequisites
- Python 3 proficiency with some familiarity with working in interactive Python environments including Notebooks (Jupyter / Google Colab / Kaggle Kernels)
- Comfort using libraries like Tensorflow or PyTorch
- Comfort with transformer-based models like BERT in either Tensorflow or PyTorch
- Foundational understanding of text embeddings in machine learning
Course Set-up
- A github repository with the slides / code / links will be provided
- Attendees will need to have access to the notebooks in the github
Recommended Preparation
- Attend: BERT Transformer Architecture for NLP by Sinan Ozdemir:
- Watch: Natural Language Process, 2e, by Bruno Goncalves
- Watch: Natural Language Processing Using Transformer Architectures by Aurélien Géron 
Recommended Follow-up
- Read: Transformers for Natural Language Processing by Denis Rothman
Schedule
The time frames are only estimates and may vary according to how the class is progressing.
Segment 1: Introduction to Transformers, PyTorch Lightning, and TorchServe (30 min)
- Introduction to Transformers and how they are used to process text
- Introduction to Pytorch Lightning and TorchServe
- Overview of our use-case: intent classification with BERT
Segment 2: Building a ready-to-serve NLP Model (40 min)
- Using Pytorch Lightning to train an intent classification model
- Serving our Pytorch model with TorchServe
Break 5 min
Q&A 10 min
Segment 3: Deploying models to Databricks using mlflow (40 min)
- Introduction to Databricks and model Serving with mlflow
- Serving our intent model using Databricks and mlflow
Segment 4: Detecting Model Drift with TorchDrift (40 min)
- Learning the four types of model and data drift
- Calculating model and data drift through statistical tests and TorchDrift
- Identifying the causes of model drift
Break 5 min
Q&A 10 min
Segment 5: Re-training Models based on drift (30 min)
- Re-training models based on detected drift
-
- Removing bad training data and adding optimal training data
Segment 6: Course wrap-up and next steps (20 min)
- Next steps / further resources
Final Q/A 10 min
Your Instructor
Sinan Ozdemir
Sinan Ozdemir is the founder of Crucible, an AI factory platform that helps teams convert existing workflows into custom models. He is a Y Combinator alum, AI & LLM Advisor at Tola Capital, and the author of multiple books on data science and machine learning including Building Agentic AI, Quick Start Guide to LLMs, and Principles of Data Science. Sinan is a former lecturer of data science at Johns Hopkins University and the founder of Kylie.ai, an enterprise-grade conversational AI platform (acquired 2014). He holds a master's degree in pure mathematics from Johns Hopkins University and is based in San Francisco, California.