Hello world!

MLOps

Practitioners guide to MLOps

xyz1 2022. 4. 25. 10:36

2021년도에 구글에서 발표한 MLOps 구축 가이드라인 백서 

Practitioners guide to MLOps: A framework for continuous delivery and automation of machine learning. 에 대해 정리하도록 하겠다.

 

내용을 간략히 정리하자면, MLOps를 구축하기 위해서는 lifecycle에 대해 신경을 써야한다. 

MLOps는 End-to-End process이기 때문에 이를 관리하는 입장에서는 매우 신경을 기울여야 한다.

중요한 점은 어떻게 신경을 쓸 것인가이다.

 

해당 가이드라인 백서는 신경써야할 부분을 쪼개서 관리할 수 있도록 잘 구축을 해두었다. 

따라서, 필자는 해당 백서를 통해 지금 나의 업무가 "어떤 위치"에 있고 그 업무에 관한 guideline을 찾는 형식으로 이 백서를 자주 참고할 예정이다.

 

 

The MLOps lifecycle

The MLOps lifecycle

#ML development

ML development concerns experimenting and developing a robust and reproducible model training procedure (training pipeline code), which consists of multiple tasks from data preparation and transformation to model training and evaluation

 

구축을 위해서는 아래 5가지 질문에 답이 스스로 정의 되어있어야한다.

  • What is the task?
  • How can we measure business impact?
  • What is the evaluation metric?
  • What is the relevant data?
  • What are the training and serving requirements?

Fig5는 ML development process를 보여준다. 이런 process를 구축하면 data scientist들은 빠르게 그들의 아이디어를 적용하여 실험할 수 있다.

 

 

#Training operationalization 

Training operationalization is the process of building and testing a repeatable ML training pipeline and then deploying it to a target execution environment.

CI/CD(지속적 통합/지속적 제공 및 배포)을 통해서 ML pipeline을 operationalization을 진행하는 것이다.

 

 

#Continuous training

새로운 데이터 들어오면 재학습을 했을 경우 더 좋은 성능을 보여질 수도 있다. 따라서 triggering 을 이용하여 모델을 retrain하는 과정이 필요하다.

Fig7에서 처럼 Retraining trigger가 발생을 시작으로 한다. 그 과정에 training pipeline이 한번 더 진행한다. (data ingestion, validation, registration 등에 대한 개념은 설명하지 않도록 하겠다. 너무 길어지기 때문..)

 

#Model deployment

target environment에 registered된 모델을 deployment하는 과정이다. 이 과정도 매우 중요하기에 관리가 필요하다. 따라서 구글에서는 이러한 관리 프로세스를 작성해둔것 같아 보인다. 여기서도 Deployment trigger가 발생하면 아래 그림의 process가 작동 될 수 있도록 해야한다.

 

 

 

 

#Prediction serving

In the prediction serving process, after the model is deployed to its target environment, the model service starts to accept prediction requests (serving data) and to serve responses with predictions. Figure 10 shows the elements of prediction serving.

#Continuous monitoring

Continuous monitoring is the process of monitoring the effectiveness and efficiency of a model in production, which is a crucial area of MLOps. It is essential to regularly and proactively verify that the model performance doesn’t decay. As the serving data changes over time, its properties start to deviate from the properties data that was used for training and evaluating the model. This leads to model effective performance degradation.

 

따라서 지속적인 모니터링이 필요하다. 지속적인 모니터링을 관리하기 위해서는 아래 그림과 같은 process가 필요하다.

 

 

Recap

MLOps는 탄생한지 얼마 안된 분야이다. 따라서 process 관리 부분에서 어떻게 해야할지 잘 모르는 경우가 많다. 하지만 구글은 이를 해결하기 위해서 MLOps process guideline을 제시했다. 우리는 이러한 guideline을 참고하면서 task에 대한 보다 명확한 이해를 통해 better MLOps architecture를 구축할 수 있다.

 

'MLOps' 카테고리의 다른 글

Protocol Buffers, Protobuf  (0) 2022.04.28
TFX Guide Local pipeline example  (0) 2022.04.25
TFX paper  (0) 2022.04.22
Kubernetes 자격증(CKAD) 준비  (0) 2022.04.19
ML pipeline 이란?  (0) 2022.04.18