First wrote on 2024-04-03
저는 4년정도 MLOps 플랫폼을 개발하고 운영하는 업무를 subtask 로 맡아오고 있으며 다양한 플랫폼을 사용하고 개발해보았지만 아래가 핵심 단계라고 생각하여 한번 간단하게 정리해봤습니다.
I have been developing and operating MLOps platforms for about 4 years. I’ve used and developed various MLOps platforms, but I think the following are the key steps, so I have briefly summarized them
MLOps Core Concept

- Dataset 준비 단계 (Dataset Preparation)
- 모델 학습을 위해 데이터를 준비하는 과정은 많지만, 우선 여기서는 데이터셋을 확보한 후 라고 가정합니다.
- 여기서 dataset을 split 하여 train, test 셋으로 가지고 있어야합니다.
- 그리고 지속적인 모델의 학습과 업데이트를 위해서는 데이터셋 또한 버전을 관리해야합니다.
First, we have to gather the data that will help the training. But let’s assume we already have some datasets.
We have to split dataset into two parts: one for training and the other for checking if it learned well (testing).
It's also important to keep version of different datasets we use over time.
- Preprocess 단계 (Preprocess Stage)
- 모델마다 필요로하는 데이터 형식, 크기, 규격등이 다를 수 있습니다. 이 단계에서 이 과정을 처리하여 모델 학습단계로 넘깁니다.
Different models need data in different ways, like different sizes or formats. We make sure the data is just right for the model to start training from it.
- Train model 단계 (Train Model Stage)
- 학습시킬 데이터 준비가 끝났기때문에, 준비된 모델 또는 학습시키고자 하는 모델에 데이터셋을 넣고 학습을 진행합니다. 이 부분에서 필요한 대부분의 과정은 데이터사이언티스트, 모델링 담당 엔지니어분들이 진행합니다.
- 이 과정에서 모델 학습에 직접적으로 관여하지는 않지만, 모델을 학습할 수 있는 jupyterlab, code server, gpu node 등을 제공하고 트러블슈팅을 지원합니다. 이 과정에서 모델 학습에 필요한 하드웨어 스펙, 필요한 라이브러리 버전 등을 파악하고 이에 맞는 적절한 컨테이너 이미지와 노드 등을 배정해줄 수 있어야 합니다.
- 모델 학습과정과 관련하여 데이터셋을 효율적으로 관리 및 불러오고 또 tensorboard 등을 사용할 수 있도록 tensorboard, dvc, minio, nas 저장소 등의 사용방법을 가이드하기도 합니다.
Now that our data is ready, we can start training the model. Most of this is done by Model Engineer or Data scientists.
We facilitate model training by providing necessary infrastructure, such as JupyterLab, code servers, GPU nodes, and support for troubleshooting. It's crucial to understand the hardware specs and library versions required for model training and to allocate suitable container images and nodes accordingly.
We also guide the efficient management and retrieval of datasets during the training process and assist in the use of tools like TensorBoard, DVC, MinIO, and NAS storage systems.
- Test Model (validate) 단계
- 학습된 모델에 대한 적절한 평가를 하여 다음 단계로 넘어가 모델을 서빙할지, 재학습 시킬지 정하는 단계입니다. 해당 과정에서 재학습 또는 data 증강(augmentation) 이 필요할 경우 katib, kubernetes job 등을 활용해 동시에 여러가지 방법으로 모델을 학습시키고 결과를 볼 수 있도록 지원해왔습니다.
This stage involves evaluating the trained model to decide whether to proceed to deployment or to retrain it. If retraining or data augmentation is needed, we support this by utilizing tools like Katib and Kubernetes jobs, enabling multiple training approaches and result assessment.
- Serve model (serving) 단계
- 일반적인 flask 서버를 쓸 때도 있고, python 기반의 api 서버(FastAPI)에 test 를 거쳐 가장 성능이 높다고 평가받은 모델을 load 하여 요청을 받고 응답을 돌려줄 수 있도록 api 서버를 세팅하고 endpoint를 제공합니다.
- 이 과정에서 실제 데이터를 통한 모델의 결과를 보고, 예외처리, 데이터 또는 모델에 대한 재정비가 필요할 수 있습니다. 현실세계에서 AI 모델의 결과를 모니터링하고 Continuous training이 가능하도록 모니터링하고 현재 모델의 버전 또한 관리해야 합니다.
Depending on the situation, we may use a standard Flask server or set up a Python-based API(FastAPI) server. After testing, we load the best-performing model to handle requests and provide responses. We also set up the API server and provide endpoints for interaction.
During this phase, it's important to monitor the model's performance with real data, handle exceptions, and make necessary adjustments to the data or model. Monitoring the outcomes of AI models in the real world and managing the current version of the model for continuous training is also a crucial part of this stage.