meta_pixel
Tapesearch Logo
Log in
Machine Learning Guide

MLA 014 Machine Learning Hosting and Serverless Deployment

Machine Learning Guide

OCDevel

Artificial, Introduction, Learning, Courses, Technology, Ml, Intelligence, Ai, Machine, Education

4.9 • 848 Ratings

🗓️ 18 January 2021

⏱️ 53 minutes

🧾️ Download transcript

Summary

Machine learning model deployment on the cloud is typically handled with solutions like AWS SageMaker for end-to-end training and inference as a REST endpoint, AWS Batch for cost-effective on-demand batch jobs using Docker containers, and AWS Lambda for low-usage, serverless inference without GPU support. Storage and infrastructure options such as AWS EFS are essential for managing large model artifacts, while new tools like Cortex offer open source alternatives with features like cost savings and scale-to-zero for resource management.

Links

Cloud Providers for Machine Learning Hosting

  • The major cloud service providers for machine learning hosting are Amazon Web Services (AWS), Google Cloud Platform (GCP), and Microsoft Azure.
  • AWS is widely adopted due to rapid innovation, a large ecosystem, extensive documentation, and ease of integration with other AWS services, despite some features of GCP, such as TPUs, being attractive for specific use cases.

Core Machine Learning Hosting Services

1. AWS SageMaker

  • SageMaker is an end-to-end service for training, monitoring, and deploying machine learning models, including REST endpoint deployment for inference.
  • It features auto-scaling, built-in monitoring, and support for Jupyter notebooks, but it incurs at least a 40% cost premium over direct EC2 usage and is always-on, which can be costly for low-traffic applications.
  • AWS SageMaker provides REST endpoint deployment and training analytics.
  • Google Cloud offers GCP Cloud ML with similar functionality.

2. AWS Batch

  • AWS Batch allows one-off batch jobs, typically for resource-intensive ML training or infrequent inference, using Docker containers.
  • Batch supports spot instances for significant cost savings and automatically shuts down resources when jobs complete, reducing always-on costs.
  • Batch jobs can be triggered via CLI, console, or programmatically, and the service does not provide automatic deployment or monitoring functionality like SageMaker.
  • AWS Batch enables Docker-based batch jobs and leverages ECR for container hosting.

3. AWS Lambda

  • AWS Lambda provides serverless deployment for machine learning inference, auto-scaling to meet demand, and incurs costs only during actual usage, but it does not support GPU or Elastic Inference.
  • Lambda functions can utilize attached AWS EFS for storing and loading large model artifacts, which helps manage deployment size and cold start performance.
  • Only models that can perform inference efficiently on CPU within Lambda’s memory and compute limits are suitable for this approach.

4. Elastic Inference and Persistent Storage

  • AWS Elastic Inference enables the attachment of fractional GPU resources to EC2 or SageMaker for inference workloads, driving down costs by avoiding full GPU allocation.
  • AWS EFS (Elastic File System) is used to provide persistent, shared storage for model artifacts, allowing services like Batch and Lambda to efficiently access large files without repeated downloads.
  • AWS EFS allows mounting persistent file systems across services.

Model Optimization and Compatibility

  • Model optimizers such as ONNX (Open Neural Network Exchange) and Intel’s OpenVINO can compress and optimize machine learning models for efficient inference, enabling CPU-only deployment with minimal loss of accuracy.
  • ONNX helps convert models to a format that is interoperable across different frameworks and architectures, which supports serverless environments like Lambda.

Emerging and Alternative Providers

1. Cortex

  • Cortex is an open source system that orchestrates model training, deployment, and scaling on AWS, including support for spot instances and potential for scale-to-zero, reducing costs during idle periods.
  • Cortex aims to provide SageMaker-like capabilities without the additional premium and with greater flexibility over infrastructure management.

2. Other Providers

  • PaperSpace Gradient and FloydHub are additional providers offering ML model training and deployment services with cost-competitive offerings versus AWS.
  • PaperSpace is highlighted as significantly less expensive than SageMaker and Batch, though AWS integration and ecosystem breadth may still steer users toward AWS-native solutions.

Batch and Endpoint Model Deployment Scenarios

  • If model usage is rare (e.g., 1–50 times per day), batch approaches such as AWS Batch are cost-effective, running containerized jobs as needed and then shutting down.
  • For customer-facing applications requiring consistently available models, endpoint-based services like SageMaker, GCP Cloud ML, or Cortex are more appropriate.

Orchestration and Advanced Architectures

  • Kubernetes and related tools can be used to orchestrate ML models and complex pipelines at scale, enabling integration of components such as API gateways, serverless functions, and scalable training and inference systems.
  • Tools like KubeFlow leverage Kubernetes for deploying machine learning workloads, but require higher expertise and greater management effort.

Summary Table of Linked Services

Transcript

Click on a timestamp to play from that location

0:00.0

You're listening to Machine Learning Applied, and in this episode, we're going to talk about

0:03.9

machine learning hosting solutions out there with a special emphasis on serverless technology.

0:10.0

In the last Machine Learning Applied episode, we talked about various tech stack solutions,

0:14.8

especially for serverless solutions for hosting your server.

0:18.9

The Amplify Stack in particular uses behind the hood

0:22.9

AWS Lambda. And AWS Lambda is a very popular solution for serverless architectures.

0:29.0

AWS Lambda lets you write a single code function, whether it's Node.js or Python, and then

0:34.4

that function in conjunction with AWS API Gateway, will be exposed as a rest endpoint that your client can call.

0:42.5

Very powerful and saves you a lot of time and heartache.

0:45.4

Now, we want to achieve this level of functionality when deploying our machine learning models.

0:50.9

So in this episode, when I'm talking about machine learning deployment solutions,

0:55.3

I want to push towards as much of a serverless solution for deploying your machine learning

1:00.1

models as possible. Now, I want to preface by saying my own experience in machine learning

1:04.7

hosting is slightly unlimited, and in my experience trying to find the best serverless machine learning hosting technology

1:12.6

available, I've found that the providers are somewhat limited.

1:16.1

And this makes sense.

1:17.5

We've been deploying regular servers, app servers, using Fast API and Node.js for a very

1:23.5

long time.

1:24.1

And so hosting providers like AWS and GCP have had a lot of time to sit

1:29.2

with this problem in order to come up with solutions like AWS Lambda, where machine learning

1:34.9

is a more recently popular technology. And so they haven't had as much time to really perfect

1:41.1

this space. So you will find that even within a single cloud hosting provider

...

Please login to see the full transcript.

Disclaimer: The podcast and artwork embedded on this page are from OCDevel, and are the property of its owner and not affiliated with or endorsed by Tapesearch.

Generated transcripts are the property of OCDevel and are distributed freely under the Fair Use doctrine. Transcripts generated by Tapesearch are not guaranteed to be accurate.

Copyright © Tapesearch 2025.