AI Practices AI实践 4h ago Updated 1h ago 更新于 1小时前 46

Spreading the load: How Salesforce met Multi-AZ HA with SageMaker Inference Components 负载均衡:Salesforce如何利用SageMaker推理组件实现多可用区高可用

Salesforce achieved an 8x reduction in GPU infrastructure costs by co-hosting multiple models on shared GPUs using SageMaker Inference Components (ICs) Default IC placement optimized for cost alone did not guarantee Multi-AZ resilience, creating single points of failure at both instance and AZ levels The new `SchedulingConfig` parameter in the `CreateInferenceComponent` API provides fine-grained control over IC copy placement across instances and AZs Two key sub-parameters drive HA behavior: `Av Salesforce利用Amazon SageMaker Inference Components的SchedulingConfig功能,解决了多AZ高可用部署中的单点故障问题 通过SPREAD放置策略和AvailabilityZoneBalance参数,实现了跨可用区的模型副本均衡分布 该方案在保持8倍GPU成本优化的同时,满足了Salesforce生产模型必须支持2-AZ的合规要求 结合CONSOLIDATION缩容策略,可在动态扩缩容过程中持续维护AZ平衡

62
Hot 热度
72
Quality 质量
65
Impact 影响力

Analysis 深度分析

TL;DR

  • Salesforce achieved an 8x reduction in GPU infrastructure costs by co-hosting multiple models on shared GPUs using SageMaker Inference Components (ICs)
  • Default IC placement optimized for cost alone did not guarantee Multi-AZ resilience, creating single points of failure at both instance and AZ levels
  • The new SchedulingConfig parameter in the CreateInferenceComponent API provides fine-grained control over IC copy placement across instances and AZs
  • Two key sub-parameters drive HA behavior: AvailabilityZoneBalance (cross-AZ distribution with configurable imbalance tolerance) and PlacementStrategy (SPREAD for fault isolation vs. BINPACK for utilization efficiency)
  • For ongoing rebalancing after repeated scale operations, configuring the endpoint's ScaleInPolicy with the CONSOLIDATION strategy enables a background sweeper to periodically consolidate IC copies while honoring AZ balance constraints

Why It Matters

This case study demonstrates a critical gap between cost-optimized ML infrastructure and enterprise compliance requirements for high availability. For AI practitioners running production inference workloads, it highlights that default cloud platform behaviors may not satisfy Multi-AZ resilience mandates, requiring explicit configuration to meet internal compliance bars. The solution pattern is broadly applicable to any organization using SageMaker ICs for cost-efficient multi-model GPU sharing who also need production-grade HA guarantees.

Technical Details

  • SchedulingConfig parameter: Introduced in the CreateInferenceComponent API, enabling fine-grained control over IC copy placement across instances and Availability Zones
  • AvailabilityZoneBalance: Controls cross-AZ distribution with EnforcementMode (e.g., PERMISSIVE) and MaxImbalance settings; MaxImbalance: 0 enforces strict balance (exactly 1 copy per AZ for 2-copy deployments), while MaxImbalance: 1 tolerates at most a 1-copy difference between AZs
  • PlacementStrategy: SPREAD distributes copies across as many instances as possible for fault isolation; BINPACK packs copies onto fewer instances for utilization efficiency
  • Scaling behavior: SageMaker maintains AZ balance during scale-out (placing new copies evenly) and scale-in (symmetrically removing copies across AZs); CopyCount must never be set to 1 for HA-critical models as a single copy resides in only one AZ
  • CONSOLIDATION ScaleInPolicy: Configured at the endpoint level via ManagedInstanceScaling, a background sweeper periodically consolidates IC copies and releases idle instances while honoring AZ balance constraints, addressing drift from repeated scale operations

Industry Insight

  • Cloud ML platforms are increasingly offering cost-optimization features (like multi-model GPU co-hosting) that outpace their HA and compliance guarantees; practitioners should audit default placement behaviors against their resilience requirements before production deployment
  • The pattern of combining per-operation placement controls (SchedulingConfig) with background rebalancing (CONSOLIDATION strategy) provides a reusable blueprint for maintaining Multi-AZ compliance in dynamically scaled inference workloads
  • Organizations with strict compliance mandates (like Salesforce's 2-AZ requirement) should treat CopyCount: 1 as a hard anti-pattern for production models and implement automated guardrails to prevent accidental single-AZ deployments

TL;DR

  • Salesforce利用Amazon SageMaker Inference Components的SchedulingConfig功能,解决了多AZ高可用部署中的单点故障问题
  • 通过SPREAD放置策略和AvailabilityZoneBalance参数,实现了跨可用区的模型副本均衡分布
  • 该方案在保持8倍GPU成本优化的同时,满足了Salesforce生产模型必须支持2-AZ的合规要求
  • 结合CONSOLIDATION缩容策略,可在动态扩缩容过程中持续维护AZ平衡

为什么值得看

本文展示了企业级AI服务如何在成本优化与高可用之间取得平衡,为使用SageMaker部署LLM的开发者提供了可复用的多AZ HA架构模式。

技术解析

  • 核心问题:SageMaker默认IC部署算法独立优化每次部署操作,不考虑AZ均衡,导致模型副本可能集中在单AZ,存在实例级和AZ级故障风险
  • 解决方案:通过CreateInferenceComponent API的SchedulingConfig参数,配置PlacementStrategy(SPREAD/BINPACK)和AvailabilityZoneBalance(EnforcementMode+MaxImbalance)实现精细化的跨AZ放置控制
  • 关键配置:SPREAD策略将副本分散到尽可能多的实例上以实现故障隔离;MaxImbalance=1允许最多1个副本的AZ差异,MaxImbalance=0强制严格均衡
  • 动态扩展:扩缩容时SageMaker自动维护AZ平衡;长期运行需配合ScaleInPolicy的CONSOLIDATION策略,通过后台sweeper定期合并副本并释放空闲实例

行业启示

  • 企业级AI部署必须将合规性(如多AZ容灾)纳入架构设计,不能仅关注成本优化
  • 云服务商提供的细粒度调度控制能力(如SchedulingConfig)正在成为平衡成本与可靠性的关键工具
  • 建议在生产环境部署LLM时,始终保证CopyCount≥2且配置跨AZ均衡策略,避免单点故障风险

Disclaimer: The above content is generated by AI and is for reference only. 免责声明:以上内容由 AI 生成,仅供参考。

Agent Agent Inference 推理 Deployment 部署 GPU GPU LLM 大模型