跳至主要内容

适用于 MLOps 的 Amazon SageMaker

快速、大规模地提供高性能生产机器学习模型

为什么选择 Amazon SageMaker MLOps

Amazon SageMaker 提供专为机器学习操作(MLOps)构建的工具,以帮助您自动化和标准化机器学习生命周期内的流程。使用 SageMaker MLOps 工具,您可以轻松且大规模地对机器学习模型进行训练、测试、问题排查、部署和治理,从而提高数据科学家和机器学习工程师的生产力,同时保持生产中的模型性能。

工作原理

SageMaker MLOps 的优势

创建可重复的训练工作流以便加速模型开发
集中编目机器学习构件,用于模型可再现性和治理
将机器学习工作流程与 CI/CD 管道集成,以加速投入生产
持续监控生产中的数据和模型,以保持质量

加快模型开发

预置标准化数据科学环境

标准化机器学习开发环境可提高数据科学家的生产力,并降低启动新项目、轮换各项目数据科学家和实施机器学习最佳实践的难度,最终提高创新速度。Amazon SageMaker Projects 提供模板,使用历经考验且最新的工具和库、来源控制存储库、样板代码和 CI/CD 管道来快速预置数据科学家标准化环境。

Screenshot showing the Amazon SageMaker 'Create project' interface with MLOps project templates for model building, training, and deployment, alongside a code repository directory view for batch inference template management.

在机器学习实验期间使用 MLflow 进行协作

ML 模型构建是一个迭代过程,涉及训练数百个模型,旨在找到最佳算法、架构和参数,从而实现最佳模型精度。借助 MLflow,您能够追踪这些训练迭代中的输入和输出,提高试验的可重复性并促进数据科学家之间的协作。借助完全托管的 MLflow 功能,您可以为每个团队创建 MLflow 追踪服务器,从而促进 ML 实验期间的有效协作。

Amazon SageMaker 和 MLflow 管理端到端机器学习生命周期,简化高效的模型训练、追踪实验以及在不同框架和环境中的可重复性。该功能将提供一个界面,您可以在该界面中将进行中的训练作业视觉化、与同事分享试验以及直接从试验中注册模型。

Screenshot of the Amazon SageMaker Studio MLflow Tracking Server dashboard. The interface displays MLflow Tracking Servers management, server status, and options to open, edit, or delete an MLflow server. It also highlights features such as creating a tracking server, logging MLflow experiments, and registering MLflow models.

生成式人工智能模型自定义工作流自动化

借助 Amazon SageMaker Pipelines,您可以自动执行数据处理、模型训练、微调、评估和部署等端到端机器学习工作流。只需在 Pipelines 可视化编辑器中单击几下,即可通过 SageMaker Jumpstart 构建自己的模型或自定义基础模型。您可以将 SageMaker Pipelines 配置为定期或在某些事件触发时自动运行(例如 S3 中有新训练数据时)

A workflow diagram visualizing an automated fine-tuning process in Amazon SageMaker Pipelines. The flow shows steps including preparing a fine-tuning dataset, fine-tuning a Llama 3.1 model, evaluating large language model (LLM) performance, conditional logic for deployment, and registering or deploying the model for inference.

在生产环境中轻松部署和管理模型

快速重现模型以进行问题排查

在生产中,您经常需要重现模型,以对其行为进行问题排查并确定问题根源。为推动这一流程的进行,Amazon SageMaker 会记录您工作流的每个步骤,创建对模型构件(例如训练数据、配置设置、模型参数和学习梯度)的审计跟踪。您可以使用沿袭跟踪功能来重建模型,以便调试潜在问题。

Diagram showing the architecture for Amazon SageMaker lineage tracking across AWS accounts, with pipelines, models, data processing steps, and cross-account data lineage visualization.

集中跟踪和管理模型版本

机器学习应用的构建包括开发模型、数据管道、训练管道和验证测试。使用 Amazon SageMaker Model Registry,您可以在一个中央存储库中跟踪模型版本、其元数据(如使用案例分组),以及模型性能指标基准,在这个中央存储库中很容易根据您的业务需求选择适当的部署模型。此外,SageMaker Model Registry 会自动记录审核和合规的批准工作流程。

观看演示

Screenshot of the Amazon SageMaker Model Registry interface showing a side-by-side comparison of model version metrics, including confusion matrix, receiver operating characteristic (ROC) curve, PRC, and statistical values for recall, precision, and accuracy.

通过代码定义机器学习基础设施

通过声明式配置文件进行编排,一般被称为“基础设施即代码”,是完全按照 CI/CD 管道或部署工具预置机器学习基础设施和实施解决方案架构的一种常用方法。通过 Amazon SageMaker Projects,您可以使用预构建的模板文件来编写基础设施即代码。

Diagram illustrating the Amazon SageMaker CI/CD machine learning pipeline, showing automated model build and re-training workflows, model registry for configuration and metadata management, and model deployment approval workflows.

自动化集成和部署(CI/CD)工作流

机器学习开发工作流程应与集成与部署工作流程集成,以快速为生产应用提供新模型。Amazon SageMaker Projects 将 CI/CD 实践带入机器学习,例如保持开发和生产环境之间的一致性、源代码和版本控制、A/B 测试以及端到端自动化。因此,您能够在模型获批后立即投入生产,并提高敏捷性。

此外,Amazon SageMaker 提供内置保护,帮助您维护端点可用性并将部署风险降到最低。SageMaker 负责设置与编排蓝绿部署等部署最佳实践,以最大程度地提升可用性,并将这些最佳实践与自动回滚机制等端点更新机制集成,从而帮助您提早自动识别问题并在其对生产造成显著影响之前采取纠正措施。

Diagram illustrating the Amazon SageMaker CI/CD machine learning pipeline, showing automated model build and re-training workflows, model registry for configuration and metadata management, and model deployment approval workflows.

持续再训练模型,以保持预测质量

模型投入生产后,您需要配置警报来监控性能,以便待命的数据科学家能够对问题进行排查并触发再训练。Amazon SageMaker Model Monitor 通过实时检测模型漂移和概念漂移,并向您发送警报,以便您可以立即采取措施,从而帮助您维护质量。SageMaker Model Monitor 持续监控模型的性能特征,例如用于衡量与总预测数相比的正确预测数的准确性,以便您可以解决异常情况。SageMaker Model Monitor 与 SageMaker Clarify 集成,从而更清晰地了解潜在偏差。

Screenshot of the Amazon SageMaker Data Quality Monitoring interface, showing a line chart that tracks the 'State_AR: Sum' metric over time to identify data drift and data quality issues for a machine learning model endpoint in production.

优化模型部署,以便提高性能和降低成本

Amazon SageMaker 使您能够轻松部署机器学习模型,以便以高性能和低成本为任何用例提供推理。Amazon SageMaker 提供了多种机器学习基础设施和模型部署选项,以便满足您的所有机器学习推理需求。

A visual comparison of Amazon SageMaker model hosting instance types, illustrating CPU (C5), GPU (P3, G4), and custom chip (Inf1) options, along with their throughput, performance, cost, and flexibility characteristics.

新增内容

从 Amazon SageMaker Pipelines 启动 Amazon SageMaker Autopilot 实验,轻松实现 MLOps 工作流的自动化

11/30/2022

阅读案例

Amazon SageMaker Pipelines 现在支持在本地环境测试机器学习工作流

08/17/2022

阅读案例

Amazon SageMaker Pipelines 现在支持跨账户共享管道实体

08/09/2022

阅读案例

MLOps 工作负载编排器增加对 Amazon SageMaker 模型可解释性和模型偏向性监控的支持

02/02/2022

阅读案例

Amazon SageMaker Pipelines 现在支持并发控制

01/21/2022

阅读案例