Letโs remind ourselves of how a ๐ฅ๐ฒ๐พ๐๐ฒ๐๐-๐ฅ๐ฒ๐๐ฝ๐ผ๐ป๐๐ฒ ๐ ๐ผ๐ฑ๐ฒ๐น ๐๐ฒ๐ฝ๐น๐ผ๐๐บ๐ฒ๐ป๐ looks like - ๐ง๐ต๐ฒ ๐ ๐๐ข๐ฝ๐ ๐ช๐ฎ๐.
You will find this type of model deployment to be the most popular when it comes to Online Machine Learning Systems.
Let's zoom in:
๐ญ: Version Control: Machine Learning Training Pipeline is defined in code, once merged to the main branch it is built and triggered.
๐
๐ฎ: Feature Preprocessing: Features are retrieved from the Feature Store, validated and passed to the next stage. Any feature related metadata that is tightly coupled to the Model being trained is saved to the Experiment Tracking System.
๐
๐ฏ: Model is trained and validated on Preprocessed Data, Model related metadata is saved to the Experiment Tracking System.
๐
๐ฐ.๐ญ: If Model Validation passes all checks - Model Artifact is passed to a Model Registry.
๐ฐ.๐ฎ: Model is packaged into a container ready to be exposed as REST or gRPC API. Model is Served for deployment.
๐
๐ฑ.๐ญ: Experiment Tracking metadata is connected to Model Registry per Model Artifact. Responsible person chooses the best candidate and switches its state to Production.
๐
๐ฑ.๐ฎ: A web-hook is triggered by the action and a Deployment Pipeline is launched that deploys the new version of containerised API. There are different release strategies that we covered in one of the previous posts.
๐
๐ฒ: A Request from a Product Application is performed against the API - Features for inference are retrieved from Real Time Feature Serving API and inference results are returned to the Application.
๐ณ: ML APIs are faced with a Load Balancer to enable horizontal scaling.
๐
๐ด: Multiple ML APIs will be exposed in this way to support different Product Applications. A good example is a Ranking Function.
๐ต: Feature Store will be mounted on top of a Data Warehouse to retrieve Static Features or
๐
๐ต.๐ญ: Some of the Features will be Dynamic and calculated in Real Time from a Distributed Messaging System like Kafka.
๐
๐ญ๐ฌ: An orchestrator schedules Model Retraining.
๐ญ๐ญ: ML Models that run in production are monitored. If Model quality degrades - retraining can be automatically triggered.
๐
[๐๐ ๐ฃ๐ข๐ฅ๐ง๐๐ก๐ง]: The Defined Flow assumes that your Pipelines are already Tested and ready to be released to Production. Weโll look into the pre-production flow in future episodes.
๐ฃ๐ฟ๐ผ๐ ๐ฎ๐ป๐ฑ ๐๐ผ๐ป๐:
โ Dynamic Features - available.
โ Low Latency Inference.
๐
โ๏ธInference results will be recalculated even if the input or result did not change (unless additional caching mechanism are implemented).
And remember - ๐ง๐ต๐ถ๐ ๐ถ๐ ๐ง๐ต๐ฒ ๐ช๐ฎ๐.
๐ก๐ผ ๐๐ ๐ฐ๐๐๐ฒ๐ ๐๐ฎ๐๐ฎ ๐๐ป๐ด๐ถ๐ป๐ฒ๐ฒ๐ฟ๐ถ๐ป๐ด ๐ฃ๐ผ๐ฟ๐๐ณ๐ผ๐น๐ถ๐ผ ๐ง๐ฒ๐บ๐ฝ๐น๐ฎ๐๐ฒ - next week I will enrich it with the missing Machine Learning and MLOps parts!
Lambda and Kappa are both Data architectures proposed to solve movement of large amounts of data for reliable Online access.
๐
The most popular architecture has been and continues to be Lambda. However, with Stream Processing becoming more accessible to organizations of every size you will be hearing a lot more of Kappa in the near future. Letโs see how they are different.
1๏ธโฃ โ๐๐๐ป๐ฑ๐ฎ๐บ๐ฒ๐ป๐๐ฎ๐น๐ ๐ผ๐ณ ๐๐ฎ๐๐ฎ ๐๐ป๐ด๐ถ๐ป๐ฒ๐ฒ๐ฟ๐ถ๐ป๐ดโ - A book that I wish I had 5 years ago. After reading it you will understand the entire Data Engineering workflow. It will prepare you for further deep dives.
๐
2๏ธโฃ โ๐๐ฐ๐ฐ๐ฒ๐น๐ฒ๐ฟ๐ฎ๐๐ฒโ - Data Engineers should follow the same practices that Software Engineers do and more. After reading this book you will understand DevOps practices in and out.
Feature Store System sits between Data Engineering and Machine Learning Pipelines and it solves the following issues:
โก๏ธ Eliminates Training/Serving skew by syncing Batch and Online Serving Storages (5)
๐
โก๏ธ Enables Feature Sharing and Discoverability through the Metadata Layer - you define the Feature Transformations once, enable discoverability through the Feature Catalog and then serve Feature Sets for training and inference purposes trough unified interface (4๏ธ,3).
๐๐ต๐ฎ๐ป๐ด๐ฒ ๐๐ฎ๐๐ฎ ๐๐ฎ๐ฝ๐๐๐ฟ๐ฒ is a software process used to replicate actions performed against Operational Databases for use in downstream applications.
โก๏ธ ๐๐ฎ๐๐ฎ๐ฏ๐ฎ๐๐ฒ ๐ฅ๐ฒ๐ฝ๐น๐ถ๐ฐ๐ฎ๐๐ถ๐ผ๐ป (refer to 3๏ธโฃ in the Diagram).
๐ CDC can be used for moving transactions performed against Source Database to a Target DB. If each transaction is replicated - it is possible to retain all ACID guarantees when performing replication.
It should be composed of two integrated parts: Experiment Tracking System and a Model Registry.
From where you track ML Pipeline metadata will depend on MLOps maturity in your company.
If you are at the beginning of the ML journey you might be:
๐
1๏ธโฃ Training and Serving your Models from experimentation environment - you run ML Pipelines inside of your Notebook and do that manually at each retraining.
If you are beyond Notebooks you will be running ML Pipelines from CI/CD Pipelines and on Orchestrator triggers.