Getting your models into production is the fundamental challenge of machine learning. MLOps offers a set of proven principles aimed at solving this problem in a reliable and automated way. This insightful guide takes you through what MLOps is (and how it differs from DevOps) and shows you how to put it into practice to operationalize your machine learning models.
Current and aspiring machine learning engineers--or anyone familiar with data science and Python--will build a foundation in MLOps tools and methods (along with AutoML and monitoring and logging), then learn how to implement them in AWS, Microsoft Azure, and Google Cloud. The faster you deliver a machine learning system that works, the faster you can focus on the business problems you're trying to crack. This book gives you a head start.
You'll discover how to:
• Apply DevOps best practices to machine learning
• Build production machine learning systems and maintain them
• Monitor, instrument, load-test, and operationalize machine learning systems
• Choose the correct MLOps tools for a given machine learning task
• Run machine learning models on a variety of platforms and devices, including mobile phones and specialized hardware
Author(s): Noah Gift, Alfredo Deza
Edition: 1
Publisher: O'Reilly Media
Year: 2021
Language: English
Commentary: Vector PDF
Pages: 460
City: Sebastopol, CA
Tags: DevOps; Linux; Google Cloud Platform; Microsoft Azure; Cloud Computing; Command Line; Machine Learning; Python; Monitoring; Logging; Pipelines; Monetization; AutoML; Continuous Delivery; PyTorch; Containerization; AWS SageMaker; Infrastructure as Code; Apple CoreML; MLOps; Observability; Edge Devices; KaizenML
Cover
Copyright
Table of Contents
Preface
Why We Wrote This Book
How This Book Is Organized
Chapters
Appendixes
Exercise Questions
Discussion Questions
Origin of Chapter Quotes
Conventions Used in This Book
Using Code Examples
O’Reilly Online Learning
How to Contact Us
Acknowledgments
From Noah
From Alfredo
Chapter 1. Introduction to MLOps
Rise of the Machine Learning Engineer and MLOps
What Is MLOps?
DevOps and MLOps
An MLOps Hierarchy of Needs
Implementing DevOps
Configuring Continuous Integration with GitHub Actions
DataOps and Data Engineering
Platform Automation
MLOps
Conclusion
Exercises
Critical Thinking Discussion Questions
Chapter 2. MLOps Foundations
Bash and the Linux Command Line
Cloud Shell Development Environments
Bash Shell and Commands
List Files
Run Commands
Files and Navigation
Input/Output
Configuration
Writing a Script
Cloud Computing Foundations and Building Blocks
Getting Started with Cloud Computing
Python Crash Course
Minimalistic Python Tutorial
Math for Programmers Crash Course
Descriptive Statistics and Normal Distributions
Optimization
Machine Learning Key Concepts
Doing Data Science
Build an MLOps Pipeline from Zero
Conclusion
Exercises
Critical Thinking Discussion Questions
Chapter 3. MLOps for Containers and Edge Devices
Containers
Container Runtime
Creating a Container
Running a Container
Best Practices
Serving a Trained Model Over HTTP
Edge Devices
Coral
Azure Percept
TFHub
Porting Over Non-TPU Models
Containers for Managed ML Systems
Containers in Monetizing MLOps
Build Once, Run Many MLOps Workflow
Conclusion
Exercises
Critical Thinking Discussion Questions
Chapter 4. Continuous Delivery for Machine Learning Models
Packaging for ML Models
Infrastructure as Code for Continuous Delivery of ML Models
Using Cloud Pipelines
Controlled Rollout of Models
Testing Techniques for Model Deployment
Conclusion
Exercises
Critical Thinking Discussion Questions
Chapter 5. AutoML and KaizenML
AutoML
MLOps Industrial Revolution
Kaizen Versus KaizenML
Feature Stores
Apple’s Ecosystem
Apple’s AutoML: Create ML
Apple’s Core ML Tools
Google’s AutoML and Edge Computer Vision
Azure’s AutoML
AWS AutoML
Open Source AutoML Solutions
Ludwig
FLAML
Model Explainability
Conclusion
Exercises
Critical Thinking Discussion Questions
Chapter 6. Monitoring and Logging
Observability for Cloud MLOps
Introduction to Logging
Logging in Python
Modifying Log Levels
Logging Different Applications
Monitoring and Observability
Basics of Model Monitoring
Monitoring Drift with AWS SageMaker
Monitoring Drift with Azure ML
Conclusion
Exercises
Critical Thinking Discussion Questions
Chapter 7. MLOps for AWS
Introduction to AWS
Getting Started with AWS Services
MLOps on AWS
MLOps Cookbook on AWS
CLI Tools
Flask Microservice
AWS Lambda Recipes
AWS Lambda-SAM Local
AWS Lambda-SAM Containerized Deploy
Applying AWS Machine Learning to the Real World
Conclusion
Exercises
Critical Thinking Discussion Questions
Chapter 8. MLOps for Azure
Azure CLI and Python SDK
Authentication
Service Principal
Authenticating API Services
Compute Instances
Deploying
Registering Models
Versioning Datasets
Deploying Models to a Compute Cluster
Configuring a Cluster
Deploying a Model
Troubleshooting Deployment Issues
Retrieving Logs
Application Insights
Debugging Locally
Azure ML Pipelines
Publishing Pipelines
Azure Machine Learning Designer
ML Lifecycle
Conclusion
Exercises
Critical Thinking Discussion Questions
Chapter 9. MLOps for GCP
Google Cloud Platform Overview
Continuous Integration and Continuous Delivery
Kubernetes Hello World
Cloud Native Database Choice and Design
DataOps on GCP: Applied Data Engineering
Operationalizing ML Models
Conclusion
Exercises
Critical Thinking Discussion Questions
Chapter 10. Machine Learning Interoperability
Why Interoperability Is Critical
ONNX: Open Neural Network Exchange
ONNX Model Zoo
Convert PyTorch into ONNX
Create a Generic ONNX Checker
Convert TensorFlow into ONNX
Deploy ONNX to Azure
Apple Core ML
Edge Integration
Conclusion
Exercises
Critical Thinking Discussion Questions
Chapter 11. Building MLOps Command Line Tools and Microservices
Python Packaging
The Requirements File
Command Line Tools
Creating a Dataset Linter
Modularizing a Command Line Tool
Microservices
Creating a Serverless Function
Authenticating to Cloud Functions
Building a Cloud-Based CLI
Machine Learning CLI Workflows
Conclusion
Exercises
Critical Thinking Discussion Questions
Chapter 12. Machine Learning Engineering and MLOps Case Studies
Unlikely Benefits of Ignorance in Building Machine Learning Models
MLOps Projects at Sqor Sports Social Network
Mechanical Turk Data Labeling
Influencer Rank
Athlete Intelligence (AI Product)
The Perfect Technique Versus the Real World
Critical Challenges in MLOps
Ethical and Unintended Consequences
Lack of Operational Excellence
Focus on Prediction Accuracy Versus the Big Picture
Final Recommendations to Implement MLOps
Data Governance and Cybersecurity
MLOps Design Patterns
Conclusion
Exercises
Critical Thinking Discussion Questions
Appendix A. Key Terms
Appendix B. Technology Certifications
AWS Certifications
AWS Cloud Practitioner and AWS Solutions Architect
AWS Certified Machine Learning - Specialty
Other Cloud Certifications
Azure Data Scientist and AI Engineer
GCP
SQL-Related Certifications
Appendix C. Remote Work
Equipment for Working Remotely
Network
Home Work Area
Location, Location, Location
Appendix D. Think Like a VC for Your Career
Pear Revenue Strategy
Passive
Positive
Exponential
Autonomy
Rule of 25%
Notes
Appendix E. Building a Technical Portfolio for MLOps
Project: Continuous Delivery of Flask/FastAPI Data Engineering API on a PaaS Platform
Project: Docker and Kubernetes Container Project
Project: Serverless AI Data Engineering Pipeline
Project: Build Edge ML Solution
Project: Build Cloud Native ML Application or API
Getting a Job: Don’t Storm the Castle, Walk in the Backdoor
Appendix F. Data Science Case Study: Intermittent Fasting
Notes on Intermittent Fasting, Blood Glucose, and Food
Appendix G. Additional Educational Resources
Additional MLOps Critical Thinking Questions
Additional MLOps Educational Materials
Education Disruption
Current State of Higher Education That Will Be Disrupted
10X Better Education
Conclusion
Appendix H. Technical Project Management
Project Plan
Weekly Demo
Task Tracking
Index
About the Authors
Colophon