research faculty summit 2018 - microsoft®.com€¦ · data acquisition feature engineering model...

31
Systems | Fueling future disruptions Research Faculty Summit 2018

Upload: others

Post on 09-Aug-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Research Faculty Summit 2018 - microsoft®.com€¦ · Data Acquisition Feature Engineering Model Training Productionizing s s s e … Snorkel DeepDive MacroBase(Streaming Data) NoScope(Video)

Systems | Fueling future disruptions

ResearchFaculty Summit 2018

Page 2: Research Faculty Summit 2018 - microsoft®.com€¦ · Data Acquisition Feature Engineering Model Training Productionizing s s s e … Snorkel DeepDive MacroBase(Streaming Data) NoScope(Video)

Infrastructure for UsableMachine Learning

Matei ZahariaStanford DAWN

Page 3: Research Faculty Summit 2018 - microsoft®.com€¦ · Data Acquisition Feature Engineering Model Training Productionizing s s s e … Snorkel DeepDive MacroBase(Streaming Data) NoScope(Video)

It’s the Golden Age of MLIncredible advances in image recognition, natural language, planning, information retrieval

Society-scale impact: self-driving cars, real-time translation, personalized medicine

*

*for the best-funded, best-trained engineering teams

Page 4: Research Faculty Summit 2018 - microsoft®.com€¦ · Data Acquisition Feature Engineering Model Training Productionizing s s s e … Snorkel DeepDive MacroBase(Streaming Data) NoScope(Video)

Building ML Products is Too HardMajor successes (e.g., Siri, Alexa, Autopilot) require hundreds to thousands of engineers

Most effort in data preparation, QA, debugging, productionization: not modeling!

Domain experts can’t easily build ML products

Page 5: Research Faculty Summit 2018 - microsoft®.com€¦ · Data Acquisition Feature Engineering Model Training Productionizing s s s e … Snorkel DeepDive MacroBase(Streaming Data) NoScope(Video)

“Only a fraction of real-world ML systemsis composed of ML code”

Page 6: Research Faculty Summit 2018 - microsoft®.com€¦ · Data Acquisition Feature Engineering Model Training Productionizing s s s e … Snorkel DeepDive MacroBase(Streaming Data) NoScope(Video)

The Stanford DAWN Project

How can we enable any domain expert to build production-quality ML applications?• Without a PhD in machine learning• Without being an expert in systems• Without understanding the latest hardware

Peter Bailis Chris Ré Kunle Olukotun Matei Zaharia

Page 7: Research Faculty Summit 2018 - microsoft®.com€¦ · Data Acquisition Feature Engineering Model Training Productionizing s s s e … Snorkel DeepDive MacroBase(Streaming Data) NoScope(Video)

The DAWN StackData Acquisition Feature Engineering Model Training Productionizing

Inte

rface

sAl

gorit

hms

Syst

ems

Hard

war

e

Snorkel

DeepDive

MacroBase (Streaming Data)

NoScope (Video)

AutoRec, SimDex (Recommendation)

Data Fusion

Mulligan (SQL+graph+ML)

CPU GPU FPGA Cluster Mobile

New Hardware: FuzzyBit, Plasticine CGRA

End-to-End Compilers: Weld, Delite

ModelQAModelSnap

Page 8: Research Faculty Summit 2018 - microsoft®.com€¦ · Data Acquisition Feature Engineering Model Training Productionizing s s s e … Snorkel DeepDive MacroBase(Streaming Data) NoScope(Video)

Training Data is the Key to AI

Image search, speech, games: labeled training data is cheap & easy to obtain

Medicine, document understanding, fraud:labeled data requires expensive human experts!

How can we leverage data that’s expensive to label at scale?

Page 9: Research Faculty Summit 2018 - microsoft®.com€¦ · Data Acquisition Feature Engineering Model Training Productionizing s s s e … Snorkel DeepDive MacroBase(Streaming Data) NoScope(Video)

NIPS ‘16, VLDB ‘18, github.com/HazyResearch/snorkel

Snorkel Project (Chris Ré):Labeling Functions, not Labels

1) User writes labeling functions: short programs that may not always give right label• E.g. regex to search in text

2) Snorkel simultaneously learns noise in LFs and a noise-aware target model (e.g. LSTM)

4 hours LF coding with bio experts: match months of hand-labeling

high-quality models from low-quality, scalable labeling functions

System NCBI Disease (F1)

CDR Disease(F1)

CDR Chem. (F1)

TaggerOne (Dogan, 2012)* 81.5 79.6 88.4Snorkel: Logistic Regression 79.1 79.6 88.4Snorkel: LSTM + Embeddings 79.2 80.4 88.2

Page 10: Research Faculty Summit 2018 - microsoft®.com€¦ · Data Acquisition Feature Engineering Model Training Productionizing s s s e … Snorkel DeepDive MacroBase(Streaming Data) NoScope(Video)

The DAWN StackData Acquisition Feature Engineering Model Training Productionizing

Inte

rface

sAl

gorit

hms

Syst

ems

Hard

war

e

Snorkel

DeepDive

MacroBase (Anomaly Detection)

NoScope (Inference)

AutoRec, SimDex (Recommendation)

Data Fusion

Mulligan (SQL+graph+ML)

CPU GPU FPGA Cluster Mobile

New Hardware: FuzzyBit, Plasticine CGRA

End-to-End Compilers: Weld, Delite

ModelQAModelSnap

Page 11: Research Faculty Summit 2018 - microsoft®.com€¦ · Data Acquisition Feature Engineering Model Training Productionizing s s s e … Snorkel DeepDive MacroBase(Streaming Data) NoScope(Video)

NoScope: Fast CNN-BasedQueries on Video

Opportunity: CNNs allow more accurate queries on visual data than ever

Challenge: processing 1 video stream in real time requires a $1000 GPU

Result: 100-1000x faster with <1% loss in accuracy

Page 12: Research Faculty Summit 2018 - microsoft®.com€¦ · Data Acquisition Feature Engineering Model Training Productionizing s s s e … Snorkel DeepDive MacroBase(Streaming Data) NoScope(Video)

Key Idea: Model Specialization

Given a target model and a query, train a much smaller specialized model

When this model is unsure, call original

TargetModel

SpecializedModel

VideoSpecificFrames

+ Cost-based optimizer to select an efficient model cascade

Page 13: Research Faculty Summit 2018 - microsoft®.com€¦ · Data Acquisition Feature Engineering Model Training Productionizing s s s e … Snorkel DeepDive MacroBase(Streaming Data) NoScope(Video)

NoScope Results

VLDB ‘17, github.com/stanford-futuredata/noscope

Page 14: Research Faculty Summit 2018 - microsoft®.com€¦ · Data Acquisition Feature Engineering Model Training Productionizing s s s e … Snorkel DeepDive MacroBase(Streaming Data) NoScope(Video)

New Work: BlazeIt Query EngineAccelerates complex, SQL-like queries using model specialization + statistical techniques

https://arxiv.org/abs/1805.01046

Page 15: Research Faculty Summit 2018 - microsoft®.com€¦ · Data Acquisition Feature Engineering Model Training Productionizing s s s e … Snorkel DeepDive MacroBase(Streaming Data) NoScope(Video)

The DAWN StackData Acquisition Feature Engineering Model Training Productionizing

Inte

rface

sAl

gorit

hms

Syst

ems

Hard

war

e

Snorkel

DeepDive

MacroBase (Anomaly Detection)

NoScope (Inference)

AutoRec, SimDex (Recommendation)

Data Fusion

Mulligan (SQL+graph+ML)

CPU GPU FPGA Cluster Mobile

New Hardware: FuzzyBit, Plasticine CGRA

End-to-End Compilers: Weld, Delite

ModelQAModelSnap

Page 16: Research Faculty Summit 2018 - microsoft®.com€¦ · Data Acquisition Feature Engineering Model Training Productionizing s s s e … Snorkel DeepDive MacroBase(Streaming Data) NoScope(Video)

Composition in Data AppsML app developers compose functions from dozens of high-level libraries• Python packages, Spark packages, R, …

Page 17: Research Faculty Summit 2018 - microsoft®.com€¦ · Data Acquisition Feature Engineering Model Training Productionizing s s s e … Snorkel DeepDive MacroBase(Streaming Data) NoScope(Video)

The ProblemEven if each individual function is well-optimized, the combined app may be highly inefficient

Traditional way to compose libraries: function calls that exchange data via buffers in memory

data = pandas.parse_csv(string)

filtered = pandas.dropna(data)

avg = numpy.mean(filtered)

parse_csv

dropna

mean

5-30x overheads in NumPy, Pandas, TensorFlow, etc

Page 18: Research Faculty Summit 2018 - microsoft®.com€¦ · Data Acquisition Feature Engineering Model Training Productionizing s s s e … Snorkel DeepDive MacroBase(Streaming Data) NoScope(Video)

Weld’s Approach

machine learningSQL graph

algorithms

CPU GPU

Common IR

Page 19: Research Faculty Summit 2018 - microsoft®.com€¦ · Data Acquisition Feature Engineering Model Training Productionizing s s s e … Snorkel DeepDive MacroBase(Streaming Data) NoScope(Video)

Results: Individual Libraries

TPC-H Logistic RegressionVector Sum

0 5

10 15 20 25 30 35 40 45

TPC-H Q1 TPC-H Q6

Runtim

e [

secs

]

Workload

SparkSQLWeld

0 0.02 0.04 0.06 0.08 0.1

0.12 0.14 0.16 0.18 0.2

Ru

ntim

e [

secs

]

NPNExpr

Weld 0.1

1

10

100

1000

LR (1T) LR (12T)

Runtim

e [se

cs; lo

g10]

Workload

TFHand-opt

Weld

1 Core 12 Cores

Porting ~10 common functions per library

Page 20: Research Faculty Summit 2018 - microsoft®.com€¦ · Data Acquisition Feature Engineering Model Training Productionizing s s s e … Snorkel DeepDive MacroBase(Streaming Data) NoScope(Video)

Results: Cross-Library

0.01 0.1 1 10 100

Current

Weld, no CLO

Weld, CLO

Weld, 12 core

Running Time [sec; log10]

Pandas + NumPy Pipeline

CLO = cross-library optimization

CIDR ’17, VLDB ‘18, https://weld.rs

9x

30x

240x

Page 21: Research Faculty Summit 2018 - microsoft®.com€¦ · Data Acquisition Feature Engineering Model Training Productionizing s s s e … Snorkel DeepDive MacroBase(Streaming Data) NoScope(Video)

“Weld without Weld”: Splittability Annotations

// @splittable// (a: S, b: S, res: mut S)void vdAdd(vec_t *a,

vec_t *b,vec_t *res);

8x speedup

S: “split arrays the same way”

Data movement optimization and auto parallelization for unmodified, black-box functions

vdAdd(res, v1, res);vdAdd(res, v2, res);vdAdd(res, v3, res);vdAdd(res, v4, res);...0.1

1

10

1 2 4 8 16 32Runt

ime

(sec

, log

10)

Threads

MKL w/o SAs MKL w/SAs

Competitive performance to Weld without rewriting libraries!

Page 22: Research Faculty Summit 2018 - microsoft®.com€¦ · Data Acquisition Feature Engineering Model Training Productionizing s s s e … Snorkel DeepDive MacroBase(Streaming Data) NoScope(Video)

Machine Learning at Industrial Scale:ML Platforms

Page 23: Research Faculty Summit 2018 - microsoft®.com€¦ · Data Acquisition Feature Engineering Model Training Productionizing s s s e … Snorkel DeepDive MacroBase(Streaming Data) NoScope(Video)

ML at Industrial Scale: ML PlatformsIf you believe ML will be a key part of future products, what should be the development process for it?

Today, ML development is ad-hoc:• Hard to track experiments: every data scientist has their own way• Hard to reproduce results: won’t happen by default• Difficult to share & manage models

Need the equivalent of software dev platforms

Page 24: Research Faculty Summit 2018 - microsoft®.com€¦ · Data Acquisition Feature Engineering Model Training Productionizing s s s e … Snorkel DeepDive MacroBase(Streaming Data) NoScope(Video)

ML PlatformsA new class of systems to manage the ML lifecycle

Pioneered by company-specific platforms: Facebook FBLearner, Uber Michelangelo, Google TFX, etc+Standardize the data prep / training / deploy loop:

if you work with the platform, you get these!– Limited to a few algorithms or frameworks– Tied to one company’s infrastructure

Page 25: Research Faculty Summit 2018 - microsoft®.com€¦ · Data Acquisition Feature Engineering Model Training Productionizing s s s e … Snorkel DeepDive MacroBase(Streaming Data) NoScope(Video)

Databricks MLflowOpen source, open-interface ML platform (mlflow.org)

Projects: package code & data for reproducible runs

Experiment tracking: record code, params & metrics via a REST API

MLflow models: package models as functions to deploy to backends

Tracking Server

Compare & Query Results

Run Sources

ModelDeployments

Cloud JobsLocal Apps Notebooks

Page 26: Research Faculty Summit 2018 - microsoft®.com€¦ · Data Acquisition Feature Engineering Model Training Productionizing s s s e … Snorkel DeepDive MacroBase(Streaming Data) NoScope(Video)

Databricks MLflowOpen source, open-interface ML platform (mlflow.org)

Projects: package code & data for reproducible runs

Experiment tracking: record code, params & metrics via a REST API

MLflow models: package models as functions to deploy to backends

Tracking Server

Compare & Query Results

Run Sources

ModelDeployments

Cloud JobsLocal Apps Notebooks

Many open questions left in designing such platforms!

Page 27: Research Faculty Summit 2018 - microsoft®.com€¦ · Data Acquisition Feature Engineering Model Training Productionizing s s s e … Snorkel DeepDive MacroBase(Streaming Data) NoScope(Video)

Databricks MLflowOpen source, open-interface ML platform (mlflow.org)

Project

Project Spec

your_code.py. . .log_param(“alpha”, 0.5)log_metric(“rmse”, 0.2)log_model(my_model). . .

Deps Params

Tracking ServerUI

API

Inference Code

Bulk Scoring

Cloud Serving Tools

Deployment TargetsExperiment TrackingReproducible Projects

REST API

Page 28: Research Faculty Summit 2018 - microsoft®.com€¦ · Data Acquisition Feature Engineering Model Training Productionizing s s s e … Snorkel DeepDive MacroBase(Streaming Data) NoScope(Video)

Databricks MLflowOpen source, open-interface ML platform (mlflow.org)

Project

Project Spec

your_code.py. . .log_param(“alpha”, 0.5)log_metric(“rmse”, 0.2)log_model(my_model). . .

Deps Params

Tracking ServerUI

API

Inference Code

Bulk Scoring

Cloud Serving Tools

Deployment TargetsExperiment TrackingReproducible Projects

REST API

Many open questions left in designing such platforms!

Page 29: Research Faculty Summit 2018 - microsoft®.com€¦ · Data Acquisition Feature Engineering Model Training Productionizing s s s e … Snorkel DeepDive MacroBase(Streaming Data) NoScope(Video)

Conclusion

The limiting factors for ML adoption are in dev and productionization tools, not training algorithms

Many of these are still very unexplored in research!

Follow DAWN for our research inthis area: dawn.cs.stanford.edu

Page 30: Research Faculty Summit 2018 - microsoft®.com€¦ · Data Acquisition Feature Engineering Model Training Productionizing s s s e … Snorkel DeepDive MacroBase(Streaming Data) NoScope(Video)

Thank you!

Page 31: Research Faculty Summit 2018 - microsoft®.com€¦ · Data Acquisition Feature Engineering Model Training Productionizing s s s e … Snorkel DeepDive MacroBase(Streaming Data) NoScope(Video)