Amazon SageMaker

Amazon SageMaker is a fully managed machine learning (ML) service that allows developers and data scientists to build, train, fine-tune, deploy, and monitor ML models at scale.

alt text

Key Use Cases

  1. Training/fine-tuning ML and deep learning models
  2. Hosting models for inference (real-time/batch)
  3. Automating ML workflows (MLOps)
  4. Experiment tracking, debugging, and monitoring
  5. Deploying pre-trained foundation models (LLMs)

SageMaker does not train a full LLM from scratch (e.g., from token-level data) unless you set up the massive infrastructure and code needed. Training a foundational LLM like GPT-3 from scratch requires thousands of GPUs and petabytes of data, which is typically done by AI labs or hyperscalers.

Instead, SageMaker is commonly used to fine-tune or deploy open-source LLMs or use Amazon's own pre-trained models (via JumpStart).

Common Scenarios

Scenario SageMaker Role
Fine-tune a BERT or LLaMA model Yes
Train a model from scratch (for small to mid-size models)
Train GPT-3-like models Not practical (use custom infra)
Host a chatbot backend model Real-time inference endpoint
Perform batch predictions Batch Transform

Core Components of SageMaker

  1. SageMaker Studio
    1. Web-based IDE for end-to-end ML
    2. JupyterLab interface to write, train, test models
    3. Supports notebooks, experiments, pipelines
  2. SageMaker Pipelines: CI/CD for ML workflows (MLOps)
  3. SageMaker Training: Train models using
    1. Built-in algorithms
    2. Pre-built containers (Hugging Face, PyTorch, TensorFlow)
    3. Bring Your Own Script (BYOS)
    4. Supports distributed training, Spot Instances, automatic model tuning (Hyperparameter Optimization)
  4. SageMaker JumpStart
    1. Access pre-trained models (e.g., LLaMA, Falcon, GPT2)
    2. Deploy or fine-tune models easily with templates
    3. Supports foundation models from Amazon and Hugging Face
  5. Other components
    1. SageMaker Inference Options
    2. SageMaker Experiments
    3. SageMaker Model Registry
    4. SageMaker Debugger & Monitor
    5. SageMaker Autopilot