MLOps

[MLOps] 1. Motivation for MLOps

HJChung 2024. 4. 9. 18:16

link: https://ml-ops.org/content/motivation

 

Why you Might Want to use Machine Learning. 왜 ML을 적용하고 싶은가?

 

Statista Digital Economy Compass 2019,에 따르면 최근 트렌드는

  1. Data driven 세상. 엄청난 기하급수적으로 증가하는 데이터가 모이는 세상인 것과
  2. 이렇게 모여진 데이터에서 insight를 찾아내는 rtificial Intelligence / Machine Learning / Data Science 가 증가한다는 것.

모든 ML pipeline은 model을 만드는데 필요한 모든 연산들의 set이다.

요약: 그래서 대체 MLOps가 뭔데? MLOps, as a DevOps extension, establishes effective practices and processes around designing, building, and deploying ML models into production.

 

어디에 필요한가?

ML model 학습 측면

ML개발의 어려운 점을 알고, 이를 해결해주는것이 MLOps의 엔지니어링이다.

→ 그럼 ML개발의 어려운 점이 뭔지를 알아야 한다.

 

ML model 성능 측정측면

ML model을 input data가 주어졌을 때 어떤 output(이 output에는 classification, sentiment, recommendation, or clusters 이런 것들이 있고, 실제로 우리 회사에서도 classification, sentiment, recommendation, or clusters (중에 어떤 모델이 있는지 한 번 더 확인하기) 모델이 있고, 나는 이 모델을 서빙해 본 경험이 있다.) 을 내는 거라고 생각하면, 각 모델의 성능은 1) 정확도precision 2) recall 3) accuracy 로 평가할 수 있다.

—> 1. 우리 연구팀에서는 성능 평가를 어떻게 하는지 여쭤보기.

—> 2. 이걸로 모델 성능 측정을 자동화 할 수 있을까? 그러기 위해서는 1) 지금 우리 회사에서는 모델 성능 측정을 어떻게 하고 있으며 2) 만약 메뉴얼 하게 하고 있다면, 자동화 할 수 있는 부분이 있고, 이걸 내가 할 수 있는가? 를 확인해야함.

 

ML model 서빙 측면

학습된 모델을 제품화 한다는 것은 모델을 software system에서 사용 가능하도록 엔지니어링 한다는 것이다. 즉, ML model의 배포라고 할 수 있다. 이 단계를 보면,

어떤 모델 종류가 있고, 그 모델들이 어떻게 제품과 될 수 있는지를 보면,

  • Recommendation, which identifies the relevant product in a large collection based on the product description or user’s previous interactions.
  • Top-K Items Selection, which organizes a set of items in a particular order that is suitable for user (e.g. search result).
  • Classification, which assigns the input examples to one of the previously defined classes (e.g “spam”/”not spam”).
  • Prediction, which assigns some most probable value to an entity of interest, such as stock value.
  • Content Generation, to produce new content by learning from existing examples, such as finishing a Bach chorale cantata by learning from his former compositions.
  • Question Answering, which answers an explicit question for example: “Does this text describe this image?”
  • Automation, which can be a set of user steps performed automatically, such as stock trading
  • Fraud and Anomaly Detection, to identify an action or transaction being a fraud or suspicious
  • Information Extraction and Annotation, to identify important information in a text, such as people’s names, job descriptions, companies, and locations.

이런 것들이 있다.

하지만 ML model의 배포를 하고 나서의 어려움은,, 대표적으로

‘ 모델을 학습해서 생성할 때와 배포 한 후의 성능 차이가 있고, 이를 매우는 것이 어렵기 때문이다. (Because bridging the gap between ML model building and practical deployments is still a challenging task.) '.

 

 

 

그래서

위에서 1) ML model 학습, 2) ML model 성능 측정, 3) ML model 배포와 그 후 에서의 burden 에 대해서 알아보았다.

그럼 이 각각의 측면에서 어떻게 해결해 줄 수 있는 방법이 있을까 생각해보기 전에 ML Based Application(AI 기능이 탑재된 서비스)의 개발은 어떤 것들고 구성되어 있는지를 보고, 그 중 구멍을 매꾸는 방법이 있을까로 치환, 문제와 연관해서 생각해보면 어떤가?

The complete development pipeline includes three levels of change: DataML Model, and Code.

  • After deploying the ML model into a software system, we might recognize that as time goes by, the model starts to decay and to behave abnormally, so we would need new data to re-train our ML model.
  • After examining the available data, we might recognize that it’s difficult to get the data needed to solve the problem we previously defined, so we would need to re-formulate the problem.
  • In the ML project at some stages, we might go back in the process and either collect more data, or collect different data and re-label training data. This should trigger the re-training of the ML Model.
  • After serving the model to the end-users, we might recognize that the assumptions we made for training the model are wrong, so we have to change our model.
  • Sometimes the business objective might change while project development and we decide to change the machine learning algorithm to train the model.

https://libertegrace.tistory.com/entry/Lecture-머신러닝-엔지니어-실무-ML-Pipeline-이해 여기에 나온 어려움들이 고대로 있다.

지금까지

  1. 현재 왜 ML이 중요해지고 있는지 를 매우 간략하게 알아보았고,
  2. 근데 ML model을 학습(개발) 하고 제품화 하는데 어려움은 뭔지 를 알아보았다.

이제 MLOps가 뭔지 정의를 내려보자.

The term MLOps is defined as “the extension of the DevOps methodology to include Machine Learning and Data Science assets as first-class citizens within the DevOps ecology” Source: MLOps SIG.

MLOps라는 용어는 "머신 러닝 및 데이터 과학 자산을 DevOps 생태계의 일급 시민으로 포함하기 위한 DevOps 방법론의 확장"으로 정의됩니다. 출처: MLOps SIG.

MLOps, like DevOps, emerges from the understanding that separating the ML model development from the process that delivers it — ML operations — lowers quality, transparency, and agility of the whole intelligent software.