Return to page

BLOG

A Beginner’s View of H2O MLOps

 headshot

By Jo-Fai Chow | minute read | January 15, 2022

Blog decorative banner image

Note : this is a community blog post by Shamil Dilshan Prematunga . It was first published on Medium .

When we step into the AI application world it is not one easy step. It has a series of tasks that are combined. To convert an idea to the workable stage we must fulfill the requirements in each stage. When we look at existing platforms, there are leading solutions in the industry to fulfill each stage of the pipeline. The speciality of the H2O platform in my view is that it has the solution to each step in the pipeline.

  • Make – Build models and applications with accuracy. (Driverless AI and H2O Wave)
  • Operate – Machine Learning Operations to monitor and rapidly adapt to changing conditions. (H2O MLOps)
  • Innovate – Deliver innovative solutions to the end-user. (H2O AI App Store)
Figure 1: H2O End-to-End Process
www.h2o.ai2022/01/fig_001.png www.h2o.ai2022/01/fig_001.png

Here I am going to focus on the “Operate” section which mainly works with MLOps.

What is MLOps?

MLOps is the short-term of Machine Learning Operations. It is kind of a process that we can define as a seamless handoff between the Data Scientist and ML Engineer or the developer who takes the models to production. When we figure out the big picture of MLOps we can identify the three main goals:

  1. Fast experimentation and model development.
  2. Fast deployment of updated models into production.
  3. Quality assurance.

Main principles in MLOps

There are five general principles in MLOps:

  1. Automation — Automate the workflow steps without any manual intervention.
  2. Versioning — Track ML models and data sets with version control systems.
  3. Experiment Tracking — Multiple experiments on model training are parallelly executed.
  4. Monitoring — Monitor to assure that the ML model performs as expected.
  5. Testing — Tests for features and data, model development, and infrastructure.

How does it differ from DevOps?

The application of DevOps principles and practices to the machine learning workflow can be identified as MLOps. In addition to the usual CI/CD practices in DevOps, there is an additional stage in the MLOps pipeline called retraining. Since MLOps is mainly related to machine learning projects, the development life cycle is a bit different from other software developments.

In DevOps, software engineers develop the code itself while DevOps engineers are focused on deployment and creating a CI/CD pipeline. When it comes to MLOPs, data scientists play the role of software engineers as they write codes to build models while MLOPs Engineers are responsible for the deployment and monitoring of these models in production.

Why H2O MLOps?

In H2O MLOps, I can find three main sections: Model Repository , Model Deployment , and Model Monitoring . The cool nature of their platform is the flexible architecture that supports ML operations at the production level. We can find out three main pillars to describe the flexibility of the platform:

  1. ExtensibleH2O AI Cloud platform has clients for python, R, and Java which benefits users with the latest versions of open-source packages. This is helpful for users to train, deploy, and customize both H2O.ai as well as third-party models.
  2. Distributed — Due to the Kubernetes-based deployment approach in the platform, resource allocations are handled automatically. This is a great advantage as we can deploy and handle any data size and model training that occurs across multiple CPUs and GPUs.
  3. Scalable — Using existing high-performance NVIDIA GPUs and CUDA runtime to cater to demanding requirements. This is another great feature that provides high-performance service to the user.

We can now dig into the main sections covered in H2O MLOps:

  1. Model Repository – This is a kind of management section in H2O MLOps. This means their platform acts as a central place in the organization which can host and manage all experiments and their associated artifacts. Here we can register our experiments as models and maintain transparently with versioning. Other than models from Driverless AI, we can also use third-party models in MLOps.
  2. Model Deployment – Here we can build a model and then deploy it in different ways. Common deployment modes are known as multi-variant (A/B) mode and champion/challenger mode. For example, we can easily swap the current champion model in production with other challenger models based on performance.
  3. Model Monitoring – This feature helps maintain oversight over models in production. In real-world ML projects, the model performance may drift with time. This is due to changes in data and concept. In addition, H2O MLOps provides model feature importance results, experiment leaderboard as well as alerts and notifications.

The practicality of an end-to-end solution

Now, let me walk you through the end-to-end process with H2O MLOps. It is quite easy and user-friendly to work with their amazing and simple UI.

  1. Create a project – Once logged in to the H2O MLOps you can see an interface as below and you can create your project.
Figure 2: H2O MLOps Platform
www.h2o.ai2022/01/fig_002.png www.h2o.ai2022/01/fig_002.png
Figure 3: Create New Project
www.h2o.ai2022/01/fig_003.png www.h2o.ai2022/01/fig_003.png
Figure 4: After Creating New Project
www.h2o.ai2022/01/fig_004.png www.h2o.ai2022/01/fig_004.png

2. In Driverless AI, we can see the project we just created and we can link any Driverless AI experiments to that project. Here I ran an experiment related to the Melbourne House Price data set and linked the experiment to MLOps. We can see our model is added to the MLOps platform.

Figure 5: Driverless AI Updated Project List
www.h2o.ai2022/01/fig_005.png www.h2o.ai2022/01/fig_005.png
Figure 6: Create Experiment in DAI
www.h2o.ai2022/01/fig_006.png www.h2o.ai2022/01/fig_006.png
Figure 7: Inside view of the Empty Project
www.h2o.ai2022/01/fig_007.png www.h2o.ai2022/01/fig_007.png
Figure 8: Link Experiment to the Project
www.h2o.ai2022/01/fig_008.png www.h2o.ai2022/01/fig_008.png
Figure 9: MLOps Platform Updated with Linked Experiment
www.h2o.ai2022/01/fig_009.png www.h2o.ai2022/01/fig_009.png

3. Other than linking the Driverless AI model to MLOps directly, we can also import our models manually to the MLOps platform. For example, I ran another experiment using the same dataset and downloaded the MOJO scoring pipeline. Then I imported the pipeline (mojo.zip) to the MLOps platform.

Figure 10: Download MOJO Pipeline from DAI Experiment
www.h2o.ai2022/01/fig_010.png www.h2o.ai2022/01/fig_010.png
Figure 11: MOJO Download Page
www.h2o.ai2022/01/fig_011.png www.h2o.ai2022/01/fig_011.png
Figure 12: Add Model Interface in MLOps Platform
www.h2o.ai2022/01/fig_012.png www.h2o.ai2022/01/fig_012.png
Figure 13: Drag and Drop Downloaded MOJO from DAI
www.h2o.ai2022/01/fig_013.png www.h2o.ai2022/01/fig_013.png

4. We can deploy our imported model in the Dev (Development) platform or Prod (Production) platform. Initially, I tested the single model deployment which is the simplest one out of three. After the deployment, we can see it in the deployments section with some useful data. In the action bar, we have a lot more options as shown below.

Figure 14: Model Action Bar
www.h2o.ai2022/01/fig_014.png www.h2o.ai2022/01/fig_014.png
Figure 15: After Deploying Model
www.h2o.ai2022/01/fig_015.png www.h2o.ai2022/01/fig_015.png
Figure 16: Action Bar in Deployments
www.h2o.ai2022/01/fig_016.png www.h2o.ai2022/01/fig_016.png
Figure 17: More Details about the Deployment
www.h2o.ai2022/01/fig_017.png www.h2o.ai2022/01/fig_017.png
Figure 18: “Show Sample Request” Action
www.h2o.ai2022/01/fig_018.png www.h2o.ai2022/01/fig_018.png
Figure 19: Sample Request Output
www.h2o.ai2022/01/fig_019.png www.h2o.ai2022/01/fig_019.png

5. For the next deployment method, I tried out the “A/B Test” deployment. Here we have to select two or more models and click the “A/B Test”. This will compare the performance of selected models. We can also adjust the percentage of traffic for each model.

Figure 20: Select Multiple Models to the A/B Deployment
www.h2o.ai2022/01/fig_020.png www.h2o.ai2022/01/fig_020.png
Figure 21: Add Traffic Percentages
www.h2o.ai2022/01/fig_021.png www.h2o.ai2022/01/fig_021.png
Figure 22: View After the Deployment
www.h2o.ai2022/01/fig_022.png www.h2o.ai2022/01/fig_022.png

6. For the third and final deployment method, I tested the “Champion/Challenger” deployment. Here MLOps allows us to compare our preferred model (Champion) to a challenger model continuously. We have to select the action bar in front of the challenger model and fill the popup menu and deploy it as below.

Figure 23: Challenger Selection Action
www.h2o.ai2022/01/fig_023.png www.h2o.ai2022/01/fig_023.png
Figure 24: Champion Model Selection Step
www.h2o.ai2022/01/fig_024.png www.h2o.ai2022/01/fig_024.png
Figure 25: Deployment Environment Selection Step
www.h2o.ai2022/01/fig_025.png www.h2o.ai2022/01/fig_025.png
Figure 26: Add Security Level
www.h2o.ai2022/01/fig_026.png www.h2o.ai2022/01/fig_026.png
Figure 27: After Deploying in All Three Formats
www.h2o.ai2022/01/fig_027.png www.h2o.ai2022/01/fig_027.png

7. After the deployment, we can continuously monitor the performance of the model with alerts and warnings with a dashboard. I have added sample output collected from the H2O MLOps documentation.

Figure 28: Model Monitoring Step
www.h2o.ai2022/01/fig_028.png www.h2o.ai2022/01/fig_028.png
Figure 29: Model Monitoring Step
www.h2o.ai2022/01/fig_029.png www.h2o.ai2022/01/fig_029.png

Conclusion

Rather than using different platforms when working on machine learning projects, it is better to have a single platform that helps convert the idea and data into a usable end product. If you are a beginner, see a free demo today. Surely you will absorb more knowledge with hands-on experience.

 headshot

Jo-Fai Chow

Jo-fai (or Joe) has multiple roles (data scientist / evangelist / community manager) at H2O.ai. Since joining the company in 2016, Joe has delivered H2O talks/workshops in 40+ cities around Europe, US, and Asia. Nowadays, he is best known as the H2O #360Selfie guy. He is also the co-organiser of H2O's EMEA meetup groups including London Artificial Intelligence & Deep Learning - one of the biggest data science communities in the world with more than 11,000 members.