5. Deep Learning 플랫폼 초기 요구사항
Caffe, TensorFlow, Theano, Torch
Deep Learning Frameworks
6. C3DL 기반 기술 Docker
다양한 딥러닝 프레임워크를 깔끔하게 지원 가능
패키지 표준화 하면서 동시에 개인 환경에 맞도록 셋팅 가능
Why Docker?
naver/c3_dl-caffe naver/c3_dl-tensorflow user/pytorch
naver/c3_dl-base
7. C3DL 기반 기술 Docker
GPU isolation 지원
NVIDIA-Docker
https://github.com/NVIDIA/nvidia-docker
8. C3DL 기반 기술 Hadoop YARN
A framework for job scheduling and
cluster resource management.
Hadoop YARN
https://hadoop.apache.org/docs/current/hadoop-yarn/hadoop-yarn-site/YARN.html
12. 새로운 요구사항
Distributed inference
- training이 완료된 모델로 inference를 하고 싶다.
- 배치 작업, 오래 걸리는 작업들은 2~3개월 필요
사례: 웹 이미지 adult test
Distributed inference
를 구현했는데,
GPU할당만 해주면 돌릴께요
13. 새로운 요구사항
Distributed training
- 여러 장비에서 GPU할당 받아서 training을 하고 싶다
- 사실상 Distributed tensorflow 사용하고 싶다는 문의
Distributed tensorflow
사용하고 싶어요
14. 새로운 요구사항
Serving (long live)
웹서버를 실행해서 request, response 방식으로 처리
1000시간 넘게 실행하고 있네??
서버를 계속 실행해두면 되겠군.
15. 새로운 요구사항
CPU만 사용해서 실행
- training이 끝난 모델을 사용해서 inference만 하고 싶은데, CPU가 가성비가 더 좋은 경
우가 있음.
- 단, 기존 C3DL와 같은 방식으로 사용하고 싶다.
DL
Application
16. Distributed Deep Learning 솔루션 검토
Tensorflow on Spark - https://github.com/yahoo/TensorFlowOnSpark
DSSTNE - https://github.com/amzn/amazon-dsstne
Caffe on Spark - https://github.com/yahoo/CaffeOnSpark
Deeplearning4j on spark - https://deeplearning4j.org/spark
torch-distlearn - https://github.com/twitter/torch-distlearn
Distributed Keras - https://github.com/cerndb/dist-keras
Apache SINGA - http://www.comp.nus.edu.sg/~dbsystem/singa/
BigDL - https://github.com/intel-analytics/BigDL
Distributed Deep Learning 솔루션
17. Distributed Deep Learning 솔루션 검토
Tensorflow On Spark
http://yahoohadoop.tumblr.com/post/157196317141/open-sourcing-tensorflowonspark-distributed-deep
18. Distributed Deep Learning 솔루션 검토
DSSTNE
Amazon ECS
SparkAmazon ECS
GPU task
GPU slave
CPU
https://aws.amazon.com/ko/blogs/big-data/generating-recommendations-at-amazon-scale-with-apache-spark-and-amazon-dsstne/
20. YARN application 변경
한개의 JOB에 한개의 container만 실행
BATCH JOB이라고 가정하고 만들어져 있음
기존 C3DL
Distributed - 여러 container 동시 실행할때 장비 다운등 에러처리
Serving - Long-live JOB도 지원해야함
변경 & 구현 해야하는것
21. YARN application 개발
Resource Manager, Application Master, Node Manager, Container …
YARN API
예외 처리
Container가 죽었을때…, 장비가 다운되었을때..
예제 프로그램이 1000줄 이상…
Distributed Shell
22. Apache Slider
Slider is a YARN application to deploy existing distributed
applications on YARN
https://deview.kr/2016/schedule#session/168
Apache Slider 를 이용한 멀티테넌트 하둡 클러스터
26. Apache Slider - serving
Availability
- Application 자동으로 재시도
Flexibility
- container 개수를 증가/감소 시킬수 있음
원래 계속 실행하는 작업을 위해 만들어 졌음
27. Apache Slider contributor
https://issues.apache.org/jira/browse/SLIDER-1239
https://issues.apache.org/jira/browse/SLIDER-494
Batch 모드 개발
문서가 부족함
옆에 물어봄…
28. Apache Slider contributor
https://issues.apache.org/jira/browse/SLIDER-1239
https://issues.apache.org/jira/browse/SLIDER-494
Batch 모드 개발
문서가 부족함
옆에 물어봄…
29. Apache Slider contributor
https://issues.apache.org/jira/browse/SLIDER-1239
https://issues.apache.org/jira/browse/SLIDER-494
Batch 모드 개발
문서가 부족함
옆에 물어봄…
37. DL(Deep Learning) App 구현 Concept
• DL App 구성 요소
• Deep Learning Framework 환경 (Caffe, TensorFlow …)
• User Program ( Source Code )
• Input Data
• Output Data
Input Output
DL Framework 환경
Source
Code
38. DL(Deep Learning) App 구현 Concept
/User_Dev_Workspace
/DL_App_Workspace
Deep Learning App
Input
Output
User
Container
42. 분산 처리를 위한 구현 Concept
/User_Dev_Workspace
User
/DL_App_Workspace
Deep Learning App
Input
Output
Containe
r/DL_App_Workspace
Deep Learning App
Input
Output
Containe
r
/DL_App_Workspace
Deep Learning App
Input
Output
Containe
r
/User_Dev_Workspace
/User_Dev_Workspace
43. Distributed Inference
대용량 배치 작업, 오래 걸리는 작업들은 2~3개월 필요
Map-reduce 처럼 input, output만 지정하면 자동으로 나누어졌으면 좋겠다
GPU자원이 남으면 최대한 사용하고 싶다
요구사항
70. Docker Overlay Network 설정 삽질..
Zookeeper 여러개 설정은 ‘,’ 를 사용해서
zk://zk01.example.com:2181,zk02.example.com:2181,zk03.example.com:218
1
--cluster-store 설정
71. Docker Overlay Network 설정 삽질..
• --add-host --ip
• IP가 중복되면 안되서 IP관리가 필요함
• --link 옵션을
• --add-host와 비슷하게 동작하는데, deplicated 된 옵션
Docker 문서를 잘읽자
72. Distributed Tensorflow 삽질…
PS는 자동 종료가 안되서 수동으로 종료해주어야함
SERVICE type으로 설정하면 다른 BATCH 작업 종료후에 종료
Parameter Server는 종료 안됨
인터넷에 있는 Distributed Tensorflow 예제를 실행해 볼때 버전 확인
Tensorflow 버전이 빠르게 변하기 때문에 예전 버전의 예제들도 있음
Tensorflow 예제 코드의 버전 확인
73. Slider 개발 팁
stdout, stderr 출력 로그는 재시작할때마다 로그가 리셋됨.
{app_log_dir} 밑에 두는게 좋음
Log는 stdout, stderr 사용 안하는게 좋음
Install, start, stop, status는 모두 구현
status 무조건 0을 리턴하도록 구현해두어서 종료가 안되는 문제 있었음
74. To Do
Resource Scheduling 고도화
예약기능
짧은 시간동안 많은 GPU사용
성능 개선
Container 재활용
Tensorflow외에 다른 Distributed training 지원