This Guidance provides best practices to help you optimize machine learning (ML) operations (MLOps) for environmental sustainability. While customers across industries are committed to reducing their carbon footprints, ML workloads are becoming increasingly complex and consuming more energy and resources. This Guidance helps you review and refine your workloads to maximize utilization and minimize waste and the total resources deployed and powered to support your workload at all aspects of the ML lifecycle, including data collection, data storage, feature engineering, training, inference, and deployment.

Please note: [Disclaimer]

Architecture Diagram

Download the architecture diagram PDF 
  • Data Preparation
  • This architecture diagram focuses on data preparation. For more details about other aspects of the ML lifecycle, open the other tabs.

  • Model Training and Tuning
  • This architecture diagram focuses on model training and tuning. For more details about other aspects of the ML lifecycle, open the other tabs.

  • Model Deployment and Management
  • This architecture diagram focuses on model deployment and management. For more details about other aspects of the ML lifecycle, open the other tabs.

Well-Architected Pillars

The AWS Well-Architected Framework helps you understand the pros and cons of the decisions you make when building systems in the cloud. The six pillars of the Framework allow you to learn architectural best practices for designing and operating reliable, secure, efficient, cost-effective, and sustainable systems. Using the AWS Well-Architected Tool, available at no charge in the AWS Management Console, you can review your workloads against these best practices by answering a set of questions for each pillar.

The architecture diagram above is an example of a Solution created with Well-Architected best practices in mind. To be fully Well-Architected, you should follow as many Well-Architected best practices as possible.

  • CloudWatch metrics and alarms monitor the health of model endpoints deployed on SageMaker hosting options, allowing you to record performance-related metrics, analyze metrics when events or incidents occur, establish KPIs to measure workload performance, and monitor and alarm proactively. Additionally, collecting and analyzing metrics for training jobs and inference environments using CloudWatch allows you to analyze workload health trends and conduct periodic workload metric reviews with your organization.

    Read the Operational Excellence whitepaper 
  • AWS Identity and Access Management (IAM) controls access to resources and managed services to help ensure least privilege access, secure the ML environment, and protect against adversarial and malicious activities. Data is encrypted at rest on Amazon Simple Storage Service (Amazon S3) and SageMaker Feature Store, both of which use AWS Key Management Service (AWS KMS) to protect sensitive data.

    Read the Security whitepaper 
  • SageMaker allows automatic scaling of the model endpoint for reliable processing of predictions and to meet changing workload demands. It also distributes instances across Availability Zones in case an outage occurs or an instance fails. SageMaker Pipelines allows for versioned pipeline inputs and artifacts, and SageMaker Projects allows for versioned data processing code. This versioning helps you create a repeatable approach and retain data in case you need to roll back to a previous state.

    Read the Reliability whitepaper 
  • We selected the services in this Guidance to improve performance without compromising on accuracy of training results. For example, managed ML services, such as SageMaker, deliver better performance through pre-optimized ML components. SageMaker Inference Recommender increases performance while reducing inference time. High-compute instances, such as Trainium and Inferentia, can accelerate inference speed.

    Read the Performance Efficiency whitepaper 
  • SageMaker services have built-in features that help you optimize costs related to model training. For example, SageMaker Feature Store helps avoid the cost of storing and processing duplicated datasets. SageMaker Debugger allows you to stop a training job as soon as a bug is detected, saving costs associated with unnecessary training job executions. SageMaker Training Compiler reduces training time and costs on GPU instances. Serverless pipelines, SageMaker Asynchronous Endpoints, and SageMaker Batch Transform avoid the cost of maintaining compute infrastructure at all hours of the day.

    Read the Cost Optimization whitepaper 
  • SageMaker Serverless Inference Endpoints and SageMaker Asynchronous Endpoints use autoscaling groups to scale resources in response to demand. SageMaker Serverless Inference Endpoints scale endpoints down to zero when there are no requests. This minimizes unnecessary provisioned resources and reduces carbon emissions. Additionally, serverless technologies, such as SageMaker Serverless Inference Endpoints and SageMaker Pipeline help eliminate idle resources by not having to spin up servers.

    Read the Sustainability whitepaper 
Blog

Optimizing MLOps for Sustainability

This blog post demonstrates how to optimize MLOps for sustainability on AWS, focusing on efficient practices in data preparation, model training, and deployment.

Disclaimer

The sample code; software libraries; command line tools; proofs of concept; templates; or other related technology (including any of the foregoing that are provided by our personnel) is provided to you as AWS Content under the AWS Customer Agreement, or the relevant written agreement between you and AWS (whichever applies). You should not use this AWS Content in your production accounts, or on production or other critical data. You are responsible for testing, securing, and optimizing the AWS Content, such as sample code, as appropriate for production grade use based on your specific quality control practices and standards. Deploying AWS Content may incur AWS charges for creating or using AWS chargeable resources, such as running Amazon EC2 instances or using Amazon S3 storage.

References to third-party services or organizations in this Guidance do not imply an endorsement, sponsorship, or affiliation between Amazon or AWS and the third party. Guidance from AWS is a technical starting point, and you can customize your integration with third-party services when you deploy the architecture.

Was this page helpful?