Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nov05/6f39c83c143d91175075fb8e7e871d0c to your computer and use it in GitHub Desktop.
Save nov05/6f39c83c143d91175075fb8e7e871d0c to your computer and use it in GitHub Desktop.

๐ŸŸข Different Levels of AWS Resources for Machine Learning Model Training and Deployment

  1. ๐Ÿ‘‰ EC2 Instances: Full User Control (Least Pre-built Content)
    With EC2, you have complete control over the entire setup. You need to:

    • Start an EC2 instance (e.g., GPU-enabled for training deep learning models).
    • Install dependencies manually (e.g., Python, ML libraries like PyTorch or TensorFlow).
    • Copy or configure the training script, and handle the training data management (downloading data from S3 or other sources).
    • Run the training process manually using your own code.
    • Manage all aspects of the environment, scaling, and resource management.

    Use Case: This is suited for advanced users who need fine-grained control over their infrastructure and model training environment.

  2. ๐Ÿ‘‰ SageMaker Studio or Notebook Instances: Medium Level (Some Pre-built Content)
    SageMaker Studio or Notebook Instances provide a more managed environment for model training:

    • Pre-installed machine learning frameworks and data science packages (e.g., TensorFlow, PyTorch, Scikit-learn) are available, so you donโ€™t need to install them manually.
    • You still need to choose the instance type (CPU/GPU) and the number of instances for your training.
    • Write your training script, and arrange for input data from S3 or other sources.
    • Run the training job with SageMaker managing infrastructure provisioning, while you configure the runtime.
    • Youโ€™ll work within a Jupyter IDE, which provides an interactive experience and allows you to save step-by-step outputs in a notebook, aiding in experimentation and tracking.

    Use Case: This is ideal for users who want a balance between control and convenience, using pre-installed tools in a familiar notebook environment.

  3. ๐Ÿ‘‰ SageMaker Pre-built Algorithm Containers (Most Pre-built Content)
    For SageMakerโ€™s pre-built algorithm containers (available in AWS ECR):

    • The algorithm (e.g., Linear Learner, XGBoost, etc.) comes pre-packaged within a Docker container.
    • You only need to arrange the input data (typically in S3) and the location to save the model.
    • In some cases, there are pre-trained model images available to fine-tune or use directly.
    • You still choose the instance type and the number of instances, but SageMaker manages the rest of the infrastructure and runs the pre-built algorithm for you.

    Use Case: This is perfect for users who want to train models quickly without dealing with the complexity of infrastructure management or custom coding. Itโ€™s ideal for common algorithms and fast experimentation.

  4. ๐Ÿ‘‰ AWS SageMaker JumpStart: No-Code/Low-Code Option
    AWS JumpStart offers a no-code/low-code solution for getting started with machine learning:

    • JumpStart provides pre-built solutions and pre-trained models that can be deployed with minimal or no code.
    • It includes popular use cases (e.g., object detection, sentiment analysis) and can be used to fine-tune models on your own data.
    • JumpStart simplifies the entire process from model selection to deployment with a user-friendly interface.

    Use Case: This is perfect for users or businesses looking to quickly implement machine learning solutions without deep expertise in coding or managing infrastructure.


These levels provide a range of options from complete control to minimal involvement, letting you choose the approach that best fits your needs.

@nov05
Copy link
Author

nov05 commented Jan 27, 2025

โœ… 20241219 AWS Machine Learning - Training with EC2 (demo video)
https://www.youtube.com/watch?v=yBq0Fn7Z6RU

โœ… AWS SageMaker SDK PyTorch ResNet50 (example project)
https://github.com/nov05/udacity-CD0387-deep-learning-topics-within-computer-vision-nlp-project-starter
โ€ƒ โ€ข Training job with debugging and profiling enabled notebook
โ€ƒ โ€ข Training script
โ€ƒ โ€ข Inference script

โœ… AWS ECR Linear learner container (example notebook)
https://github.com/nov05/udacity-aws-mle-nano-course5/blob/main/exercise_3.5/multiinstancestarterfile.ipynb



๐Ÿ‘‰ Docker containers for training and deploying models
https://docs.aws.amazon.com/sagemaker/latest/dg/docker-containers.html

๐Ÿ‘‰ How to find AWS SageMaker pre-built container registry paths
AWS > Documentation > Amazon SageMaker > ECR Paths
Docker Registry Paths and Example Code
Click on US East (N. Virginia)
Docker Registry Paths and Example Code for US East (N. Virginia) (us-east-1)
Click on Linear Learner (algorithm)

๐Ÿ‘‰ Get container registry path via SageMaker SDK example Python code

import boto3
from sagemaker import image_uris
image_uris.retrieve(framework='linear-learner', region=boto3.Session().region_name)
## output: 382416733822.dkr.ecr.us-east-1.amazonaws.com/linear-learner:1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment