MLflow 모델 레지스트리 소개

MLflow 소개

Weston Bassler

Senior MLOps Engineer

모델 라이프사이클

개발, 스테이징 다이어그램

MLflow 소개

MLflow 모델 레지스트리

  • 중앙화된 저장 위치

  • 라이프사이클 관리

    • 웹 UI
    • MLflow Client 모듈
    • 모델 버전
    • 모델 단계

model-registry

MLflow 소개

MLflow 모델 레지스트리

  • 모델

    • MLflow Tracking에 로깅된 모델
  • 등록된 모델

    • 버전 부여
    • 단계 할당 가능
MLflow 소개

MLflow 모델 레지스트리

  • 모델 버전

    • 새 등록마다 증가
  • 모델 단계

    • 할당 가능:
      • None
      • Staging
      • Production
      • Archived

단계

MLflow 소개

Model Registry 사용법

모델

MLflow 소개

MLflow Client 모듈

  • 실험

  • 실행

  • 모델 버전

  • 등록된 모델

머신러닝

1 Flaticon.com
MLflow 소개

MLflow Client 모듈 사용

# Import from MLflow module
from mlflow import MlflowClient


# Create an instance client = MlflowClient()
# Print the object client
<mlflow.tracking.client.MlflowClient object at 0x101d55f30>
MLflow 소개

모델 등록하기

# Create a Model named "Unicorn"
client.create_registered_model(name="Unicorn")
<RegisteredModel: creation_timestamp=1679404160448, description=None, 
last_updated_timestamp=1679404160448, latest_versions=[], name='Unicorn', 
tags={}>
MLflow 소개

모델 UI

모델 생성

MLflow 소개

등록된 모델 검색

모델 검색

MLflow 소개

등록된 모델 검색

# Search for registered models
client.search_registered_models(filter_string=MY_FILTER_STRING)
  • 식별자
    • name - 모델의 이름
    • tags - 모델에 연결된 태그
  • 비교자
    • = - 같음
    • != - 같지 않음
    • LIKE - 대소문자 구분 패턴 일치
    • ILIKE - 대소문자 무시 패턴 일치
MLflow 소개

검색 예시

# Filter string
unicorn_filter_string = "name LIKE 'Unicorn%'"


# Search models client.search_registered_models(filter_string=unicorn_filter_string)
[<RegisteredModel: creation_timestamp=1679404160448, description=None, 
last_updated_timestamp=1679404160448, latest_versions=[], name='Unicorn', 
tags={}>, 
<RegisteredModel: creation_timestamp=1679404276745, description=None, 
last_updated_timestamp=1679404276745, latest_versions=[], name='Unicorn 2.0', 
tags={}>]
MLflow 소개

Let's practice!

MLflow 소개

Preparing Video For Download...