38
Create. Connect. Secure. Observe. Your app environment simplified.

Create. Connect. Secure. Observe. · Meenakshi Kaushik, Cisco Hyperparameter tuning for TensorFlow using Katib and Kubeflow NeelimaMukiri, Cisco

  • Upload
    others

  • View
    7

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Create. Connect. Secure. Observe. · Meenakshi Kaushik, Cisco Hyperparameter tuning for TensorFlow using Katib and Kubeflow NeelimaMukiri, Cisco

Create. Connect.Secure. Observe.Your app environment simplified.

Page 2: Create. Connect. Secure. Observe. · Meenakshi Kaushik, Cisco Hyperparameter tuning for TensorFlow using Katib and Kubeflow NeelimaMukiri, Cisco

Meenakshi Kaushik, Cisco

Hyperparameter tuning for TensorFlow using Katib and Kubeflow

Neelima Mukiri, Cisco

Page 3: Create. Connect. Secure. Observe. · Meenakshi Kaushik, Cisco Hyperparameter tuning for TensorFlow using Katib and Kubeflow NeelimaMukiri, Cisco

© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential https://tfworldkatib.github.io/tutorial

High Level Goals• Understand automated machine learning landscape• Deep dive into hyperparameter optimization (HPO)• Be able to install and use Katib for HPO• Understand Kubeflow components

Page 4: Create. Connect. Secure. Observe. · Meenakshi Kaushik, Cisco Hyperparameter tuning for TensorFlow using Katib and Kubeflow NeelimaMukiri, Cisco

© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential https://tfworldkatib.github.io/tutorial

Agenda• Tutorial – Setup prerequisites • Automated machine learning landscape• Hyperparameter, Katib and Kubeflow overview• Tutorial – Setup Kubernetes• HPO and Katib deep dive• Tutorial – Katib• Kubeflow overview and demo• Summary

Page 5: Create. Connect. Secure. Observe. · Meenakshi Kaushik, Cisco Hyperparameter tuning for TensorFlow using Katib and Kubeflow NeelimaMukiri, Cisco

© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential https://tfworldkatib.github.io/tutorial

Tutorial Setup

Katib

Laptop

Vagrant / VirtualBox

ML Workloads(Modelling, training, roll-out, serving, ...)

Infrastructure(On-Prem / Cloud)

Hypervisor ( , … ), Bare Metal / Azure, AWS, GCP, …

Katib

Today’s Tutorial Production

Page 6: Create. Connect. Secure. Observe. · Meenakshi Kaushik, Cisco Hyperparameter tuning for TensorFlow using Katib and Kubeflow NeelimaMukiri, Cisco

© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential https://tfworldkatib.github.io/tutorial

VirtualBox and Vagrant

Vagrant

Box: minikatib/tfworldVersion: 0.2.0

Page 7: Create. Connect. Secure. Observe. · Meenakshi Kaushik, Cisco Hyperparameter tuning for TensorFlow using Katib and Kubeflow NeelimaMukiri, Cisco

© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential https://tfworldkatib.github.io/tutorial

Tutorial: Setup Prerequisites• Instructions -

https://tfworldkatib.github.io/tutorial/prereqs/prereqs.html

• Questions

Page 8: Create. Connect. Secure. Observe. · Meenakshi Kaushik, Cisco Hyperparameter tuning for TensorFlow using Katib and Kubeflow NeelimaMukiri, Cisco

© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential https://tfworldkatib.github.io/tutorial

Automated Machine Learning

Output5

4

8

Source - https://github.com/hibayesian/awesome-automl-papers

Page 9: Create. Connect. Secure. Observe. · Meenakshi Kaushik, Cisco Hyperparameter tuning for TensorFlow using Katib and Kubeflow NeelimaMukiri, Cisco

© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential https://tfworldkatib.github.io/tutorial

Automated Machine Learning

Automated Data Cleaning

Automated Feature Engineering

Hyperparameter Optimization

Neural Architecture Search

Source - https://github.com/hibayesian/awesome-automl-papers

Page 10: Create. Connect. Secure. Observe. · Meenakshi Kaushik, Cisco Hyperparameter tuning for TensorFlow using Katib and Kubeflow NeelimaMukiri, Cisco

© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential

Use Case: Improve Model Performance

Output5

4

8

Learned Model

Accuracy – 0.9674

https://github.com/kubeflow/tf-operator/blob/master/examples/v1/mnist_with_summaries/mnist_with_summaries.py

How to improve model prediction accuracy 0.9674 ?

Page 11: Create. Connect. Secure. Observe. · Meenakshi Kaushik, Cisco Hyperparameter tuning for TensorFlow using Katib and Kubeflow NeelimaMukiri, Cisco

© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential https://tfworldkatib.github.io/tutorial

What is Hyperparameter

Output5

4

8

LearnedModel

Hyperparameters

Page 12: Create. Connect. Secure. Observe. · Meenakshi Kaushik, Cisco Hyperparameter tuning for TensorFlow using Katib and Kubeflow NeelimaMukiri, Cisco

© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential https://tfworldkatib.github.io/tutorial

Hyperparameter: Examples• Learning rate• Batch size• Optimizer • Number of layers in the neural network

Hyperparameter are variables set by data scientist prior to the training process to improve model performance

Page 13: Create. Connect. Secure. Observe. · Meenakshi Kaushik, Cisco Hyperparameter tuning for TensorFlow using Katib and Kubeflow NeelimaMukiri, Cisco

© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential https://tfworldkatib.github.io/tutorial

Why Automate Hyperparameter Tuning?

• Not transferable• No magic

hyperparameter values that work across every dataset

• Manual tuning inefficient and error prone

• Exponential search space growth

• Tracking metrics manually is hard

Page 14: Create. Connect. Secure. Observe. · Meenakshi Kaushik, Cisco Hyperparameter tuning for TensorFlow using Katib and Kubeflow NeelimaMukiri, Cisco

© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential https://tfworldkatib.github.io/tutorial

Who is Katib?

Model Training Code

HP Search Range• Learning Rate (0.01 -

0.03)• Batch size (100 – 200)• Num layers (2-5)• …

ACCURACY / ERROR

OBJECTIVE REACHEDOR

MAX TRIALS REACHED

Assistant

Auto HP Tuner

Page 15: Create. Connect. Secure. Observe. · Meenakshi Kaushik, Cisco Hyperparameter tuning for TensorFlow using Katib and Kubeflow NeelimaMukiri, Cisco

© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential https://tfworldkatib.github.io/tutorial

Katib Config

Assistant

Auto HP Tuner

Page 16: Create. Connect. Secure. Observe. · Meenakshi Kaushik, Cisco Hyperparameter tuning for TensorFlow using Katib and Kubeflow NeelimaMukiri, Cisco

© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential https://tfworldkatib.github.io/tutorial

Tutorial Setup

Katib

Laptop

Vagrant / VirtualBox

ML Workloads(Modelling, training, roll-out, serving, ...)

Infrastructure(On-Prem / Cloud)

Hypervisor ( , … ), Bare Metal / Azure, AWS, GCP, …

Katib

Today’s Tutorial Production

Page 17: Create. Connect. Secure. Observe. · Meenakshi Kaushik, Cisco Hyperparameter tuning for TensorFlow using Katib and Kubeflow NeelimaMukiri, Cisco

© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential https://tfworldkatib.github.io/tutorial

Tutorial: Setup Prerequisites• Instructions -

https://tfworldkatib.github.io/tutorial/prereqs/prereqs.html

• Questions

Page 18: Create. Connect. Secure. Observe. · Meenakshi Kaushik, Cisco Hyperparameter tuning for TensorFlow using Katib and Kubeflow NeelimaMukiri, Cisco

© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential

Containers

Page 19: Create. Connect. Secure. Observe. · Meenakshi Kaushik, Cisco Hyperparameter tuning for TensorFlow using Katib and Kubeflow NeelimaMukiri, Cisco

© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential https://tfworldkatib.github.io/tutorial

Containers changed Shipping Industry

• Today, 90+% of all cargo ships in a standard container• Faster delivery, reduced (dis-)charging times, increased security (less loss/damage of

goods)• Average shipment cost reduced from >25% to <3%:

Key enabler to globalization and just-in-time production

Source : Frank Brockners, Ciscolive presentation

Page 20: Create. Connect. Secure. Observe. · Meenakshi Kaushik, Cisco Hyperparameter tuning for TensorFlow using Katib and Kubeflow NeelimaMukiri, Cisco

© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential https://tfworldkatib.github.io/tutorial

ContainersApp

Trial#1

Bins/Libs

Hypervisor

Host OS

Server

Host OS + Container Runtime

Server

App Trial#2

Bins/Libs

Guest OS

App Suggest

Bins/Libs

Guest OS

Bins/Libs Bins/Libs Con

tain

erO

rche

stra

tor

VM

Guest OS App Trial#1

App Trial#1

App SuggestContainer

Page 21: Create. Connect. Secure. Observe. · Meenakshi Kaushik, Cisco Hyperparameter tuning for TensorFlow using Katib and Kubeflow NeelimaMukiri, Cisco

© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential

Greek for ”Helmsman”

Page 22: Create. Connect. Secure. Observe. · Meenakshi Kaushik, Cisco Hyperparameter tuning for TensorFlow using Katib and Kubeflow NeelimaMukiri, Cisco

© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential https://tfworldkatib.github.io/tutorial

What is Kubernetes (K8s)• Container orchestrator• 100% Open source, written in Go• Runs and manages pods• Declarative APIs• Rich ecosystem of plug-ins for scheduling,

storage, networking

Worker Node(s)

Kubelet Kube-Proxy

PodPod

Container

Master(s)

Kubernetes Master Node(s)

Page 23: Create. Connect. Secure. Observe. · Meenakshi Kaushik, Cisco Hyperparameter tuning for TensorFlow using Katib and Kubeflow NeelimaMukiri, Cisco

© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential https://tfworldkatib.github.io/tutorial

K8s as the new platform of choice

On-premises environment

Publicclouds

Scalability

Speed

Portability

Page 24: Create. Connect. Secure. Observe. · Meenakshi Kaushik, Cisco Hyperparameter tuning for TensorFlow using Katib and Kubeflow NeelimaMukiri, Cisco

© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential https://tfworldkatib.github.io/tutorial

Tutorial Setup

Katib

Laptop

Vagrant / VirtualBox

ML Workloads(Modelling, training, roll-out, serving, ...)

Infrastructure(On-Prem / Cloud)

Hypervisor ( , … ), Bare Metal / Azure, AWS, GCP, …

Katib

Today’s Tutorial Production

Page 25: Create. Connect. Secure. Observe. · Meenakshi Kaushik, Cisco Hyperparameter tuning for TensorFlow using Katib and Kubeflow NeelimaMukiri, Cisco

© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential https://tfworldkatib.github.io/tutorial

Tutorial : Setup Kubernetes• Instructions -

https://tfworldkatib.github.io/tutorial/kubernetes/setup.html

• Questions

Page 26: Create. Connect. Secure. Observe. · Meenakshi Kaushik, Cisco Hyperparameter tuning for TensorFlow using Katib and Kubeflow NeelimaMukiri, Cisco

© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential

Katib

Page 27: Create. Connect. Secure. Observe. · Meenakshi Kaushik, Cisco Hyperparameter tuning for TensorFlow using Katib and Kubeflow NeelimaMukiri, Cisco

© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential https://tfworldkatib.github.io/tutorial

Tutorial Setup

Katib

Laptop

Vagrant / VirtualBox

ML Workloads(Modelling, training, roll-out, serving, ...)

Infrastructure(On-Prem / Cloud)

Hypervisor ( , … ), Bare Metal / Azure, AWS, GCP, …

Katib

Today’s Tutorial Production

Page 28: Create. Connect. Secure. Observe. · Meenakshi Kaushik, Cisco Hyperparameter tuning for TensorFlow using Katib and Kubeflow NeelimaMukiri, Cisco

© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential https://tfworldkatib.github.io/tutorial

Tutorial : Katib• Instructions - https://tfworldkatib.github.io/tutorial/katib/katib.html

• Questions

Page 29: Create. Connect. Secure. Observe. · Meenakshi Kaushik, Cisco Hyperparameter tuning for TensorFlow using Katib and Kubeflow NeelimaMukiri, Cisco

© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential

Kubeflow

Page 30: Create. Connect. Secure. Observe. · Meenakshi Kaushik, Cisco Hyperparameter tuning for TensorFlow using Katib and Kubeflow NeelimaMukiri, Cisco

© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential https://tfworldkatib.github.io/tutorial

Tutorial Setup

Katib

Laptop

Vagrant / VirtualBox

ML Workloads(Modelling, training, roll-out, serving, ...)

Infrastructure(On-Prem / Cloud)

Hypervisor ( , … ), Bare Metal / Azure, AWS, GCP, …

Katib

Today’s Tutorial Production

Page 31: Create. Connect. Secure. Observe. · Meenakshi Kaushik, Cisco Hyperparameter tuning for TensorFlow using Katib and Kubeflow NeelimaMukiri, Cisco

© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential https://tfworldkatib.github.io/tutorial

Machine Learning Lifecycle Manager that makes it easy to develop, deploy and

manage portable, scalable end-to-end ML workflows everywhere

Page 32: Create. Connect. Secure. Observe. · Meenakshi Kaushik, Cisco Hyperparameter tuning for TensorFlow using Katib and Kubeflow NeelimaMukiri, Cisco

© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential https://tfworldkatib.github.io/tutorial

Kubeflow Demo• Installation • Data exploration using Jupyter notebooks• Model training using different machine learning frameworks• Model serving• Pipelines• Questions

Page 33: Create. Connect. Secure. Observe. · Meenakshi Kaushik, Cisco Hyperparameter tuning for TensorFlow using Katib and Kubeflow NeelimaMukiri, Cisco

© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential https://tfworldkatib.github.io/tutorial

Summary• Tools are available to make automated machine learning accessible• Manual tuning of hyperparameters is hard, use automation like Katib• Katib still requires us to understand the problem space and how to

manually fine tune suggestion algorithms• Portability can be achieved either using Kubernetes applications or

Kubeflow pipelines.• Kubeflow and Katib are rapidly evolving, bringing the latest

innovations in the ML landscape to you

Page 34: Create. Connect. Secure. Observe. · Meenakshi Kaushik, Cisco Hyperparameter tuning for TensorFlow using Katib and Kubeflow NeelimaMukiri, Cisco

© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential https://tfworldkatib.github.io/tutorial

How to contribute• Both Kubeflow and Katib are extensible frameworks, if you find

something missing please look at how to contribute• Appreciate any contribution to the tutorial at

https://github.com/tfworldkatib/tutorial

Page 35: Create. Connect. Secure. Observe. · Meenakshi Kaushik, Cisco Hyperparameter tuning for TensorFlow using Katib and Kubeflow NeelimaMukiri, Cisco

© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential https://tfworldkatib.github.io/tutorial

Contact Info• Neelima Mukiri - [email protected]• Meenakshi Kaushik - [email protected] @mkaushik108

Page 36: Create. Connect. Secure. Observe. · Meenakshi Kaushik, Cisco Hyperparameter tuning for TensorFlow using Katib and Kubeflow NeelimaMukiri, Cisco
Page 37: Create. Connect. Secure. Observe. · Meenakshi Kaushik, Cisco Hyperparameter tuning for TensorFlow using Katib and Kubeflow NeelimaMukiri, Cisco

Thank you.Time for Q&A.

Page 38: Create. Connect. Secure. Observe. · Meenakshi Kaushik, Cisco Hyperparameter tuning for TensorFlow using Katib and Kubeflow NeelimaMukiri, Cisco

Thank you.