MLOps Series #5 - Model Monitoring (모델 모니터링)
"이 포스팅은 쿠팡 파트너스 활동의 일환으로, 이에 따른 일정액의 수수료를 제공받습니다."
링크: "https://link.coupang.com/a/bqfD0v
MLOps 도입 가이드:기업에서 머신러닝 모델을 가장 효율적으로 운영하는 방법
COUPANG
www.coupang.com
Model Monitoring
Model Monitoring은 Serving 한 모델의 지속가능한 운영을 관리하는 것
출처: https://www.dkube.io/products/monitor/
Model을 모니터링하는 이유는 서버상의 이유로, 데이터가 갑자기 과다하게 들어와서, 정의하지 않았던 규칙의 행동이 감지되어서, 예상하지 못한 외생 변수의 영향의 발생 등으로 인해 갑작스럽게 서비스 운영에 차질이 생기는 것을 방지하기 위함이다. 기존에 서비스가 불안정해질 수 있는 요소들은 그대로 가진 채 모델의 안정성과 정확도까지 보장해야 하기 때문에 보다 신경 써질 게 많아진 것이다.
1) ML Model Monitoring 요소
Model을 관리할 때에는 아래의 요소들을 고려한다.
Monitor 1: Notification due to dependency change (dependency변경 알림)
Monitor 2: Data invariants hold in training and serving inputs (학습시와 서빙 시의 데이터 불변량이 동일한지)
Monitor 3: Training and serving features compute the same values (training과 서빙이 같은 계산 값을 반환하는지)
Monitor 4: Models are not too stale (모델이 오래됐는지)
Monitor 5: The model is numerically stable (모델이 수치적으로 안정적인지)
Monitor 6: The model has not experienced a dramatic or slow-leak regressions in training speed, serving latency, throughput, or RAM usage (모델이 너무 느리진 않은지)
Monitor 7: The model has not experienced a regression in prediction quality on served data (모델이 예측을 못하진 않았는지)
2) ML Monitoring vs Dev Monitoring
앞서 말했듯이 ML Model Monitoring은 Dev Op에서 고민하던 요소들을 동일하게 고려하되 Model적인 측면에서의 고려가 동시에 이뤄진다고 소개했다. 그렇다면 정확히 Model과 Dev에의 고민거리는 각각 어떻게 다를까?
(1) ML Model
A. Input Data Distribution (입력 데이터 분포)
B. Feature Distribution (특성 분포)
C. Output Data Distribution (결과값 분포)
D. Performance /Evaluation (평가 성능)
E. Model Stability (모델 안정성)
(2) Dev Ops
A. Request Latency (요청 지연)
B. Request Error Rate (요청 오류율)
C. CPU, Memory Utilization (CPU,메모리 사용)
D. Disk I/O (디스크 데이터 처리 속도)
E. Network Traffic (네트워크 트래픽)
3) ML 모니터링 오픈소스
A. Prometheus
B. Grafana
C. Grafana Loki
D. Thanos
Reference: