Practical MLOps

Book description

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

Publisher resources

View/Submit Errata

Table of contents

  1. Preface
    1. Why We Wrote This Book
    2. How This Book Is Organized
      1. Chapters
      2. Appendixes
      3. Exercise Questions
      4. Discussion Questions
      5. Origin of Chapter Quotes
    3. Conventions Used in This Book
    4. Using Code Examples
    5. O’Reilly Online Learning
    6. How to Contact Us
    7. Acknowledgments
      1. From Noah
      2. From Alfredo
  2. 1. Introduction to MLOps
    1. Rise of the Machine Learning Engineer and MLOps
    2. What Is MLOps?
    3. DevOps and MLOps
    4. An MLOps Hierarchy of Needs
      1. Implementing DevOps
      2. Configuring Continuous Integration with GitHub Actions
      3. DataOps and Data Engineering
      4. Platform Automation
      5. MLOps
    5. Conclusion
    6. Exercises
    7. Critical Thinking Discussion Questions
  3. 2. MLOps Foundations
    1. Bash and the Linux Command Line
    2. Cloud Shell Development Environments
    3. Bash Shell and Commands
      1. List Files
      2. Run Commands
      3. Files and Navigation
      4. Input/Output
      5. Configuration
      6. Writing a Script
    4. Cloud Computing Foundations and Building Blocks
    5. Getting Started with Cloud Computing
    6. Python Crash Course
    7. Minimalistic Python Tutorial
    8. Math for Programmers Crash Course
      1. Descriptive Statistics and Normal Distributions
      2. Optimization
    9. Machine Learning Key Concepts
    10. Doing Data Science
    11. Build an MLOps Pipeline from Zero
    12. Conclusion
    13. Exercises
    14. Critical Thinking Discussion Questions
  4. 3. MLOps for Containers and Edge Devices
    1. Containers
      1. Container Runtime
      2. Creating a Container
      3. Running a Container
      4. Best Practices
      5. Serving a Trained Model Over HTTP
    2. Edge Devices
      1. Coral
      2. Azure Percept
      3. TFHub
      4. Porting Over Non-TPU Models
    3. Containers for Managed ML Systems
      1. Containers in Monetizing MLOps
      2. Build Once, Run Many MLOps Workflow
    4. Conclusion
    5. Exercises
    6. Critical Thinking Discussion Questions
  5. 4. Continuous Delivery for Machine Learning Models
    1. Packaging for ML Models
    2. Infrastructure as Code for Continuous Delivery of ML Models
    3. Using Cloud Pipelines
      1. Controlled Rollout of Models
      2. Testing Techniques for Model Deployment
    4. Conclusion
    5. Exercises
    6. Critical Thinking Discussion Questions
  6. 5. AutoML and KaizenML
    1. AutoML
      1. MLOps Industrial Revolution
      2. Kaizen Versus KaizenML
      3. Feature Stores
    2. Apple’s Ecosystem
      1. Apple’s AutoML: Create ML
      2. Apple’s Core ML Tools
    3. Google’s AutoML and Edge Computer Vision
    4. Azure’s AutoML
    5. AWS AutoML
    6. Open Source AutoML Solutions
      1. Ludwig
      2. FLAML
    7. Model Explainability
    8. Conclusion
    9. Exercises
    10. Critical Thinking Discussion Questions
  7. 6. Monitoring and Logging
    1. Observability for Cloud MLOps
    2. Introduction to Logging
    3. Logging in Python
      1. Modifying Log Levels
      2. Logging Different Applications
    4. Monitoring and Observability
      1. Basics of Model Monitoring
      2. Monitoring Drift with AWS SageMaker
      3. Monitoring Drift with Azure ML
    5. Conclusion
    6. Exercises
    7. Critical Thinking Discussion Questions
  8. 7. MLOps for AWS
    1. Introduction to AWS
      1. Getting Started with AWS Services
      2. MLOps on AWS
    2. MLOps Cookbook on AWS
      1. CLI Tools
      2. Flask Microservice
    3. AWS Lambda Recipes
      1. AWS Lambda-SAM Local
      2. AWS Lambda-SAM Containerized Deploy
    4. Applying AWS Machine Learning to the Real World
    5. Conclusion
    6. Exercises
    7. Critical Thinking Discussion Questions
  9. 8. MLOps for Azure
    1. Azure CLI and Python SDK
    2. Authentication
      1. Service Principal
      2. Authenticating API Services
    3. Compute Instances
    4. Deploying
      1. Registering Models
      2. Versioning Datasets
    5. Deploying Models to a Compute Cluster
      1. Configuring a Cluster
      2. Deploying a Model
    6. Troubleshooting Deployment Issues
      1. Retrieving Logs
      2. Application Insights
      3. Debugging Locally
    7. Azure ML Pipelines
      1. Publishing Pipelines
      2. Azure Machine Learning Designer
    8. ML Lifecycle
    9. Conclusion
    10. Exercises
    11. Critical Thinking Discussion Questions
  10. 9. MLOps for GCP
    1. Google Cloud Platform Overview
      1. Continuous Integration and Continuous Delivery
      2. Kubernetes Hello World
      3. Cloud Native Database Choice and Design
    2. DataOps on GCP: Applied Data Engineering
    3. Operationalizing ML Models
    4. Conclusion
    5. Exercises
    6. Critical Thinking Discussion Questions
  11. 10. Machine Learning Interoperability
    1. Why Interoperability Is Critical
    2. ONNX: Open Neural Network Exchange
      1. ONNX Model Zoo
      2. Convert PyTorch into ONNX
      3. Create a Generic ONNX Checker
      4. Convert TensorFlow into ONNX
      5. Deploy ONNX to Azure
    3. Apple Core ML
    4. Edge Integration
    5. Conclusion
    6. Exercises
    7. Critical Thinking Discussion Questions
  12. 11. Building MLOps Command Line Tools and Microservices
    1. Python Packaging
    2. The Requirements File
    3. Command Line Tools
      1. Creating a Dataset Linter
      2. Modularizing a Command Line Tool
    4. Microservices
      1. Creating a Serverless Function
      2. Authenticating to Cloud Functions
      3. Building a Cloud-Based CLI
    5. Machine Learning CLI Workflows
    6. Conclusion
    7. Exercises
    8. Critical Thinking Discussion Questions
  13. 12. Machine Learning Engineering and MLOps Case Studies
    1. Unlikely Benefits of Ignorance in Building Machine Learning Models
    2. MLOps Projects at Sqor Sports Social Network
      1. Mechanical Turk Data Labeling
      2. Influencer Rank
      3. Athlete Intelligence (AI Product)
    3. The Perfect Technique Versus the Real World
    4. Critical Challenges in MLOps
      1. Ethical and Unintended Consequences
      2. Lack of Operational Excellence
      3. Focus on Prediction Accuracy Versus the Big Picture
    5. Final Recommendations to Implement MLOps
      1. Data Governance and Cybersecurity
      2. MLOps Design Patterns
    6. Conclusion
    7. Exercises
    8. Critical Thinking Discussion Questions
  14. A. Key Terms
  15. B. Technology Certifications
    1. AWS Certifications
      1. AWS Cloud Practitioner and AWS Solutions Architect
      2. AWS Certified Machine Learning - Specialty
    2. Other Cloud Certifications
      1. Azure Data Scientist and AI Engineer
      2. GCP
    3. SQL-Related Certifications
  16. C. Remote Work
    1. Equipment for Working Remotely
      1. Network
      2. Home Work Area
      3. Location, Location, Location
  17. D. Think Like a VC for Your Career
    1. Pear Revenue Strategy
      1. Passive
      2. Positive
      3. Exponential
      4. Autonomy
      5. Rule of 25%
      6. Notes
  18. E. Building a Technical Portfolio for MLOps
    1. Project: Continuous Delivery of Flask/FastAPI Data Engineering API on a PaaS Platform
    2. Project: Docker and Kubernetes Container Project
    3. Project: Serverless AI Data Engineering Pipeline
    4. Project: Build Edge ML Solution
    5. Project: Build Cloud Native ML Application or API
    6. Getting a Job: Don’t Storm the Castle, Walk in the Backdoor
  19. F. Data Science Case Study: Intermittent Fasting
    1. Notes on Intermittent Fasting, Blood Glucose, and Food
  20. G. Additional Educational Resources
    1. Additional MLOps Critical Thinking Questions
    2. Additional MLOps Educational Materials
    3. Education Disruption
      1. Current State of Higher Education That Will Be Disrupted
      2. 10X Better Education
    4. Conclusion
  21. H. Technical Project Management
    1. Project Plan
    2. Weekly Demo
    3. Task Tracking
  22. Index

Product information

  • Title: Practical MLOps
  • Author(s): Noah Gift, Alfredo Deza
  • Release date: September 2021
  • Publisher(s): O'Reilly Media, Inc.
  • ISBN: 9781098103019