머신러닝 도우미, Amazon SageMaker 따라하기: SageMaker 국내 적용 사례
- 1. Machine Learning Platform (AWS SageMaker) 사례
Bespin Global, Machine Learning Team 조창윤 팀장
2020.07.03
📺발표 영상 다시보기 https://youtu.be/UlJdYQrtv8w
- 2. Copyright © 2020 BESPIN GLOBAL Co., Ltd. All rights reserved | Confidential
🌏http://www.bespinglobal.com | 📞1668-1280 | ✉info_aws@bespinglobal.com
2
SageMaker Overview
• 필요한 만큼 만 Sizing
• 언제든지 즉시, Deploy
• 사용한 만큼 지불
• Managed, Server-less
• 유연한 Re-Architecture
Public Cloud 특징
• 대용량 Data-Set 처리
• Built-in Algorithm 제공
• Hyperparameter Tuning 제공
• Serving시 Auto-Scaling제공
• 다양한 AWS Service 와 쉽게 연계
Machine Learning on AWS 특징
Build1
Training2
Serving3 Iteration
Notebooks
Experiments
AutoPilot
Debugger
Processing
Model Monitor
Machine Learning
Platform
New
- 3. Copyright © 2020 BESPIN GLOBAL Co., Ltd. All rights reserved | Confidential
🌏http://www.bespinglobal.com | 📞1668-1280 | ✉info_aws@bespinglobal.com
3
SageMaker Infrastructure
Data Lake Raw
데이터
Training
데이터
Validation
데이터
Test
데이터
Model Artifacts
1 Build 2 Training 3 Serving
Notebook Instance
Real-time Endpoints
Batch transformTraining jobs Hyperparameter tuning
Endpoint
Training
Image
Inference
Image
Processing, Build & Training
Training Code
Image
Notebook, Processing, Experiments, Debugger
Data-Set
Code
Real-time Endpoint & Batch Serving
Processing, Autopilot, Model Monitor
Inference Code
Image
Model
Artifacts
SageMaker
Studio
▪ AWS SageMaker (EC2, CPU/GPU, S3, ECS/ECR)
- 4. Copyright © 2020 BESPIN GLOBAL Co., Ltd. All rights reserved | Confidential
🌏http://www.bespinglobal.com | 📞1668-1280 | ✉info_aws@bespinglobal.com
4
사례: H사 (Demand Forecasting)
내부 데이터 소스
Database
외부 데이터 소스
다수의 내부/외부 데이터
환율, 유가
데이터
Batch, Trigger 실행
데이터 저장
Training 데이터
ML 결과 데이터
3
Machine Learning Platform (PaaS)
SageMaker (Jupyter Notebook)
Training
데이터 시각화
8
Self BI
7
9
5
Model Artifacts
Development4
Oracle PostgreSQL
데이터 파이프라인
2
Deploy/Prediction6
IoT 데이터 소스
장비 가동 및 운영 정보
1 Data
원본 데이터
예측 데이터
Data Visualization & Analysis
9
예측 결과
확인
Feature Engineering Model Training &
Parameter Tuning
Model Evaluation
AWS (Seoul)
- 5. Copyright © 2020 BESPIN GLOBAL Co., Ltd. All rights reserved | Confidential
🌏http://www.bespinglobal.com | 📞1668-1280 | ✉info_aws@bespinglobal.com
5
사례: H사 (Demand Forecasting)
▪ 언제나 고민 : Model 개수를 몇 개로 할것인가 (Data Point 개수만큼, 아님 단 하나)
▪ 데이터가 부족 : 6년을 모았다. But 주당 1건씩, 총 300 여건이다.
▪ 데이터에 대한 신뢰성 : 믿자, 믿지 않으면 그 무엇을 믿으리요.
▪ 주요 요인이 되는 데이터 : 누구보다 고민을 많이한 현업의 Domain Knowledge 가 최고!
▪ 현업과 같이 Project 을 진행 : 언제나 즐겁고 결과가 나쁘지 않다.
▪ ETL (Glue) 엔지니어에게 : 끝날때까지 미안하다, 요구사항을 끝없이 변경한다.
▪ To SageMaker
✓ 나는 퇴근하지만 Linear Learner 와 DeepAR 의 HPO 을 진행해줘서 고맙다.
✓ New Feature 인 Experiments 기능이 없어서 많이 아쉬웠다.
✓ 하나 진행하는동안 다른 하나로 다양한 Trial 을 할 수 있었다.
- 6. Copyright © 2020 BESPIN GLOBAL Co., Ltd. All rights reserved | Confidential
🌏http://www.bespinglobal.com | 📞1668-1280 | ✉info_aws@bespinglobal.com
6
사례: S사 (Demand Forecasting)
1차 데이터 가공
& Upload Data
Training
Forecasting
[Data Lake]
데이터 Ingestion
(API)
현업
시각화
SDK 을 이용한
Forecast API 호출
Preprocessing
& Training/Prediction
SCM
Amazon
Forecast Service
(SaaS)
AWS (Oregon)
A1
B1
B2
Prediction Data
결과 반영
A2
Prediction Data
결과 반영
1
Integrate API
현업
Access
Firewall Open
Elastic IP
Development / Production
Weekly Upload
CPU, GPU
P3(V100)
P2(K80)
DN(T4)
- 7. Copyright © 2020 BESPIN GLOBAL Co., Ltd. All rights reserved | Confidential
🌏http://www.bespinglobal.com | 📞1668-1280 | ✉info_aws@bespinglobal.com
7
사례: S사 (Demand Forecasting)
▪ 고객 요건
- Network 보안 제약 존재 (SSH 사용 불가), 단 HTTP/HTTPS 및 RDP 사용 가능
- 1개의 Model 로 운영중인 Python 코드 존재
- 제품 Segmentation 화 & 다양한 Model 개발 필요
- 비용 효율적으로 GPU 사용을 통한 빠른 Training 및 Prediction 수행 필요
- 여러명의 Data Scientist 분들이 끊임없는 Trial 을 수행할 수 있는 환경 필요
▪ 구현 방법
- 다양한 방법으로 Feature Engineering 진행 (on SageMaker)
- 2주 간격으로 다양한 모델 개발 및 Accuracy 측정 (on SageMaker)
- 개발된 모델은 EC2 (Deep Learning AMI) 에서 수행 (Gateway 형식의 Windows 서버, SageMaker Terminal 사용)
- 쉽게 GPU 을 탑재한 EC2 사용 (현재 Docker 을 이용한 분산 처리 시도중)
- Batch 형식으로 자동화
▪ On-Premise 에서 AWS SDK Python (Boto3) 을 사용하여 S3 에 Data-Set 을 Upload 함
▪ On-Premise 에서 S3 에 저장된 Prediction 결과를 Download 함
- 8. Copyright © 2020 BESPIN GLOBAL Co., Ltd. All rights reserved | Confidential
🌏http://www.bespinglobal.com | 📞1668-1280 | ✉info_aws@bespinglobal.com
8
사례: D사 (Anomaly Detection & Failure Cause Analysis)
S3 (Data Lake)
AWS (Seoul)
SageMaker
Raw Data Staging Data
Glue
Athena
AWS (Virginia)
S3
Glue
Training Data
ECS NotebookTraining/Serving
American corporation Korea corporation
Plant (25개)
(On-Premise)
Loading Transfer
[Data Lake]
- Raw Data
: Parquet
- Staging Data
: Parquet, Partitioned
IoT 데이터 소스
Plant Sensor, Status 정보
[Plant 당 데이터]
- Parquet 기준
- 크기 : 약 700MB/1달
- 간격 : 1~2 rows / sec
- Column 개수 : 625 개
Kinesis
Raw Data
현업
- 9. Copyright © 2020 BESPIN GLOBAL Co., Ltd. All rights reserved | Confidential
🌏http://www.bespinglobal.com | 📞1668-1280 | ✉info_aws@bespinglobal.com
9
사례: D사 (Anomaly Detection & Failure Cause Analysis)
▪ 데이터
- 데이터를 알고 있는 현업의 불참
▪ 장애 시점에 대한 명확한 부재 (연속 장애 상황에서), 장애 원인에 대한 신뢰성 없음
▪ Plant 별로 Feature 개수 다름, Feature 값의 시작 시점 다름, 정상 상태에서 Feature 값의 차이 존재 등
▪ Plant 장비에 대한 이해 부족 : 계절에 따른 온도 추이, 장애 원인에 따른 정상/비정상 Sensor 분류 등
- 데이터의 량은 많으나 데이터의 기간이 1년 이하의 데이터임 : Seasonality, Trend 파악 어려움
- DataLake (AWS S3) 에 Parquet 형식으로 저장되어 데이터 처리에 용이
▪ Work with SageMaker
- 대용량 데이터 분석을 진행
- 쉬운 Instance Type 변경 (컴퓨팅 최적화, 메모리 최적화 유형 등)
- 다양한 Built-in Algorithm 제공 : K-means, PCA (Principal Component Analysis), RCF (Random Cut Forest)
- DataLake (AWS S3) 및 AWS Athena 와의 쉬운 연계
- 10. HELPING YOUR AI & ML JOURNEY ON CLOUD.
📺발표 영상 다시보기 https://youtu.be/UlJdYQrtv8w
[문의] 📞1668-1280 ✉info_aws@bespinglobal.com