logo
episode-header-image
Jan 2021
52m 33s

MLA 014 Machine Learning Hosting and Ser...

OCDevel
About this episode

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

Up next
Nov 2021
MLA 015 AWS SageMaker MLOps 1
<div> <p>SageMaker is an end-to-end machine learning platform on AWS that covers every stage of the ML lifecycle, including data ingestion, preparation, training, deployment, monitoring, and bias detection. The platform offers integrated tools such as Data Wrangler, Feature Store ... Show More
47m 31s
Nov 2021
MLA 016 AWS SageMaker MLOps 2
<div> <div> <p>SageMaker streamlines machine learning workflows by enabling integrated model training, tuning, deployment, monitoring, and pipeline automation within the AWS ecosystem, offering scalable compute options and flexible development environments. Cloud-native AWS machi ... Show More
1 h
Nov 2021
MLA 017 AWS Local Development
Try a walking desk while studying ML or working on your projects! Show notes: ocdevel.com/mlg/mla-17 Developing on AWS first (SageMaker or other) Consider developing against AWS as your local development environment, rather than only your cloud deployment environment. Solutions: ... Show More
1h 4m
Recommended Episodes
Aug 18
High Performance And Low Overhead Graphs With KuzuDB
SummaryIn this episode of the Data Engineering Podcast Prashanth Rao, an AI engineer at KuzuDB, talks about their embeddable graph database. Prashanth explains how KuzuDB addresses performance shortcomings in existing solutions through columnar storage and novel join algorithms. ... Show More
1h 1m
Jul 2024
The Rise of Generative AI Video Tools
Episode 13: What impact will AI-generated content have on the entertainment industry? Matt Wolfe (https://x.com/mreflow) and Nathan Lands (https://x.com/NathanLands) dive into this topic, envisioning a future where AI generates interactive movies and complex gaming worlds with in ... Show More
42m 48s
Sep 18
From RAG to Relational: How Agentic Patterns Are Reshaping Data Architecture
SummaryIn this episode of the AI Engineering Podcast Mark Brooker, VP and Distinguished Engineer at AWS, talks about how agentic workflows are transforming database usage and infrastructure design. He discusses the evolving role of data in AI systems, from traditional models to m ... Show More
52m 58s
Nov 2024
Code Generation & Synthetic Data With Loubna Ben Allal #51
Our guest today is Loubna Ben Allal, Machine Learning Engineer at Hugging Face 🤗 . In our conversation, Loubna first explains how she built two impressive code generation models: StarCoder and StarCoder2. We dig into the importance of data when training large models and what can ... Show More
47m 6s
Apr 2025
Canva Create 2025 - What's New for Educators? - HoET261
In this exciting crossover episode, Chris Nesi teams up with Leena Marie Saleh (The EdTech Guru) for a detailed look into Canva's latest educational innovations unveiled during Canva Create 2025. Whether you're a teacher, instructional coach, or tech integrator, this episode is p ... Show More
54m 32s
Jun 2025
806 : Topical English Vocabulary Lesson With Teacher Tiffani about Digital Art
<p>In today’s episode, you will learn a series of vocabulary words that are connected to a specific topic. This lesson will help you improve your ability to speak English fluently about a specific topic. It will also help you feel more confident in your English abilities.</p><h1> ... Show More
13m 21s
Jul 2024
Rendering Revolutions: Chaos founder Vlado Koylazov's Journey from V-Ray to Virtual Production
This podcast episode features Vlado Koylazov, co-founder of Chaos and inventor of the widely-used V-Ray rendering software. Koylazov shares his journey in computer graphics, from his early fascination with the field to the development of V-Ray and the latest innovations at Chaos. ... Show More
42m 42s
Sep 2024
Pausing to think about scikit-learn & OpenAI o1
<p>Recently the company stewarding the open source library scikit-learn announced their seed funding. Also, OpenAI released “o1” with new behavior in which it pauses to “think” about complex tasks. Chris and Daniel take some time to do their own thinking about o1 and the contrast ... Show More
50m 10s
Aug 2023
Deepdub’s Ofir Krakowski on Redefining Dubbing from Hollywood to Bollywood - Ep. 202
In the global entertainment landscape, TV show and film production stretches far beyond Hollywood or Bollywood — it's a worldwide phenomenon. However, while streaming platforms have broadened the reach of content, dubbing and translation technology still has plenty of room for gr ... Show More
32m 37s
Apr 2025
Simplifying Data Pipelines with Durable Execution
Summary In this episode of the Data Engineering Podcast Jeremy Edberg, CEO of DBOS, about durable execution and its impact on designing and implementing business logic for data systems. Jeremy explains how DBOS's serverless platform and orchestrator provide local resilience and r ... Show More
39m 49s