[SEO Subhead]
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

-
Data Preparation
-
Model Training and Tuning
-
Model Deployment and Management
-
Data Preparation
-
This architecture diagram focuses on data preparation. For more details about other aspects of the ML lifecycle, open the other tabs.
Step 1
Choose Region based on both business requirements and sustainability goals. When regulations and legal aspects allow, use one of the AWS Regions where the electricity consumed is attributable to 100% renewable energy or Regions where the grid has a published carbon intensity that is lower than other locations (or Regions). When selecting a Region, aim to minimize data movement across networks—store your data close to your producers and train your models close to your data.
-
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.
Step 5
For distributed training of large deep learning models, use Amazon SageMaker Model Parallelism Library in your training code to maximize usage of graphics processing units (GPUs). -
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.
Step 14
Automate the deployment of your models. Use Amazon SageMaker Model Registry and AWS CodePipeline to run your deployment code.
Get Started

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.
-
Operational Excellence
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.
-
Security
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.
-
Reliability
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.
-
Performance Efficiency
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.
-
Cost Optimization
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.
-
Sustainability
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.
Related Content

Optimizing MLOps for Sustainability
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.