ML Exam Prep - Sagemaker AI

 

ML Associate Exam Prep 

Sagemaker AI


  • SageMaker AI is the “heart” of the MLA-C01 certification
    • The majority of exam questions will have to do with SageMaker, and knowing it inside and out will be essential to do well in the exam.
    • It is important to understand and discern between SageMaker Processing, SageMaker Training, and SageMaker Hosting, which all cover different aspects of the end-to-end ML process.
    • These notes first cover generic ML knowledge and concepts, and then their implementation in AWS (usually involving SageMaker and other AWS services).
    • Some open-source Apache services like Hadoop or Spark are also covered, since they are also popular in ML environments and are well supported in AWS
    • It is a good idea to review the high-level overview of SageMaker that was done in the foundational AIF-C01 certification. MLA-C01 builds on top of that knowledge.

Intro to SageMaker AI
  • AWS service that can handle the whole E2E process in ML
    • E2E ML process = Data processing, model training, model deployment, and model hosting
    • Tons of features and sub-products (will go into depth in these notes)
  • SageMaker Training and Deployment Architecture
    • Input/output data usually in S3, but could be in other data stores
    • Training and inference code must be inside container images registered in ECR
    • Not all ML models will be deployed to endpoints.
E2E ML Process in SageMaker
  1. Data Preparation (data prep)
    • Data usually comes from S3
      • Data can also come from Athena, EMR, Redshift, Amazon Keyspaces DB…
    • Integration with Apache Spark
  2. Data Processing
    • Processing job: copy raw data from S3 → Spin up processing container → Output processed data to S3
    • Container can be SageMaker built-in or user provided (code)
  3. Training
    • Training job requires
      • URL of S3 bucket with training data
      • ML compute resources
      • URL of S3 bucket for output → Model outputted to S3
      • Container (ECR) path to training code
    • Many training options available
      • Built-in algorithms, Spark MLLib, Tensorflow, PyTorch, Scikit-learn, XGBoost, Hugging Face, your own Docker image, AWS marketplace-purchased algorithms…
  4. Deployment
    • 2 ways:
      • Persistent endpoint for individual predictions/inference on demand
      • SageMaker Batch Transform for predictions of an entire dataset
    • Many cool options: inference pipelines, SageMaker Neo (edge devices), Elastic Inference, automatic scaling, shadow testing…
SageMaker Domain
  • 🔧 Organizational unit within SageMaker → organize users, apps, and resources
    • A domain must be configured before you can do anything in SageMaker!
      • Think of it as an isolation of an ML project
  • Each domain has one EFS volume
    • Each user has their private EFS directory within that volume
    • There's a shared EFS directory available to all users
  • User profile: represents an individual user/person in a domain
    • Can create own personal apps
    • Can spin private SageMaker Studio instances
    • Has access to a private EFS directory to store personal files
  • Shared resources across all users:
    • Shared spaces
    • Shared EFS directory
    • Communal IDE app (SageMaker Studio public to all users)

Network Configuration in SageMaker Domain

  • By default, a domain has two VPCs
    1. One with public internet access → can expose public endpoints for your domain
      • Managed by SageMaker
      • Optional → can select “VPC Only” when creating the domain, which means this managed VPC is NOT created
    2. One for private traffic
      • Encrypted traffic to domain's EFS volume
      • YOU manage it: must specify the VPC, its subnets, and security groups (SGs)

Interfaces for Using SageMaker

SageMaker Notebooks

  • Old/classic method for ML in SageMaker → ML code
  • Spin up EC2 instances to host ML Notebooks, which direct ML E2E process:
    • S3 data access
    • ML code in Jupyter Notebook
      • Libraries like Scikit_learn, numpy, pandas, Apache Spark, Tensorflow, etc at your disposal
      • Wide variety of built-in models
    • Can spin up training instances
    • Can deploy trained models for making predictions (inferring) at scale

SageMaker SDKs

  • Training and deployment of ML models via Python scripts
  • Python API libraries → import inside your code
    1. Boto3 (low-level API)
    2. SageMaker Python SDK (high-level API)
  • Can automate ML workflows, manage training jobs, deployments, and pipelines

SageMaker Studio

  • Web-based IDE for E2E ML development

  • Features

    • Team collaboration
    • Tune and debug ML models
    • Deploy ML models
    • Automated workflows
  • SageMaker Studio Screenshot



SageMaker Console UI

  • AWS Management Console interface for SageMaker

    • GUI for managing SageMaker resources
  • Mostly for administrative tasks

  • Can access all other interfaces from the console UI

  • SageMaker Console UI Screenshot 



SageMaker Jumpstart 

  • ML Hub with many pre-trained ML models and pre-built ML solutions

    • Offers one-click deployment of models for inference
    • End-to-end solutions for common business problems
  • Computer Vision (CV) models, Natural Language Processing (NLP) models, GenAI Foundation Models (FMs)…

    • Amazon-owned models or 3rd-party provider models
    • Provider examples: HuggingFace, Databricks, Meta…
  • SageMaker Jumpstart Screenshot



SageMaker Canvas

  • No-code ML for business analysts

  • Features

    • Build custom ML model (leverages AutoML powered by SageMaker Autopilot)
      • e.g. Upload CSV data (CSV-only for now), select column to predict & build model
    • Automatic data cleaning (leverages Data Wrangler)
    • Access ready-to-use models from AWS AI services (Rekognition, Comprehend…)
    • GenAI support via Bedrock or JumpStart FMs
  • SageMaker Canvas Screenshot



Summary Table of Interfaces for SageMaker



Comments

Popular posts from this blog

GHL Email Campaigns

Whitelabel Options

Await