Back to Blog
MediumImported

The Guideline of MLOps in 2023 — Easy Way to Produce the ML Model

💡 本文同步發表於 Medium:原文連結

https://medium.com/@simon3458/the-guideline-of-mlops-in-2023-cc13483ce68

點擊查看連結詳情...

https://medium.com/@simon3458/the-guideline-of-mlops-in-2023-cc13483ce68

The Guideline of MLOps — Easy Way to Produce the ML Model

The guideline of MLOps — Easy Way to Produce the ML Model

Difficulty: ★ ★ ☆ ☆ ☆

Suggestion: You need to have the concept and basic knowledge of machine learning and want to know how to do the life cycle and pipeline. I hope you can list these MLOps concepts in your 2023 To-Do lists.

This article will provide MLOps information on:

  1. MLOps introduction: We will briefly give the definition of MLOps in the paragraph.
  2. How to build the end-to-end MLOps Pipeline: We will give you the pipeline about MLOps.
  3. Different Roles in MLOps concept: We will talk about the content of different job titles in this part.
  4. The benefit of MLOps: In this paragraph, we will explain why you need to use MLOps to do your AI project.

For those who want to learn more about MLOps, we have provided a cheat sheet and learning resources in this article. .

What is MLOps?

MLOps is a pipeline between training, deploying, and monitoring machine learning models. It extends the DevOps methodology to include machine learning and data science assets. This lets organizations easily add machine learning to their development processes and make sure that machine learning models are deployed and monitored correctly. MLOps can improve collaboration between data scientists and other IT professionals, automate the model development and deployment process, and improve the overall efficiency of machine learning projects. Continuous Delivery Foundation (CDF) defines it as the extension of the DevOps methodology to include Machine Learning and Data Science assets as first-class citizens within the DevOps ecology.

MLOps Concept: Contains Data Pipeline, Model Pipeline, and DevOps

MLOps contains three kinds of things — Data, Model, and Code. You must thoroughly prepare these items. If the user needs to train the new model, they need to spend the least amount of time possible on data processing, model training, and model evaluation. Therefore, version control is essential to MLOps concepts.

End-to-end MLOps Pipeline

In the MLOps pipeline, We implement the following stages:

End-to-end MLOps Pipeline: Contains Initialization, Develop, Deployment and Operation

  1. Scoping: Plan and check that the project or product scope is suitable for Machine Learning Model.
  2. Data Engineering: Building the data processing pipeline, we can call it the DataOps pipeline, includes the following method:
    • E: Data Extraction — Collect the data
    • T: Transform the data into the dataset and label the dataset.
    • L: Load the dataset into a database or file system.
    • P: Check the data Profiling content. We can use the dashboard to show the data insight and modify the Data ETL pipeline.
    • A: Check the data quality and Assertion status. We must promise that the actual situation can represent the dataset. 
      InfuseAI provides the open-source data assertion and profiling tool — Piperider, to check the data quality toolkit for data professionals. Please see more detail here.
  3. Model Engineering: Here are some steps to build up a modeling pipeline.
    A. Model Building: Initial the model pipeline and callback method.
    B. Model Training: Train the data by the machine learning or deep learning Model. At the same time, we need to define the measurement and track the model performance. For example, confusion matrix methods or accuracy metrics.
    C. Model Evaluation: Check the model is ready for deployment. For example, if the accuracy rate is more significant than 0.95, we can change to the new model.
    D. Model Registry: Register and Put the model into the production waiting line.
  4. Model Deployment: Use the ‘Dockerize’ method to package the model and deploy it into the cloud or edge devices as endpoints. The package method could be an API server or serverless way.
  5. Monitoring: Monitor the model service performance, which contains two parts:
    A. Monitor the infrastructure we deploy: E.g., load, usage, storage, and health.
    B. Monitor the model for its performance: Model and data performance that we need to retrain.

You can download the MLOps cheatsheet here:

MLOps cheatsheet

Different Roles in MLOps concept

In this part, we will give suggestions for different roles or teams of users. They can check for deficiencies and bring them up to full strength.

For Project Management Team

  1. Defining The Business Use Case: Increase metrics, decrease time, and reduce errors.
  2. Understand the Machine Learning Scope: You must check that your project scope is suitable for using the ML method to solve the problem.
  3. Understand where the data is: Does the project need to collect the new data? Or do we need to prepare the data from the database?
  4. Need to Label the dataset: Does the data has the output value? Or do we need to find domain experts to label the data?
  5. Project costs and time: 
    A. Do we need to use GPU to train the data? 
    B. Do we have an environment to train the model? or do we need to use the cloud service to train the model? 
    C. How much human working time do we need to spend?

For Data Engineering Team

  1. Input database: We need to plan that the status database system is production-ready. We can afford the requirements if the user needs to get the data directly.
  2. Data transformation: We need to do the data transformation pipeline to know that the data can be used in the ML pipeline.
  3. Data profiling: This is an excellent method to discuss with the project manager and data scientist. We can get the information in the dashboard and know how to adjust the data pipeline to fit the requirement.
  4. Data Assertion: When we build the data process method, don’t forget to make the assertion rules to check your data pipeline. If the users want to get the latest dataset, you can use the rules to understand if the data is corrected or not.
    InfuseAI provides the open-source tool — Piperider to check the data quality status. You can check the information here: https://www.piperider.io/.
  5. Output Storage: When the data transformation pipeline is finished, you need to specify the storage to put the files. Cloud Storage or nfs storage is the better way to save the data files.

For Data Scientist Team

  1. Choose ML Model: Using a suitable model is important. We need to choose the correct type of ML model for the project.
  2. Initial the Model Training Environment: Using the docker method to build the environment is essential to train the model everywhere. InfuseAI provides the open-source software Crane to build up an environment. You can check the information here: https://github.com/InfuseAI/crane.
  3. Model Training: Start to train the baseline model. If we need to use the GPU to train the model, we must prepare the GPU driver environment.
    If you use Google Colab to train the model, InfuseAI provides the open-source tool colab-xterm to open a terminal in a cell. You can check the information here: https://github.com/InfuseAI/colab-xterm.
  4. Model Evaluation and Tunning: Tune the mode and check the performance and metrics of the model. If we achieve the goal, we can deliver the model to service.
  5. Model Registry: Similarly, we push the code to the git repository. If we know that the model can be used, we can record the model as one of the production-ready models.
  6. Model Deployment: If the user needs the API service to predict the result, we can deploy the model as a model service. After the model deployment, we can ask the IT development or ML application Team to build the application system.
    InfuseAI provides the open-source Kubernetes platform PrimeHub to build up a Machine Learning end-to-end pipeline and deploy the model as a service. You can check the information here: <https://www.infuseai.io/primehub-ai-platform>.

For IT Development or ML Application Team

  1. Build up an ML application service: The engineers need to know how to use the model API service to predict the result and use it in the application.
  2. Build a model prediction feedback system: If we want to train the latest ML model, we need to get the new data label. The data scientist can use the data in the feedback system to introduce the new ML model.

For IT DevOps Team

Operate the ML and application service: Use the monitoring tools to know whether the service is running. Also, we need data scientists to give troubleshooting guides on how to solve the inaccurate model problem.

The benefit of MLOps

MLOps gives engineers many benefits and helps us build the machine learning model fast. This part takes an in-depth look at the five top evidence-based benefits of the MLOps method.

1. Productivity

When data scientists want to build up an ML model, the ML lifecycle will let them do many Repeatable things. For example, environment setting and retraining the model are very annoying and take lots of time to process. Therefore, we need to raise the efficiency of building the ML model.
MLOps pipeline can bring the standard method to build and deploy the ML model service. The pipeline includes data engineering, model engineering, and other steps. I think this method can bring cost-effective value and let the user more efficiently

2. Reproducibility

When we get the final model, we need to notice that we can reproduce the model in the future. ML Model is not permanently effective, and we need to update it before we find the evaluation problem. 
Besides this, we must do the data, code, and model version control. Version control can help us to roll back to the previous version in a short time. If we meet the training or evaluation error, we can get the elements mentioned above and do the same work.

3. Cross-team teamwork

In the previous section, we talk about the role of different teams. A machine learning project needs lots of team members to fulfill the goal. Therefore, besides the data engineering team and data scientist. It includes the IT and DevOps Teams. After everyone understands the role task, we can deliver better and faster. Reducing communication time is the better way to use the MLOps solution.

4. Monitorability

Providing the best model prediction and monitoring the model or data drift problem is important in monitoring. MLOps tell us that retraining the ML model is the best way to provide the best model. When the monitoring service finds that there is a drift problem, we will give the message to the data scientist. They can check the result

5. Cost Reduction

When we finish building up the MLOps standard pipeline, we can understand our cost. We can calculate the exact money and revenue if we need to plan the project cost. This is the most important information for the project managers and account managers to know how to give the project service. Also, customers can understand that we can save the expenses them.

MLOps Cheatsheet

I provide the MLOps cheatsheet and hope you can easily understand the MLOps method. Please see the image below for MLOps cheatsheet download.

MLOps cheatsheet

MLOps cheatsheet

MLOps Course and learning document

If you want to learn more detail technology, you can use the online course or document to make up for a deficiency. Here, we recommend the online free course that can help you understand the MLOps:

  • Made With ML MLOps Course: <https://madewithml.com/#mlops>

This is a free and open-source project that can fully understand how to use the tools to do your MLOps works. They want the user to focus on first principles, not just jumping into tooling/code. The project is put on GitHub and gets more than 30k+ stars. I think this is a great opportunity to learn more about MLOps.

MLOps roadmap 2022

Continuous Delivery Foundation (CDF) provides the five-year MLOps roadmap for future customer requirements on the GitHub website. They hope the tips of the document can improve the overall state of MLOps and that the information can be a capability for all. Please check the following record and see the plan of MLOps.

sig-mlops/roadmap/2022/MLOpsRoadmap2022.md at main · cdfoundation/sig-mlops

CDF SIG MLOps. Contribute to cdfoundation/sig-mlops development by creating an account on GitHub.

https://github.com/cdfoundation/sig-mlops/blob/main/roadmap/2022/MLOpsRoadmap2022.md

Conclusion

MLOps can help you to use the easy way to produce the ML model. Therefore, We provide the total guideline about MLOps technology. The manager can use this document to check what capabilities your team is missing and try to make up for the ability of engineers. We hope that the methods can systematically help the machine learning projects be on schedule and make you successful.

I am Simon

Hi, I am Simon, the Customer Success Engineer at InfuseAI. If you think the article is helpful to you, please give me applause. Welcome to provide some suggestions and discuss with me in InfuseAI Discord.
Linkedin: <https://www.linkedin.com/in/simonliuyuwei/>

We are InfuseAI

InfuseAI provides MLOps tools:

  1. PrimeHub— Our end-to-end MLOps platform is the entire machine learning lifecycle in one platform.
  2. MLOps consultant — Let the user know how to use MLOps to do the machine learning pipeline.
  3. Piperider— The data quality toolkit for data professionals.

Join our machine learning community to discover more: InfuseAI Discord

Join our Discord Community!

這篇文章有幫上忙嗎?

留言

載入留言中…