Automate Model Deployment
Click to read more. •
the team's agility.
Click to read more.
Intent
Motivation
Applicability
Description
Automated deployment involves automatically packing the model together with its dependencies and ‘shipping’ it to a production server, instead of manually connecting to a server and performing the deployment.
Automated model deployment brings several advantages. At first, it saves time and it increases reliability because the chances to introduce human errors are removed. Secondly, it improves availability and scalability because one can repeat the process on demand for as many instances as it is needed, without manual intervention. This means one can spin off many instances of the model whenever many users need access to a service and decrease the number of instances when the demand lowers.
In order to facilitate continuous deployment:
- use virtualization abstractions , e.g. Docker, Kubeflow,
- use CD tools, e.g. Gitlab CD/Shipyard, Travis, etc.
Export Models in Portable, Standard Formats
Tying a deployed model to a specific framework version or runtime creates fragility: a library update can break serving, and migrating infrastructure becomes difficult. Export trained models to a framework-independent format as part of the deployment pipeline:
- ONNX for interoperability across frameworks (PyTorch, TensorFlow, scikit-learn) and runtimes (ONNX Runtime, TensorRT, OpenVINO),
- TorchScript for self-contained PyTorch models that do not require Python at inference time,
- TensorFlow SavedModel for TensorFlow/Keras models targeting TF Serving or TFLite.
Include format validation and an inference parity test (output of exported model equals output of original within numerical tolerance) as a gate in the packaging step.
Adoption
Related
- Build an ML Observability Infrastructure
- Design Hierarchical Fallback Architectures for Resilient ML Inference
- Use Versioning for Data, Model, Configurations and Training Scripts
Read more
- Preparing and Architecting for Machine Learning
- Machine Learning Logistics
- Operational Machine Learning
- Versioning for end-to-end machine learning pipelines
Click to read more. •
the team's agility.
Click to read more.