using a serverless architecture to deploy (and consume ... · using a serverless architecture to...

16
Globalcode – Open4education Using a Serverless Architecture to Deploy Using a Serverless Architecture to Deploy (and consume) Machine Learning models (and consume) Machine Learning models Rafael Zotto Senior Software Architect, HP Inc.

Upload: others

Post on 21-May-2020

8 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Using a Serverless Architecture to Deploy (and consume ... · Using a Serverless Architecture to Deploy (and consume) Machine Learning models Rafael Zotto Senior Software Architect,

Globalcode – Open4education

Using a Serverless Architecture to Deploy Using a Serverless Architecture to Deploy (and consume) Machine Learning models(and consume) Machine Learning models

Rafael ZottoSenior Software Architect, HP Inc.

Page 2: Using a Serverless Architecture to Deploy (and consume ... · Using a Serverless Architecture to Deploy (and consume) Machine Learning models Rafael Zotto Senior Software Architect,

Globalcode – Open4education

Short Bio

Rafael Zotto

Holds a master degree in Computer Science focused in high performance computing. Specialized in parallel and distributed computing with special interest in mobile and web technologies. Works for HP Inc. for the past decade acting as senior software architect for print firmware and wearable technologies. Recently joined the Data Science research team in Porto Alegre, Brazil.

Page 3: Using a Serverless Architecture to Deploy (and consume ... · Using a Serverless Architecture to Deploy (and consume) Machine Learning models Rafael Zotto Senior Software Architect,

Globalcode – Open4education

Agenda

Problem Statement

Serverless Overview

Deploy and Consume ML: A practical Use Case

Page 4: Using a Serverless Architecture to Deploy (and consume ... · Using a Serverless Architecture to Deploy (and consume) Machine Learning models Rafael Zotto Senior Software Architect,

Globalcode – Open4education

Problem Statement

The model is trained;

The results are acceptable;

How to share it ‘with the world’?

Talk goal: to share a Serverless ApproachServerless Approach

Page 5: Using a Serverless Architecture to Deploy (and consume ... · Using a Serverless Architecture to Deploy (and consume) Machine Learning models Rafael Zotto Senior Software Architect,

Globalcode – Open4education

Process Perspective

Development and Deployment of ML systems should not be should not be differentdifferent from traditional software solutions.

* Image from “How to Deploy Deep Learning Models with AWS Lambda and Tensorflow” article. Amazon Web Services Blogs.

Page 6: Using a Serverless Architecture to Deploy (and consume ... · Using a Serverless Architecture to Deploy (and consume) Machine Learning models Rafael Zotto Senior Software Architect,

Globalcode – Open4education

Background

* Image from “Getting Started with Serverless Architecture” presentation. Amazon Web Services.

Page 7: Using a Serverless Architecture to Deploy (and consume ... · Using a Serverless Architecture to Deploy (and consume) Machine Learning models Rafael Zotto Senior Software Architect,

Globalcode – Open4education

Serverless DefinitionPlatform to develop, run and manage applications without the complexity of building and maintaining infrastructure.

No free lunch!You will pay for it.

Sub-second billing

Page 8: Using a Serverless Architecture to Deploy (and consume ... · Using a Serverless Architecture to Deploy (and consume) Machine Learning models Rafael Zotto Senior Software Architect,

Globalcode – Open4education

Architect to be ServerlessFully Managed

No provisioning, zero administration, high-available

Developer ProductivityFocus on what matters, innovate quickly

Continuous ScalingUp and Down automatically

Page 9: Using a Serverless Architecture to Deploy (and consume ... · Using a Serverless Architecture to Deploy (and consume) Machine Learning models Rafael Zotto Senior Software Architect,

Globalcode – Open4education

Simple Use Case

ModelModel was previously trained;

DeployDeploy it to a cloud environment;

ExecuteExecute real-time predictions;

Page 10: Using a Serverless Architecture to Deploy (and consume ... · Using a Serverless Architecture to Deploy (and consume) Machine Learning models Rafael Zotto Senior Software Architect,

Globalcode – Open4education

Simple Use Case

ModelModel – IRIS Data set

DeployDeploy – AWS

ExecuteExecute – AWS IoT Core Stack;

Page 11: Using a Serverless Architecture to Deploy (and consume ... · Using a Serverless Architecture to Deploy (and consume) Machine Learning models Rafael Zotto Senior Software Architect,

Globalcode – Open4education

Model

The Iris flower dataIris flower data set is a multivariate data setmultivariate data set

Introduced by the British statistician and biologist Ronald Fischer (1936)

Iris Setosa Iris Versicolor Iris Virginica

Page 12: Using a Serverless Architecture to Deploy (and consume ... · Using a Serverless Architecture to Deploy (and consume) Machine Learning models Rafael Zotto Senior Software Architect,

Globalcode – Open4education

Deployment

AWS Lambda functions for predictions

Model saved in a S3 bucket

The Serverless FrameworkServerless Framework might be your friend here.

Page 13: Using a Serverless Architecture to Deploy (and consume ... · Using a Serverless Architecture to Deploy (and consume) Machine Learning models Rafael Zotto Senior Software Architect,

Globalcode – Open4education

Real-Time Prediction

IoT Core stack (just because we want it ‘real-time’)

MQTT Communication (Lambda ↔ Client)

Page 14: Using a Serverless Architecture to Deploy (and consume ... · Using a Serverless Architecture to Deploy (and consume) Machine Learning models Rafael Zotto Senior Software Architect,

Globalcode – Open4education

Page 15: Using a Serverless Architecture to Deploy (and consume ... · Using a Serverless Architecture to Deploy (and consume) Machine Learning models Rafael Zotto Senior Software Architect,

Globalcode – Open4education

Tips and Issues

Take advantage of AWS Lambda container reusecontainer reuse

Keep you function warmwarm!

Page 16: Using a Serverless Architecture to Deploy (and consume ... · Using a Serverless Architecture to Deploy (and consume) Machine Learning models Rafael Zotto Senior Software Architect,