

 **協助改進此頁面** 

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

若要為本使用者指南貢獻內容，請點選每個頁面右側面板中的**在 GitHub 上編輯此頁面**連結。

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# Amazon EKS 上的人工智慧 (AI) 和機器學習 (ML) 概觀
<a name="machine-learning-on-eks"></a>

Amazon Elastic Kubernetes Service (EKS) 是受管 Kubernetes 平台，讓組織能夠部署、管理和擴展 AI 和機器學習 (ML) 工作負載，並擁有前所未有的彈性和控制。EKS 以開放原始碼 Kubernetes 生態系統為基礎，可讓您利用現有的 Kubernetes 專業知識，同時無縫整合開放原始碼工具和 AWS 服務。

無論您是訓練大規模模型、執行即時線上推論，還是部署生成式 AI 應用程式，EKS 都能滿足您的 AI/ML 專案所需的效能、可擴展性和成本效益。

## 為什麼選擇適用於 AI/ML 的 EKS？
<a name="_why_choose_eks_for_aiml"></a>

EKS 是受管 Kubernetes 平台，可協助您部署和管理複雜的 AI/ML 工作負載。以開放原始碼 Kubernetes 生態系統為基礎，與 AWS 服務整合，提供進階專案所需的控制和可擴展性。對於初次使用 AI/ML 部署的團隊，現有的 Kubernetes 技能會直接轉移，以便實現多個工作負載的高效協同運作。

EKS 支援從作業系統自訂到運算擴展的所有內容，且其開放原始碼基礎可提升技術彈性，為未來基礎結構決策保留選擇餘地。該平台提供 AI/ML 工作負載所需的效能和調校選項，並可支援下列功能：
+ 完整叢集控制，可微調成本和組態，而不會隱藏抽象概念
+ 生產中即時推論工作負載的次秒延遲
+ 進階自訂，例如多執行個體 GPU、多重雲端策略和作業系統層級調校
+ 能夠使用 EKS 作為跨 AI/ML 管道的統一協調器來集中工作負載

## 金鑰使用案例
<a name="_key_use_cases"></a>

Amazon EKS 為各種 AI/ML 工作負載提供了強大的平台，支援各種技術和部署模式：
+  **即時 (線上) 推論：**EKS 使用 Amazon EC2 [Inf1](https://aws.amazon.com/ec2/instance-types/inf1/) 和 [Inf2](https://aws.amazon.com/ec2/instance-types/inf2/) 執行個體上的 [TorchServe](https://docs.aws.amazon.com/dlami/latest/devguide/tutorial-torchserve.html)、[Triton Inference Server](https://aws.amazon.com/blogs/containers/quora-3x-faster-machine-learning-25-lower-costs-with-nvidia-triton-on-amazon-eks/) 和 [KServe](https://kserve.github.io/website/0.8/get_started/first_isvc/) 等工具，來支援對傳入資料的即時預測，例如詐騙偵測，且提供次秒延遲。這些工作負載受益於使用 [Karpenter](https://karpenter.sh/) 和 [KEDA](https://keda.sh/) 的動態擴展，同時利用 [Amazon EFS](https://aws.amazon.com/efs/) 進行跨 Pod 的模型碎片化。[Amazon ECR 提取快取 (PTC)](https://docs.aws.amazon.com/AmazonECR/latest/userguide/pull-through-cache-creating-rule.html) 可加速模型更新，而具有 [Amazon EBS](https://docs.aws.amazon.com/ebs/latest/userguide/what-is-ebs.html) 最佳化磁碟區的 [Bottlerocket](https://aws.amazon.com/bottlerocket/) 資料磁碟區可確保快速存取資料。
+  **一般模型訓練：**組織使用 [Amazon EC2 P4d 和 Amazon EC2 Trn1 執行個體上的](https://aws.amazon.com/ec2/instance-types/p4/) [Kubeflow Training Operator、Ray Serve 和 Torch Distributed Elastic](https://www.kubeflow.org/docs/components/trainer/)[https://pytorch.org/docs/stable/distributed.elastic.html](https://pytorch.org/docs/stable/distributed.elastic.html)，利用 EKS 在大型資料集上長期訓練複雜的模型。 [https://docs.ray.io/en/latest/serve/index.html](https://docs.ray.io/en/latest/serve/index.html) [Amazon EC2 Trn1](https://aws.amazon.com/ec2/instance-types/trn1/) [Volcano](https://volcano.sh/en/#home_slider)、[Yunikorn](https://yunikorn.apache.org/) 和 [Kueue](https://kueue.sigs.k8s.io/) 等工具的批次排程可支援這些工作負載。[Amazon EFS](https://aws.amazon.com/efs/) 可共用模型檢查點，而 [Amazon S3](https://aws.amazon.com/s3/) 會使用版本管理的生命週期政策來處理模型匯入/匯出。
+  **檢索增強生成 (RAG) 管道：**EKS 可透過整合檢索和產生程序來管理客戶支援聊天機器人和類似的應用程式。這些工作負載通常會使用 [Argo Workflows](https://argoproj.github.io/workflows/) 和 [Kubeflow](https://www.kubeflow.org/) 等工具進行協同運作，使用 [Pinecone](https://www.pinecone.io/blog/serverless/)、[Weaviate](https://weaviate.io/) 或 [Amazon OpenSearch](https://aws.amazon.com/opensearch-service/) 等向量資料庫，並透過 [Application Load Balancer 控制器 (LBC)](aws-load-balancer-controller.md) 向使用者公開應用程式。[NVIDIA NIM](https://docs.nvidia.com/nim/index.html) 可最佳化 GPU 使用率，而 [Prometheus](prometheus.md) 和 [Grafana](https://aws.amazon.com/grafana/) 則可監控資源用量。
+  **生成式 AI 模型部署：**公司可使用 Amazon [EC2 G5](https://aws.amazon.com/ec2/instance-types/g5/) 和 [Inferentia](https://aws.amazon.com/ai/machine-learning/inferentia/) 加速器上的 [Ray Serve](https://docs.ray.io/en/latest/serve/index.html)、[vLLM](https://github.com/vllm-project/vllm) 和 [Triton Inference Server](https://aws.amazon.com/blogs/containers/quora-3x-faster-machine-learning-25-lower-costs-with-nvidia-triton-on-amazon-eks/) 在 EKS 上部署即時內容建立服務，例如文字或影像產生。這些部署可最佳化大規模模型的效能和記憶體使用率。[JupyterHub](https://jupyter.org/hub) 支援迭代開發，[Gradio](https://www.gradio.app/) 提供簡單的 Web 介面，而 [S3 掛載點 CSI 驅動程式](s3-csi.md)則允許將 S3 儲存貯體掛載為檔案系統，以存取大型模型檔案。
+  **批次 (離線) 推論：**Organizations 可透過 [AWS Batch](https://docs.aws.amazon.com/batch/latest/userguide/what-is-batch.html) 或 [Volcano](https://volcano.sh/en/docs/schduler_introduction/) 的排程任務，高效處理大型資料集。這些工作負載通常會將 [Inf1](https://aws.amazon.com/ec2/instance-types/inf1/) 和 [Inf2](https://aws.amazon.com/ec2/instance-types/inf2/) EC2 執行個體用於 AWS [Inferentia](https://aws.amazon.com/ai/machine-learning/inferentia/) 晶片，將 Amazon EC2 [G4dn](https://aws.amazon.com/ec2/instance-types/g4/) 執行個體用於 NVIDIA T4 GPU，或使用 [c5](https://aws.amazon.com/ec2/instance-types/c5/) 和 [c6i](https://aws.amazon.com/ec2/instance-types/c6i) CPU 執行個體，從而最大化分析任務的離峰時間的資源使用率。[AWS Neuron SDK](https://aws.amazon.com/ai/machine-learning/neuron/) 和 NVIDIA GPU 驅動程式可最佳化效能，而 MIG/TS 則會啟用 GPU 共用。儲存解決方案包括 [Amazon S3](https://aws.amazon.com/s3/)、Amazon [EFS](https://aws.amazon.com/efs/) 和 [FSx for Lustre](https://aws.amazon.com/fsx/lustre/)，以及適用於各種儲存類別的 CSI 驅動程式。模型管理可利用 [Kubeflow 管道](https://www.kubeflow.org/docs/components/pipelines/)、[Argo Workflows](https://argoproj.github.io/workflows/) 和 [Ray 叢集](https://docs.ray.io/en/latest/cluster/getting-started.html)等工具，而監控則由 [Prometheus](prometheus.md)、[Grafana](https://aws.amazon.com/grafana/) 和自訂模型監控工具來處理。

## 案例研究
<a name="_case_studies"></a>

客戶因為各種原因而選擇 Amazon EKS，例如最佳化 GPU 用量，或以次秒延遲執行即時推論工作負載，如下列案例研究所示範。如需 Amazon EKS 的所有案例研究清單，請參閱 [AWS 客戶成功案例](https://aws.amazon.com/solutions/case-studies/browse-customer-success-stories/?refid=cr_card&customer-references-cards.sort-by=item.additionalFields.sortDate&customer-references-cards.sort-order=desc&awsf.customer-references-location=*all&awsf.customer-references-industry=*all&awsf.customer-references-use-case=*all&awsf.language=language%23english&awsf.customer-references-segment=*all&awsf.content-type=*all&awsf.customer-references-product=product%23eks&awsm.page-customer-references-cards=1)。
+  [Unitary](https://aws.amazon.com/solutions/case-studies/unitary-eks-case-study/?did=cr_card&trk=cr_card) 每天要處理 2,600 萬部影片，使用 AI 進行內容審核，需要高輸送量、低延遲推論，並將容器開機時間縮短了 80%，從而確保在流量波動時可快速回應擴展事件。
+  [Miro](https://aws.amazon.com/solutions/case-studies/miro-eks-case-study/) 是可支援全球 7,000 萬使用者的視覺化協作平台，且據報告，相較於其先前的自我管理 Kubernetes 叢集，運算成本降低了 80%。
+  [Synthesia](https://aws.amazon.com/solutions/case-studies/synthesia-case-study/?did=cr_card&trk=cr_card) 可提供生成式 AI 影片建立服務，讓客戶能夠從文字提示建立逼真的影片，進而在 ML 模型訓練輸送量方面實現 30 倍的改進。
+  [Harri](https://aws.amazon.com/solutions/case-studies/harri-eks-case-study/?did=cr_card&trk=cr_card) 為旅館業提供人力資源技術，透過移轉至 [AWS Graviton 處理器](https://aws.amazon.com/ec2/graviton/)，實現了 90% 的時間縮減，以回應需求激增，同時降低了 30% 的運算成本。
+  [Ada Support](https://aws.amazon.com/solutions/case-studies/ada-support-eks-case-study/) 是採用 AI 技術的客戶服務自動化公司，實現了 15% 的運算成本降低以及 30% 的運算效率提升。
+  [Snorkel AI](https://aws.amazon.com/blogs/startups/how-snorkel-ai-achieved-over-40-cost-savings-by-scaling-machine-learning-workloads-using-amazon-eks/) 讓企業能夠建置和調整基礎模型和大型語言模型，透過為其 GPU 資源實作智慧型擴展機制，實現了 40% 以上的成本節省。

## 開始使用 EKS 上的機器學習
<a name="_start_using_machine_learning_on_eks"></a>

若要在 AWS 雲端的 EKS 上開始規劃和使用Machine Learning平台和工作負載，請繼續 [開始使用 Amazon EKS 上的 AI/ML 的資源](ml-resources.md)一節。