making ai faas - qcon san francisco · making ai faast. dragos d haut - principal engineer @adobe...

55
Making AI FaaSt . Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe

Upload: others

Post on 30-May-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms

Making AI FaaSt.

Dragos D Haut - Principal Engineer @Adobe

Akhilesh Kumar - Applied ML Engineer @Adobe

Page 2: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms

FaaS

Function as A Service

Page 3: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms

a.k.a Serverless

Page 4: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms

FaaS Value Props

Page 5: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms

FaaS Value Props1. FaaSter to PROTOTYPE services

Page 6: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms

FaaS Value Props1. FaaSter to CREATE services

Page 7: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms

FaaS Value Props1. FaaSter to create services

2. Never pay for Idle

Page 8: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms

FaaS Value Props1. FaaSter to create services

2. Never pay for Idle

3. Low maintenance overhead

Page 9: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms

FaaS: Build more, pay less1. FaaSter to create services

2. Never pay for Idle

3. Low maintenance overhead

Page 10: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms

||

Page 11: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms

Evolution of Business Logic

Page 12: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms

Monolith

Microservices

Functions

Page 13: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms

High-level Microservice architecture

Page 14: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms

Multiple regions

Page 15: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms

Microservice Cost & COGS

Page 16: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms

Microservice Cost vs FaaS Cost

Page 17: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms

VS

Page 18: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms

How ?

Page 19: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms

FaaS has better premises

Page 20: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms

FaaS premisesCode - a smaller unit to deploy and scale

Page 21: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms

FaaS premisesCode - a smaller unit to deploy and scale

Request based auto-scaling

Page 22: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms

Making AI FaaSt

Page 23: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms

--- https://twitter.com/andrewyng/status/700086119333892096

Page 24: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms
Page 25: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms

"With AI, we should look at the programmer more as a teacher, rather than a micro-manager. "

— Peter Norvig, Director of Research at Google.

Page 26: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms

" We spent the last 40 years building up tools to build programs to deal with text (code) in a good way …"

Page 27: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms

"… but right now we are creating models instead of text, and we just

don’t have the tools to deal with that. We need to retool the

industry."— Peter Norvig, Director of Research at Google.

Page 28: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms

"Neural networks are not just another classifier, they represent the beginning of a fundamental shift in

how we write software. They are Software 2.0."

— (Nov, 2017) - Andrej Karpathy, Director of AI at Tesla

Page 29: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms

Building AI apps

Page 30: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms
Page 31: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms
Page 32: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms
Page 33: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms
Page 34: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms

Training vs Inference

Page 35: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms

Training vs Inference

Learning vs Answering

Page 36: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms

InferenceGetting a new data sample to infer an answer

Page 37: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms
Page 38: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms

InferenceRuns faster than Training

Models process one input at a time

Page 39: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms

Inference matches the FaaS modelEnough code for a function

Each function processes one request at a time

function (input) { //1. download and cache model //2. return inference(input)}

Page 40: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms

Additional FaaS benefitsIt's FaaSter to deploy the code directly

Never pay for idle

Low maintenance overhead

Page 41: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms

Real apps integrate multiple algorithms into workflows

Page 42: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms

Real apps integrate multiple algorithms into workflows

reusing existing functions

Page 43: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms

Demo

• Jupyter Notebook https://github.com/akh64bit/qconsf

• AI Compositionhttp://opensource.adobe.com/adobe-sensei-ai-functions/

Page 44: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms
Page 45: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms

Cast

• FaaS Platform - Apache OpenWhisk openwhisk.org

• Workflow - Apache OpenWhisk Composer github.com/ibm-functions/composer

• Editing AI Action - JupyterLab Notebook jupyter.org

• Deploying AI Action - JupyterLab Notebook

Page 46: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms
Page 47: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms
Page 48: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms
Page 49: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms

Software 2.0Model + Code

Page 50: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms

Software 2.0JupyterLab - assist in model development

Functions - assist in deploying the model

Page 51: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms

Software 2.0ML Engineers collaborate with software

developers

Page 52: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms

Software 2.0With FaaS it's easy to deploy a new

AI Model-as-a-Function

Page 53: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms

ConclusionsFaaS platforms are still maturing

Page 54: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms

ConclusionsFaaS platforms are still maturing

It's FaaSter to deploy AI models

Page 55: Making AI FaaS - QCon San Francisco · Making AI FaaSt. Dragos D Haut - Principal Engineer @Adobe Akhilesh Kumar - Applied ML Engineer @Adobe. ... Real apps integrate multiple algorithms

ConclusionsFaaS platforms are still maturing

It's FaaSter to deploy AI models

Build more services, pay less