SlideShare a Scribd company logo
Jabayo on Kubeflow
(주) 두다지 - 홍석환
2. Project 소개
Jabayo on Kubeflow
이상상황 리포팅 서비스
2. Project 소개 - (도둑) Jabayo
- 영상내 이상 상황 리포팅 서비스, Video understanding 분야
- 무인편의점 / 어린이집 대표 사례
- 이화여자대학교 황성주 교수 팀과 협업
- 중소 벤처 기업부 R&D 과제 + NIPA (IPA) 지원사업 (고성장 클럽)
2. Project 소개 - (도둑) Jabayo
데모 영상
ML Toolkit for kubernetes
2. Project 소개 - on Kubeflow
Kubeflow 대표 컴포넌트
2. Project 소개 - on Kubeflow
Jupyter Notebook Easy GPU provisioning
Katb 하이퍼파라미터 튜닝
Pipeline ML Workflow 작성 (자동화)
Fairing building, training, and deploying ML models in a hybrid cloud env
TFJob, PyTorchJob CRD
Seldon, TF Serving Model serving
Kubeflow 0.5 Release!
- kfctl로 좀 더 쉬워진 kubeflow 설정 및 설치 과정
- Kubeflow hub UI의 개선과 Notebook UI가 좀 더 사용하기 쉽게 변경
- 노트북에 볼륨 마운트 할 수 있게 됨!
- Fairing : 로컬/ 클라우드 환경에서 손쉽게 KF component을 submit할 수 있는
library 제공
2. Project 소개 - on Kubeflow
DL team Infra team Output
0 day -오픈소스 모델 확보
-논문 구현
-퍼블릭 데이터 활용
-static GPU 할당
-Kubernetes on prem
-Kubeflow install
-Worker node drain
-Jupyter notebook
-Two stream 등 모델
-Kubernetes / Kubeflow on prem infra
-Storage(MINIO)
#1 -모델 확보 완료
-스캐폴드
-커스텀 데이터 확보 및 수집
-Kubeflow 리뷰
-Katib
-Pipeline
-Scaffold
-Custom dataset & models
#2 -Katib 활용 하이퍼파라미터
튜닝
-메트릭 갱신 리포트 자동화
작성
-Pipeline - 커스텀 데이터셋
업로드
-Kubeflow 리뷰
-Fairing
-Seldon
-Custom dataset & models
-Data pipeline
#3 -Watch 메트릭, 추론 자동화
-Fairing (실패)
-Multi-cluster 리뷰
-Storage sync 리뷰
(Rok)
-Watch pipeline run
#4 -모델 튜닝 / 앙상블 시작 -open-rok
3. 120 days log (3월~)
- 모델 확보 (Two stream 등)
- 퍼블릭데이터 + 모델 개발
- 한번에 한개의 문제 문제 해결
- Worker node drain
- 의존성을 최소화
- Kubeflow의 삽질이 모델 연구에 영향을 주지 않도록
- Kubernetes(Kubeflow) on prem infra with storage (minio)
4. Share - 0 day (3월)
DL team Infra team Output
0 day -오픈소스 모델 확보
-논문 구현
-퍼블릭 데이터 활용
-static GPU 할당
-Kubernetes on prem
-Kubeflow install
-Worker node drain
-Jupyter notebook
-모델확보 (Two stream 등)
-Kube / Kubeflow on prem infra with
storage(minio)
DL team Infra team Output
0 day -오픈소스 모델 확보
-논문 구현
-퍼블릭 데이터 활용
-static GPU 할당
-Kubernetes on prem
-Kubeflow install
-Worker node drain
-Jupyter notebook
-Two stream 등 모델
-Kubernetes / Kubeflow on prem infra
-Storage(MINIO)
#1 -모델 확보 완료
-스캐폴드
-커스텀 데이터 확보 및 수집
-Kubeflow 리뷰
-Katib
-Pipeline
-Jupyter notebook
-Scaffold
-Custom dataset & models
#2 -Katib 활용 하이퍼파라미터
튜닝
-메트릭 갱신 리포트 자동화
작성
-Pipeline - 커스텀 데이터셋
업로드
-Kubeflow 리뷰
-Fairing
-Seldon
-Custom dataset & models
-Data pipeline
-Kubeflow review report 2 (showcase)
#3 -Watch 메트릭, 추론 자동화
-Fairing (실패)
-Multi-cluster 리뷰
-Storage sync 리뷰
(Rok)
-Watch pipeline run
#4 -모델 튜닝 / 앙상블 시작 -open-rok
(Index) 120 days log (4월)
- Jupyter notebook
- 준비 완료 & 사용
- Scaffold
- DL team - Infra team간 협업 필요, DL team간 협업 및 공유 필요성 감지
- Scaffold & quick start
- 커스텀 데이터
- 수동으로 업데이트
- 자동화는 시기 상조
4. Share - sprint #1
DL team Infra team Output
#1 -모델 확보 완료
-스캐폴드
-커스텀 데이터 확보 및 수집
-Kubeflow 리뷰
-Katib
-Pipeline
-Jupyter notebook
-Scaffold
-Custom dataset & models
[Open-infradays 2019 Korea] jabayo on Kubeflow
1.1. Jupyter Notebook : Easy GPU Node provisioning
Tensorflow + Fairing + Kubectl = Kubeflow Jupyter Notebook
“설치만 하면 얻게 되는 첫번째 이득”
4. Share - sprint #1
[Open-infradays 2019 Korea] jabayo on Kubeflow
1.2. Scaffold
- 협업이 필요한 시점으로 파악.
- 유명 오픈소스 바탕으로 우리에 맞게 일부 커스텀
http://drivendata.github.io/cookiecutter-data-science/
참고) 원래는 git-flow에 코드리뷰 열심히 해요 :)
4. Share - sprint #1
1.2. Scaffold
4. Share - sprint #1
DL team Infra team Output
0 day -오픈소스 모델 확보
-논문 구현
-퍼블릭 데이터 활용
-static GPU 할당
-Kubernetes on prem
-Kubeflow install
-Worker node drain
-Jupyter notebook
-Two stream 등 모델
-Kubernetes / Kubeflow on prem infra
-Storage(MINIO)
#1 -모델 확보 완료
-스캐폴드
-커스텀 데이터 확보 및 수집
-Kubeflow 리뷰
-Katib
-Pipeline
-Scaffold
-Custom dataset & models
-Kubeflow review report 1 (showcase)
#2 -Katib 활용 하이퍼파라미터
튜닝
-Pipeline 데이터셋 업로드
-Kubeflow 리뷰
-Fairing
-Seldon
-Katib
-Data pipeline (one-off)
-Custom dataset & models
#3 -Watch 메트릭, 추론 자동화
-Fairing (실패)
-Multi-cluster 리뷰
-Storage sync 리뷰
(Rok)
-Watch pipeline run
#4 -모델 튜닝 / 앙상블 시작 -open-rok
(Index) 120 days log (5월)
4. Share - sprint #2
DL team Infra team Output
#2 -Katib 활용 하이퍼파라미터
튜닝
-Pipeline 데이터셋 업로드
-Kubeflow 리뷰
-Fairing
-Seldon
-Katib
-Data pipeline (one-off)
-Custom dataset & models
- Katib를 이용한 하이퍼파라미터튜닝
- Data pipeline 작성 (One-off run 형태)
[Open-infradays 2019 Korea] jabayo on Kubeflow
2.1. Katib 개요: 하이퍼파라미터 튜닝
- 하이퍼파라미터 튜닝?
모델 학습시 설정하는 변수 값을 최적의 결과로 낼 수 있게 조정하는 행위
Learning Rate, Dropout Rate, hidden layer 수, batch size, activation function 등등…
- Katib(secretary)의 모델은 Google vizier(prime minister)에서 출발
- 검색 알고리즘을 기준으로 목표한 수치까지 계속 Train job을 실행하여 그 결과를 수집한다.
여러가지 검색 알고리즘 제공 : Grid, Random, Bayesian, hyperbans, nasrl
- StudyJob이라는 Custom Kubernetes Resource기 때문에 yaml CRD 형태로 사용 가능
- 모델 내 변경작업이 없이 Metric Collector가 수집하는 Log 형태만 변경하여 사용
- Worker, Metric Collector 두 개의 컴포넌트로 실행되며, 작성가능한 UI툴을 제공
4. Share - sprint #2
2.1. Katib 작동 원리 : MetricCollectorPod이 로그 수집 (로그 포멧 key=value)
4. Share - sprint #2
2.1. Katib StudyJob Apply
- Validation accuracy 0.5 목표
- 30 requestcount : 하나의 Gpu Node(worker)당 30번 실행
- parameter 설정
batch_size, learning_rate, dropout, optimizer
- Search Algorithm : random
- requestNumber: 2 -> 2개의 Node(worker) 동시 진행
=> 총 60개 Trial이 실행된다
돌려 놓고 퇴근 !
4. Share - sprint #2
2.1. Katib Dashboard
4. Share - sprint #2
2.1. Katib 하이퍼파라미터 튜닝
- 0.5 도달 실패 : 0.35
optimizer가 SGD 일 경우 높은 val-acc 빈도
Dropout이 0.3에서 0.4일 경우 높은 val-acc 빈도
- 다시 파라미터 수정
optimizer를 SGD로 고정하여 재실행
dropout의 최저값을 0.3으로 수정
...
0.48 -> 0.66 -> 0.77
4. Share - sprint #2
근데, 다른 튜너도 있지 않나?
2.1. Katib 하이퍼파라미터 튜닝
근데 다른 튜너도 있지 않나?
- 케라스 튜너 (https://github.com/keras-team/keras-tuner)
- Hyperas (https://github.com/maxpumperla/hyperas)
- Kopt (https://github.com/Avsecz/kopt)
4. Share - sprint #2
케라스 튜너
Hyperas
2.1. Katib 하이퍼파라미터 튜닝
- 쿠버네티스 친화적이지 않음
- 기존 모델소스의 수정이 필요함...
4. Share - sprint #2
케라스 튜너
Hyperas
2.1. Katib 하이퍼파라미터 튜닝
- 카티브는 on kubernetes!
- 튜닝에 사용될 Hyperparameter는 입력단으로만 정의
- 기존 모델소스의 수정없이 Log 양식만 변경하면 사용
(Keras에서는 Log용 callback 함수만 추가하면 끝!)
4. Share - sprint #2
2.1. Katib 리뷰
GOOD!
- hyperparameter tuning tool WITHOUT CODE CHANGE!
- 적용하고 기다리고 적용하고 기다리고 를 대신해 주기 때문에 체감시간 단축 -> 다른 작업을 더 할
수 있다!
- Random Search만으로도 괜찮은 튜닝이 가능하다.
- Train 자체를 Katib에서 실행하게 된다.
BAD!
- UI가 전혀 사용자 친화적이지 않음 : 제공하는 Rest API를 사용하는게 더 편함.
- 여러 개의 검색알고리즘을 지원하지만 아직은 Grid, Random 말고는 적용하기가 쉽지가 않다.
- Hyperparameter 범위를 int, double, categorical, discrete를 지원하지만 Pair로 지정할 수 없는 것이
아쉬움
- 목표 Metric을 하나만 설정할 수 있다
- UI를 통해 생성하는 StudyJob은 정상적으로 Metric Collector에 수집되지 않을때가 있다.
4. Share - sprint #2
[Open-infradays 2019 Korea] jabayo on Kubeflow
2.2. Pipeline : ML Pipelines for Kubeflow
Cloud native ML Workflow 생성툴 (자동화)
- Argo에서 파생
- REST api 지원
- Pipeline SDK 제공
Jupyter Notebook에 pipeline SDK 설치 후 Pipeline 작성/ 배포 가능
- 관리를 위한 UI 제공
- Pipeline, Experiments, Run으로 구성
- One-off , Recurring 형태의 Run을 지원
4. Share - sprint #2
2.2. Pipeline - One-off Job 1. 데이터셋을 생성하는 Pipeline (1) Pipeline
4. Share - sprint #2
Compile
create_pipeline.py
$ dsl-compile --py create_pipeline.py --output create_pipeline.tar.gz
Upload
create_pipeline.tar.gz
2.2. Pipeline - One-off Job 1. 데이터셋을 생성하는 Pipeline (2) Run
4. Share - sprint #2
Run 생성 Run 실행
2.2. Pipeline 리뷰
GOOD!
- SDK를 제공되기 때문에 손쉽게 pipeline 생성이 가능하다.
- recurring run (cron)이 가능하기 때문에 다양한 응용이 가능하다.
- 하나의 실행단위가 곧 Docker container이기 때문에 파이프라인 자체의 dependency는
없음.
BAD!
- 제공해주는 예제 자체는 GCP기준으로 되어 있어 GCP 환경이 아니라면 예제 실행에
어려움. 다른 컴포넌트들도 마찬가지
- 생성된 파이프라인는 수정할 수 없기 때문에 변경시 새로 생성해야 한다. API호출 모듈과
coupling이 있어서 불편.
- Recurring Run 실행시 완료된 Run의 관리 필요.
- 그렇지 않으면 종료된 수십, 수천여개의 컨테이너가 남게됨
- Cause Exception. getKubeletContainers failed: rpc error
- Node status : Not Ready
4. Share - sprint #2
DL team Infra team Output
0 day -오픈소스 모델 확보
-논문 구현
-퍼블릭 데이터 활용
-static GPU 할당
-Kubernetes on prem
-Kubeflow install
-Worker node drain
-Jupyter notebook
-Two stream 등 모델
-Kubernetes / Kubeflow on prem infra
-Storage(MINIO)
#1 -모델 확보 완료
-스캐폴드
-커스텀 데이터 확보 및 수집
-Kubeflow 리뷰
-Katib
-Pipeline
-Scaffold
-Custom dataset & models
-Kubeflow review report 1 (showcase)
#2 -Katib 활용 하이퍼파라미터
튜닝
-Pipeline 데이터셋 업로드
-Kubeflow 리뷰
-Fairing
-Seldon
-Katib
-Data pipeline (one-off)
-Custom dataset & models
#3 -Watch 메트릭, 추론 자동화
-Fairing (실패)
-Multi-cluster 리뷰
-Storage sync 리뷰
(Rok)
-Watch pipeline run
#4 -모델 튜닝 / 앙상블 시작 -open-rok
(Index) 120 days log (6월)
DL team Infra team Output
#3 -Pipeline - 모델 배포 및 추론
자동화
-Fairing (실패)
-Multi-cluster 리뷰
-Storage sync 리뷰
(Rok)
-Watch pipeline run
4. Share - sprint #3
- Watch pipeline run
- 너무 불편한 Katib UI 개선 니즈
- watch + action + slack ui
- Fairing
- 실패
- on prem contribute 고민
- GPU scale out 니즈, 멀티클러스터 리서치 시작
[Open-infradays 2019 Korea] jabayo on Kubeflow
4. Share - sprint #3
3.1. Recurring run - Watch Katib (accuracy)
4. Share - sprint #3
3.1. Recurring run - Watch Katib (dataset)
3.1. Recurring run - Demo
4. Share - sprint #3
[Open-infradays 2019 Korea] jabayo on Kubeflow
3.2. Fairing : Python SDK for building, training, and deploying ML models
“사용자의 ML Model을 다양한 대상(local, cloud)에 Train / Deploy할 수 있는 라이브러리”
4. Share - sprint #3
Check fairing-example.html
3.2. Fairing : Python SDK for building, training, and deploying ML models
Fairing on Prem
- 사용자가 생성한 Train model를 docker image 로 변환하여 Train job으로 submit
- Docker image 생성시 kaniko를 사용
- kaniko는 이미지 생성시 Context 저장소를 GCS, S3, Local, Git만 사용하기 때문에
(S3는 AWS만 가능) on prem 환경에서 사용시 Local Dir을 사용해야 이미지 생성이 가능
- But, 현재 fairing stable 버젼은 Cluster Context Source가 GCS, S3만 사용 가능
4. Share - sprint #3
3.2. Fairing
4. Share - sprint #3
아직은
GCS_Context
S3_Context
만 지원.
[Open-infradays 2019 Korea] jabayo on Kubeflow
3.2. Fairing
OnPrem Context support
- Context 내용을 저장할 Storage필요 -> 파이프라인이 사용하는 Minio를 사용?
- Minio client를 사용하여 Upload! -> Kaniko는 minio bucket이 마운트된 PV를 local:// 로 context 로딩
5. Roadmap - Fairing on prem context support
3.2. Fairing
Discuss fairing On-prem on kubeflow fairing slack channel
5. Roadmap - Fairing on prem context support
on prem
GCP
control cluster
GCS
NAS
sync
open-rok
Custom schedule
No code change
No code change
worker cluster
5. Roadmap - Katib cloud bursting support
Appendix - Kubecon Europe 2019 (Spain)
# Stateful(storage), Security, Multi cluster
We are hiring!
두다지 - AI Service Accelerator
- Kubeflow, Kubernetes, Cloud native ecosystem
- AI Service, AI toolkits
- Open source project를 통한 성공 사례를 꿈꾸는...
shhong@dudaji.com

More Related Content

PDF
An overview of BigQuery
GirdhareeSaran
 
DOCX
Tp docker-v21
WaelKhemakhem
 
PDF
ETL Made Easy with Azure Data Factory and Azure Databricks
Databricks
 
PDF
Exploiting Deserialization Vulnerabilities in Java
CODE WHITE GmbH
 
PPT
Web ontology language (owl)
Ameer Sameer
 
PPT
Cluster Computing
NIKHIL NAIR
 
PPTX
Snowflake Automated Deployments / CI/CD Pipelines
Drew Hansen
 
PDF
Shell Scripting Tutorial | Edureka
Edureka!
 
An overview of BigQuery
GirdhareeSaran
 
Tp docker-v21
WaelKhemakhem
 
ETL Made Easy with Azure Data Factory and Azure Databricks
Databricks
 
Exploiting Deserialization Vulnerabilities in Java
CODE WHITE GmbH
 
Web ontology language (owl)
Ameer Sameer
 
Cluster Computing
NIKHIL NAIR
 
Snowflake Automated Deployments / CI/CD Pipelines
Drew Hansen
 
Shell Scripting Tutorial | Edureka
Edureka!
 

What's hot (20)

PDF
EKS에서 Opentelemetry로 코드실행 모니터링하기 - 신재현 (인덴트코퍼레이션) :: AWS Community Day Online...
AWSKRUG - AWS한국사용자모임
 
PPTX
Docker In Cloud
Santanu Pattanayak
 
PPTX
Cloud Infrastructure Mechanisms
Mohammed Sajjad Ali
 
PPTX
Cloud computing and Cloudsim
Manash Kumar Mondal
 
PDF
Monitoring in CloudStack
ShapeBlue
 
PPTX
Apache sqoop with an use case
Davin Abraham
 
PPT
Cloud computing What Why How
Asian Institute of Technology (AIT)
 
PDF
Distributed Systems Naming
Ahmed Magdy Ezzeldin, MSc.
 
PPT
JDBC Tutorial
Information Technology
 
PPTX
An overview of grid monitoring
Manoj Prabhakar
 
PPTX
Data storage security in cloud computing
Sonali Jain
 
DOC
Cloud security
Mohamed Shalash
 
PDF
Getting Started with Kubernetes
VMware Tanzu
 
PDF
Big Query Basics
Ido Green
 
PDF
The CAP Theorem
Aleksandar Bradic
 
PPTX
Azure Synapse Analytics Overview (r1)
James Serra
 
PDF
MinIO January 2020 Briefing
Jonathan Symonds
 
PDF
An overview of the Kubernetes architecture
Igor Sfiligoi
 
PDF
Introduction to Kubernetes Workshop
Bob Killen
 
PPTX
Kubernetes #1 intro
Terry Cho
 
EKS에서 Opentelemetry로 코드실행 모니터링하기 - 신재현 (인덴트코퍼레이션) :: AWS Community Day Online...
AWSKRUG - AWS한국사용자모임
 
Docker In Cloud
Santanu Pattanayak
 
Cloud Infrastructure Mechanisms
Mohammed Sajjad Ali
 
Cloud computing and Cloudsim
Manash Kumar Mondal
 
Monitoring in CloudStack
ShapeBlue
 
Apache sqoop with an use case
Davin Abraham
 
Cloud computing What Why How
Asian Institute of Technology (AIT)
 
Distributed Systems Naming
Ahmed Magdy Ezzeldin, MSc.
 
JDBC Tutorial
Information Technology
 
An overview of grid monitoring
Manoj Prabhakar
 
Data storage security in cloud computing
Sonali Jain
 
Cloud security
Mohamed Shalash
 
Getting Started with Kubernetes
VMware Tanzu
 
Big Query Basics
Ido Green
 
The CAP Theorem
Aleksandar Bradic
 
Azure Synapse Analytics Overview (r1)
James Serra
 
MinIO January 2020 Briefing
Jonathan Symonds
 
An overview of the Kubernetes architecture
Igor Sfiligoi
 
Introduction to Kubernetes Workshop
Bob Killen
 
Kubernetes #1 intro
Terry Cho
 
Ad

Similar to [Open-infradays 2019 Korea] jabayo on Kubeflow (20)

PDF
MLOps 플랫폼을 만드는 과정의 고민과 해결 사례 공유(feat. Kubeflow)
Jaeyeon Kim
 
PPTX
data platform on kubernetes
창언 정
 
PDF
위성관측 데이터 활용 강수량 산출 AI 경진대회 1위 수상작
DACON AI 데이콘
 
PDF
NetApp AI Control Plane
SeungYong Baek
 
PDF
[236] 카카오의데이터파이프라인 윤도영
NAVER D2
 
PDF
Data platform data pipeline(Airflow, Kubernetes)
창언 정
 
PDF
BigQuery Data Lake & Airflow Contribution
Jason Kim
 
PDF
오픈소스 모니터링 알아보기(Learn about opensource monitoring)
SeungYong Baek
 
PDF
제 19회 보아즈(BOAZ) 빅데이터 컨퍼런스 - [백발백준] : 백준봇 : 컨테이너 오케스트레이션 기반 백준 문제 추천 봇
BOAZ Bigdata
 
PDF
Airflow @ 우아한형제들
Junyoung Park
 
PDF
[NDC 2018] Spark, Flintrock, Airflow 로 구현하는 탄력적이고 유연한 데이터 분산처리 자동화 인프라 구축
Juhong Park
 
PDF
스마트 팩토리: AWS 사물인터넷과 인공지능을 활용한 스마트 팩토리 구축 – 최영준 AWS 솔루션즈 아키텍트, 정현아 AWS 솔루션즈 아키...
Amazon Web Services Korea
 
PDF
지금 핫한 Real-time In-memory Stream Processing 이야기
Ted Won
 
PDF
Spark Summit 2019
Daesung Park
 
PPT
Hadoop Introduction (1.0)
Keeyong Han
 
PDF
머신러닝 및 데이터 과학 연구자를 위한 python 기반 컨테이너 분산처리 플랫폼 설계 및 개발
Jeongkyu Shin
 
PDF
github actions kubernetes 설치&운영하기
newdeal2
 
PDF
AWS Summit Seoul 2023 | Confluent와 함께하는 실시간 데이터와 클라우드 여정
Amazon Web Services Korea
 
PDF
Deep learning framework 제작
Tae Young Lee
 
PDF
Amazon EKS를 활용한 기계 학습 모델 서버 확장하기 - 유홍근, LG전자 :: AWS Summit Seoul 2019
Amazon Web Services Korea
 
MLOps 플랫폼을 만드는 과정의 고민과 해결 사례 공유(feat. Kubeflow)
Jaeyeon Kim
 
data platform on kubernetes
창언 정
 
위성관측 데이터 활용 강수량 산출 AI 경진대회 1위 수상작
DACON AI 데이콘
 
NetApp AI Control Plane
SeungYong Baek
 
[236] 카카오의데이터파이프라인 윤도영
NAVER D2
 
Data platform data pipeline(Airflow, Kubernetes)
창언 정
 
BigQuery Data Lake & Airflow Contribution
Jason Kim
 
오픈소스 모니터링 알아보기(Learn about opensource monitoring)
SeungYong Baek
 
제 19회 보아즈(BOAZ) 빅데이터 컨퍼런스 - [백발백준] : 백준봇 : 컨테이너 오케스트레이션 기반 백준 문제 추천 봇
BOAZ Bigdata
 
Airflow @ 우아한형제들
Junyoung Park
 
[NDC 2018] Spark, Flintrock, Airflow 로 구현하는 탄력적이고 유연한 데이터 분산처리 자동화 인프라 구축
Juhong Park
 
스마트 팩토리: AWS 사물인터넷과 인공지능을 활용한 스마트 팩토리 구축 – 최영준 AWS 솔루션즈 아키텍트, 정현아 AWS 솔루션즈 아키...
Amazon Web Services Korea
 
지금 핫한 Real-time In-memory Stream Processing 이야기
Ted Won
 
Spark Summit 2019
Daesung Park
 
Hadoop Introduction (1.0)
Keeyong Han
 
머신러닝 및 데이터 과학 연구자를 위한 python 기반 컨테이너 분산처리 플랫폼 설계 및 개발
Jeongkyu Shin
 
github actions kubernetes 설치&운영하기
newdeal2
 
AWS Summit Seoul 2023 | Confluent와 함께하는 실시간 데이터와 클라우드 여정
Amazon Web Services Korea
 
Deep learning framework 제작
Tae Young Lee
 
Amazon EKS를 활용한 기계 학습 모델 서버 확장하기 - 유홍근, LG전자 :: AWS Summit Seoul 2019
Amazon Web Services Korea
 
Ad

[Open-infradays 2019 Korea] jabayo on Kubeflow

  • 1. Jabayo on Kubeflow (주) 두다지 - 홍석환
  • 2. 2. Project 소개 Jabayo on Kubeflow 이상상황 리포팅 서비스
  • 3. 2. Project 소개 - (도둑) Jabayo - 영상내 이상 상황 리포팅 서비스, Video understanding 분야 - 무인편의점 / 어린이집 대표 사례 - 이화여자대학교 황성주 교수 팀과 협업 - 중소 벤처 기업부 R&D 과제 + NIPA (IPA) 지원사업 (고성장 클럽)
  • 4. 2. Project 소개 - (도둑) Jabayo 데모 영상
  • 5. ML Toolkit for kubernetes 2. Project 소개 - on Kubeflow
  • 6. Kubeflow 대표 컴포넌트 2. Project 소개 - on Kubeflow Jupyter Notebook Easy GPU provisioning Katb 하이퍼파라미터 튜닝 Pipeline ML Workflow 작성 (자동화) Fairing building, training, and deploying ML models in a hybrid cloud env TFJob, PyTorchJob CRD Seldon, TF Serving Model serving
  • 7. Kubeflow 0.5 Release! - kfctl로 좀 더 쉬워진 kubeflow 설정 및 설치 과정 - Kubeflow hub UI의 개선과 Notebook UI가 좀 더 사용하기 쉽게 변경 - 노트북에 볼륨 마운트 할 수 있게 됨! - Fairing : 로컬/ 클라우드 환경에서 손쉽게 KF component을 submit할 수 있는 library 제공 2. Project 소개 - on Kubeflow
  • 8. DL team Infra team Output 0 day -오픈소스 모델 확보 -논문 구현 -퍼블릭 데이터 활용 -static GPU 할당 -Kubernetes on prem -Kubeflow install -Worker node drain -Jupyter notebook -Two stream 등 모델 -Kubernetes / Kubeflow on prem infra -Storage(MINIO) #1 -모델 확보 완료 -스캐폴드 -커스텀 데이터 확보 및 수집 -Kubeflow 리뷰 -Katib -Pipeline -Scaffold -Custom dataset & models #2 -Katib 활용 하이퍼파라미터 튜닝 -메트릭 갱신 리포트 자동화 작성 -Pipeline - 커스텀 데이터셋 업로드 -Kubeflow 리뷰 -Fairing -Seldon -Custom dataset & models -Data pipeline #3 -Watch 메트릭, 추론 자동화 -Fairing (실패) -Multi-cluster 리뷰 -Storage sync 리뷰 (Rok) -Watch pipeline run #4 -모델 튜닝 / 앙상블 시작 -open-rok 3. 120 days log (3월~)
  • 9. - 모델 확보 (Two stream 등) - 퍼블릭데이터 + 모델 개발 - 한번에 한개의 문제 문제 해결 - Worker node drain - 의존성을 최소화 - Kubeflow의 삽질이 모델 연구에 영향을 주지 않도록 - Kubernetes(Kubeflow) on prem infra with storage (minio) 4. Share - 0 day (3월) DL team Infra team Output 0 day -오픈소스 모델 확보 -논문 구현 -퍼블릭 데이터 활용 -static GPU 할당 -Kubernetes on prem -Kubeflow install -Worker node drain -Jupyter notebook -모델확보 (Two stream 등) -Kube / Kubeflow on prem infra with storage(minio)
  • 10. DL team Infra team Output 0 day -오픈소스 모델 확보 -논문 구현 -퍼블릭 데이터 활용 -static GPU 할당 -Kubernetes on prem -Kubeflow install -Worker node drain -Jupyter notebook -Two stream 등 모델 -Kubernetes / Kubeflow on prem infra -Storage(MINIO) #1 -모델 확보 완료 -스캐폴드 -커스텀 데이터 확보 및 수집 -Kubeflow 리뷰 -Katib -Pipeline -Jupyter notebook -Scaffold -Custom dataset & models #2 -Katib 활용 하이퍼파라미터 튜닝 -메트릭 갱신 리포트 자동화 작성 -Pipeline - 커스텀 데이터셋 업로드 -Kubeflow 리뷰 -Fairing -Seldon -Custom dataset & models -Data pipeline -Kubeflow review report 2 (showcase) #3 -Watch 메트릭, 추론 자동화 -Fairing (실패) -Multi-cluster 리뷰 -Storage sync 리뷰 (Rok) -Watch pipeline run #4 -모델 튜닝 / 앙상블 시작 -open-rok (Index) 120 days log (4월)
  • 11. - Jupyter notebook - 준비 완료 & 사용 - Scaffold - DL team - Infra team간 협업 필요, DL team간 협업 및 공유 필요성 감지 - Scaffold & quick start - 커스텀 데이터 - 수동으로 업데이트 - 자동화는 시기 상조 4. Share - sprint #1 DL team Infra team Output #1 -모델 확보 완료 -스캐폴드 -커스텀 데이터 확보 및 수집 -Kubeflow 리뷰 -Katib -Pipeline -Jupyter notebook -Scaffold -Custom dataset & models
  • 13. 1.1. Jupyter Notebook : Easy GPU Node provisioning Tensorflow + Fairing + Kubectl = Kubeflow Jupyter Notebook “설치만 하면 얻게 되는 첫번째 이득” 4. Share - sprint #1
  • 15. 1.2. Scaffold - 협업이 필요한 시점으로 파악. - 유명 오픈소스 바탕으로 우리에 맞게 일부 커스텀 http://drivendata.github.io/cookiecutter-data-science/ 참고) 원래는 git-flow에 코드리뷰 열심히 해요 :) 4. Share - sprint #1
  • 16. 1.2. Scaffold 4. Share - sprint #1
  • 17. DL team Infra team Output 0 day -오픈소스 모델 확보 -논문 구현 -퍼블릭 데이터 활용 -static GPU 할당 -Kubernetes on prem -Kubeflow install -Worker node drain -Jupyter notebook -Two stream 등 모델 -Kubernetes / Kubeflow on prem infra -Storage(MINIO) #1 -모델 확보 완료 -스캐폴드 -커스텀 데이터 확보 및 수집 -Kubeflow 리뷰 -Katib -Pipeline -Scaffold -Custom dataset & models -Kubeflow review report 1 (showcase) #2 -Katib 활용 하이퍼파라미터 튜닝 -Pipeline 데이터셋 업로드 -Kubeflow 리뷰 -Fairing -Seldon -Katib -Data pipeline (one-off) -Custom dataset & models #3 -Watch 메트릭, 추론 자동화 -Fairing (실패) -Multi-cluster 리뷰 -Storage sync 리뷰 (Rok) -Watch pipeline run #4 -모델 튜닝 / 앙상블 시작 -open-rok (Index) 120 days log (5월)
  • 18. 4. Share - sprint #2 DL team Infra team Output #2 -Katib 활용 하이퍼파라미터 튜닝 -Pipeline 데이터셋 업로드 -Kubeflow 리뷰 -Fairing -Seldon -Katib -Data pipeline (one-off) -Custom dataset & models - Katib를 이용한 하이퍼파라미터튜닝 - Data pipeline 작성 (One-off run 형태)
  • 20. 2.1. Katib 개요: 하이퍼파라미터 튜닝 - 하이퍼파라미터 튜닝? 모델 학습시 설정하는 변수 값을 최적의 결과로 낼 수 있게 조정하는 행위 Learning Rate, Dropout Rate, hidden layer 수, batch size, activation function 등등… - Katib(secretary)의 모델은 Google vizier(prime minister)에서 출발 - 검색 알고리즘을 기준으로 목표한 수치까지 계속 Train job을 실행하여 그 결과를 수집한다. 여러가지 검색 알고리즘 제공 : Grid, Random, Bayesian, hyperbans, nasrl - StudyJob이라는 Custom Kubernetes Resource기 때문에 yaml CRD 형태로 사용 가능 - 모델 내 변경작업이 없이 Metric Collector가 수집하는 Log 형태만 변경하여 사용 - Worker, Metric Collector 두 개의 컴포넌트로 실행되며, 작성가능한 UI툴을 제공 4. Share - sprint #2
  • 21. 2.1. Katib 작동 원리 : MetricCollectorPod이 로그 수집 (로그 포멧 key=value) 4. Share - sprint #2
  • 22. 2.1. Katib StudyJob Apply - Validation accuracy 0.5 목표 - 30 requestcount : 하나의 Gpu Node(worker)당 30번 실행 - parameter 설정 batch_size, learning_rate, dropout, optimizer - Search Algorithm : random - requestNumber: 2 -> 2개의 Node(worker) 동시 진행 => 총 60개 Trial이 실행된다 돌려 놓고 퇴근 ! 4. Share - sprint #2
  • 23. 2.1. Katib Dashboard 4. Share - sprint #2
  • 24. 2.1. Katib 하이퍼파라미터 튜닝 - 0.5 도달 실패 : 0.35 optimizer가 SGD 일 경우 높은 val-acc 빈도 Dropout이 0.3에서 0.4일 경우 높은 val-acc 빈도 - 다시 파라미터 수정 optimizer를 SGD로 고정하여 재실행 dropout의 최저값을 0.3으로 수정 ... 0.48 -> 0.66 -> 0.77 4. Share - sprint #2
  • 25. 근데, 다른 튜너도 있지 않나?
  • 26. 2.1. Katib 하이퍼파라미터 튜닝 근데 다른 튜너도 있지 않나? - 케라스 튜너 (https://github.com/keras-team/keras-tuner) - Hyperas (https://github.com/maxpumperla/hyperas) - Kopt (https://github.com/Avsecz/kopt) 4. Share - sprint #2 케라스 튜너 Hyperas
  • 27. 2.1. Katib 하이퍼파라미터 튜닝 - 쿠버네티스 친화적이지 않음 - 기존 모델소스의 수정이 필요함... 4. Share - sprint #2 케라스 튜너 Hyperas
  • 28. 2.1. Katib 하이퍼파라미터 튜닝 - 카티브는 on kubernetes! - 튜닝에 사용될 Hyperparameter는 입력단으로만 정의 - 기존 모델소스의 수정없이 Log 양식만 변경하면 사용 (Keras에서는 Log용 callback 함수만 추가하면 끝!) 4. Share - sprint #2
  • 29. 2.1. Katib 리뷰 GOOD! - hyperparameter tuning tool WITHOUT CODE CHANGE! - 적용하고 기다리고 적용하고 기다리고 를 대신해 주기 때문에 체감시간 단축 -> 다른 작업을 더 할 수 있다! - Random Search만으로도 괜찮은 튜닝이 가능하다. - Train 자체를 Katib에서 실행하게 된다. BAD! - UI가 전혀 사용자 친화적이지 않음 : 제공하는 Rest API를 사용하는게 더 편함. - 여러 개의 검색알고리즘을 지원하지만 아직은 Grid, Random 말고는 적용하기가 쉽지가 않다. - Hyperparameter 범위를 int, double, categorical, discrete를 지원하지만 Pair로 지정할 수 없는 것이 아쉬움 - 목표 Metric을 하나만 설정할 수 있다 - UI를 통해 생성하는 StudyJob은 정상적으로 Metric Collector에 수집되지 않을때가 있다. 4. Share - sprint #2
  • 31. 2.2. Pipeline : ML Pipelines for Kubeflow Cloud native ML Workflow 생성툴 (자동화) - Argo에서 파생 - REST api 지원 - Pipeline SDK 제공 Jupyter Notebook에 pipeline SDK 설치 후 Pipeline 작성/ 배포 가능 - 관리를 위한 UI 제공 - Pipeline, Experiments, Run으로 구성 - One-off , Recurring 형태의 Run을 지원 4. Share - sprint #2
  • 32. 2.2. Pipeline - One-off Job 1. 데이터셋을 생성하는 Pipeline (1) Pipeline 4. Share - sprint #2 Compile create_pipeline.py $ dsl-compile --py create_pipeline.py --output create_pipeline.tar.gz Upload create_pipeline.tar.gz
  • 33. 2.2. Pipeline - One-off Job 1. 데이터셋을 생성하는 Pipeline (2) Run 4. Share - sprint #2 Run 생성 Run 실행
  • 34. 2.2. Pipeline 리뷰 GOOD! - SDK를 제공되기 때문에 손쉽게 pipeline 생성이 가능하다. - recurring run (cron)이 가능하기 때문에 다양한 응용이 가능하다. - 하나의 실행단위가 곧 Docker container이기 때문에 파이프라인 자체의 dependency는 없음. BAD! - 제공해주는 예제 자체는 GCP기준으로 되어 있어 GCP 환경이 아니라면 예제 실행에 어려움. 다른 컴포넌트들도 마찬가지 - 생성된 파이프라인는 수정할 수 없기 때문에 변경시 새로 생성해야 한다. API호출 모듈과 coupling이 있어서 불편. - Recurring Run 실행시 완료된 Run의 관리 필요. - 그렇지 않으면 종료된 수십, 수천여개의 컨테이너가 남게됨 - Cause Exception. getKubeletContainers failed: rpc error - Node status : Not Ready 4. Share - sprint #2
  • 35. DL team Infra team Output 0 day -오픈소스 모델 확보 -논문 구현 -퍼블릭 데이터 활용 -static GPU 할당 -Kubernetes on prem -Kubeflow install -Worker node drain -Jupyter notebook -Two stream 등 모델 -Kubernetes / Kubeflow on prem infra -Storage(MINIO) #1 -모델 확보 완료 -스캐폴드 -커스텀 데이터 확보 및 수집 -Kubeflow 리뷰 -Katib -Pipeline -Scaffold -Custom dataset & models -Kubeflow review report 1 (showcase) #2 -Katib 활용 하이퍼파라미터 튜닝 -Pipeline 데이터셋 업로드 -Kubeflow 리뷰 -Fairing -Seldon -Katib -Data pipeline (one-off) -Custom dataset & models #3 -Watch 메트릭, 추론 자동화 -Fairing (실패) -Multi-cluster 리뷰 -Storage sync 리뷰 (Rok) -Watch pipeline run #4 -모델 튜닝 / 앙상블 시작 -open-rok (Index) 120 days log (6월)
  • 36. DL team Infra team Output #3 -Pipeline - 모델 배포 및 추론 자동화 -Fairing (실패) -Multi-cluster 리뷰 -Storage sync 리뷰 (Rok) -Watch pipeline run 4. Share - sprint #3 - Watch pipeline run - 너무 불편한 Katib UI 개선 니즈 - watch + action + slack ui - Fairing - 실패 - on prem contribute 고민 - GPU scale out 니즈, 멀티클러스터 리서치 시작
  • 38. 4. Share - sprint #3 3.1. Recurring run - Watch Katib (accuracy)
  • 39. 4. Share - sprint #3 3.1. Recurring run - Watch Katib (dataset)
  • 40. 3.1. Recurring run - Demo 4. Share - sprint #3
  • 42. 3.2. Fairing : Python SDK for building, training, and deploying ML models “사용자의 ML Model을 다양한 대상(local, cloud)에 Train / Deploy할 수 있는 라이브러리” 4. Share - sprint #3 Check fairing-example.html
  • 43. 3.2. Fairing : Python SDK for building, training, and deploying ML models Fairing on Prem - 사용자가 생성한 Train model를 docker image 로 변환하여 Train job으로 submit - Docker image 생성시 kaniko를 사용 - kaniko는 이미지 생성시 Context 저장소를 GCS, S3, Local, Git만 사용하기 때문에 (S3는 AWS만 가능) on prem 환경에서 사용시 Local Dir을 사용해야 이미지 생성이 가능 - But, 현재 fairing stable 버젼은 Cluster Context Source가 GCS, S3만 사용 가능 4. Share - sprint #3
  • 44. 3.2. Fairing 4. Share - sprint #3 아직은 GCS_Context S3_Context 만 지원.
  • 46. 3.2. Fairing OnPrem Context support - Context 내용을 저장할 Storage필요 -> 파이프라인이 사용하는 Minio를 사용? - Minio client를 사용하여 Upload! -> Kaniko는 minio bucket이 마운트된 PV를 local:// 로 context 로딩 5. Roadmap - Fairing on prem context support
  • 47. 3.2. Fairing Discuss fairing On-prem on kubeflow fairing slack channel 5. Roadmap - Fairing on prem context support
  • 48. on prem GCP control cluster GCS NAS sync open-rok Custom schedule No code change No code change worker cluster 5. Roadmap - Katib cloud bursting support
  • 49. Appendix - Kubecon Europe 2019 (Spain) # Stateful(storage), Security, Multi cluster
  • 50. We are hiring! 두다지 - AI Service Accelerator - Kubeflow, Kubernetes, Cloud native ecosystem - AI Service, AI toolkits - Open source project를 통한 성공 사례를 꿈꾸는... [email protected]