CI/CD For Machine Learning

A presentation at All Day DevOps in November 2019 in by Sasha Rosenbaum

Slide 1

Slide 1

Slide 2

Slide 2

MLOps CI/CD for Machine Learning SASHA ROSENBAUM

Slide 3

Slide 3

Sasha Rosenbaum Sr. Program Manager @DivineOps

Slide 4

Slide 4

What is MLOps and WHY should you care?

Slide 5

Slide 5

Machine Learning (ML) Is the science of getting computers to act Without being explicitly programmed

Slide 6

Slide 6

Slide 7

Slide 7

Machine Learning vs DevOps Google searches

Slide 8

Slide 8

Python questions on Stack Overflow

Slide 9

Slide 9

OK, but why should YOU care?

Slide 10

Slide 10

10

Slide 11

Slide 11

Data Scientists just want to Data Science

Slide 12

Slide 12

Deep Learning Some ML training algorithms are complex

Slide 13

Slide 13

Deep Learning - Backpropagation Some ML training algorithms are complex

Slide 14

Slide 14

Typical data scientist work environment

Slide 15

Slide 15

We’ve got the notebook into source control!

Slide 16

Slide 16

Programming Algorithm Answers Data

Slide 17

Slide 17

Machine Learning Answers Algorithm Data

Slide 18

Slide 18

Machine Learning Answers Model Data

Slide 19

Slide 19

Machine Learning Answers Model Data

Slide 20

Slide 20

Machine Learning Answers Data Model Predictions Data

Slide 21

Slide 21

How do we put the model in production?

Slide 22

Slide 22

What is an ML model?

Slide 23

Slide 23

Linear Regression – Housing Prices The training finds a and b such that Y = a+bX+ϵ

Slide 24

Slide 24

Deep Learning The input and output may be ത 𝑌ത vectors 𝑋,

Slide 25

Slide 25

Image Classification

Slide 26

Slide 26

ML Model A definition of the mathematical formula with a number of parameters that are learned from the data

Slide 27

Slide 27

Isn’t this just an API endpoint?!

Slide 28

Slide 28

Do models really change that often?

Slide 29

Slide 29

Models must be improved continuously

Slide 30

Slide 30

TensorFlow Extended FBLearner Flow Uber’s Michelangelo Microsoft Aether

Slide 31

Slide 31

But I don’t work at a big company with thousands of ML engineers!

Slide 32

Slide 32

How do we iterate?

Slide 33

Slide 33

Machine Learning Lifecycle

Slide 34

Slide 34

Data Scientist • • • • • • • Quick iteration Versioning Reuse Great tools Ease of management Unlimited scale Eliminating drift DevOps/SRE Friends? • • • • • • • Quick iteration Versioning Reuse Compliance Observability Uptime Updates

Slide 35

Slide 35

MLOps Workflow Collaborate Build app Test app Release app Monitor app App developer Data scientist Model reproducibility Model validation Model deployment Model retraining

Slide 36

Slide 36

MLOps Workflow Collaborate Build app Test app Release app Monitor app App developer Code, dataset, and environment versioning Data scientist Model reproducibility Model validation Model deployment Model retraining

Slide 37

Slide 37

MLOps Workflow Collaborate App developer Build app Test app Release app Monitor app Train model Automated ML ML Pipelines Hyperparameter tuning Data scientist Model reproducibility Model validation Model deployment Model retraining

Slide 38

Slide 38

MLOps Workflow Collaborate App developer Build app Test app Train model Validate model Release app Monitor app Model validation & certification Data scientist Model reproducibility Model validation Model deployment Model retraining

Slide 39

Slide 39

MLOps Workflow Collaborate App developer Build app Test app Release app Train model Validate model Deploy model Monitor app Model packaging Simple deployment Data scientist Model reproducibility Model validation Model deployment Model retraining

Slide 40

Slide 40

MLOps Workflow Collaborate App developer Build app Test app Release app Monitor app Train model Validate model Deploy model Monitor model Model management & monitoring Retrain model Data scientist Model performance analysis Model reproducibility Model validation Model deployment Model retraining

Slide 41

Slide 41

Build Your Own MLOps Platform + +

Slide 42

Slide 42

ML Pipeline A reusable, scaleable ML workflow template Kubeflow pipeline A reusable, scalable ML workflow template that runs on containers

Slide 43

Slide 43

Azure ML • • • • • Prep data Train Test Deploy Manage

Slide 44

Slide 44

The CI/CD Pipeline

Slide 45

Slide 45

GitHub Repo https://github.com/DivineOps/kubeflow-and-mlops

Slide 46

Slide 46

Azure Resources

Slide 47

Slide 47

The Code

Slide 48

Slide 48

Build Pipeline https://github.com/DivineOps/kubeflow-and-mlops

Slide 49

Slide 49

Kubeflow Pipeline https://www.kubeflow.org/docs/azure/azureendtoend/

Slide 50

Slide 50

Release Pipeline https://dev.azure.com/sasrose/kubeflow/_release?_a=releases&view=mine&definitionId=3

Slide 51

Slide 51

Even a simple CI/CD pipeline is better than none!

Slide 52

Slide 52

AI Ethics

Slide 53

Slide 53

Bias is a property of information

Slide 54

Slide 54

Build AI responsibly!

Slide 55

Slide 55

Thank You! @DivineOps

Slide 56

Slide 56

Resources GitHub repo https://www.kubeflow.org/docs/azure/azureendtoend/ Deploy Kubeflow on Azure https://www.kubeflow.org/docs/azure/deploy/install-kubeflow/ Example Kubeflow Azure Pipeline https://www.kubeflow.org/docs/azure/azureendtoend/ Release pipeline https://dev.azure.com/sasrose/kubeflow/_release