

# PERF02-BP06 최적화된 하드웨어 기반 컴퓨팅 액셀러레이터 사용
<a name="perf_compute_hardware_compute_accelerators"></a>

 하드웨어 액셀러레이터를 사용하면 CPU 기반 대안보다 특정 기능을 더 효율적으로 수행할 수 있습니다.

 **일반적인 안티 패턴**: 
+  워크로드에서 범용 인스턴스를 더 높은 성능과 더 낮은 비용을 제공할 수 있는 목적별 인스턴스와 비교하여 벤치마킹하지 않았습니다.
+  CPU 기반 대안을 사용하는 것이 더 효율적일 수 있는 작업에 하드웨어 기반 컴퓨팅 액셀러레이터를 사용합니다.
+  GPU 사용을 모니터링하지 않습니다.

**이 모범 사례 확립의 이점:** 그래픽 처리 디바이스(GPU) 및 Field Programmable Gate Array(FPGA)와 같은 하드웨어 기반 액셀러레이터를 사용하면 특정 프로세싱 기능을 보다 효율적으로 수행할 수 있습니다.

 **이 모범 사례가 확립되지 않을 경우 노출되는 위험 수준:** 중간 

## 구현 지침
<a name="implementation-guidance"></a>

 가속 컴퓨팅 인스턴스는 GPU 및 FPGA와 같은 하드웨어 기반 컴퓨팅 가속기에 대한 액세스를 제공합니다. 이러한 하드웨어 액셀러레이터는 CPU 기반 대안보다 더 효율적인 그래픽 처리 또는 데이터 패턴 일치와 같은 특정 기능을 수행합니다. 렌더링, 트랜스코딩, 기계 학습 등 많은 가속 워크로드는 리소스 사용 면에서 매우 가변적입니다. 이 하드웨어는 필요한 시간 동안만 실행하고 필요하지 않은 경우 자동화를 통해 해제하여 전반적인 성능 효율성을 향상합니다.

### 구현 단계
<a name="implementation-steps"></a>
+  요구 사항을 해결할 수 있는 [가속 컴퓨팅 인스턴스](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/accelerated-computing-instances.html)를 식별합니다.
+  기계 학습 워크로드의 경우 [AWS Trainium](https://aws.amazon.com/machine-learning/trainium/), [AWS Inferentia](https://aws.amazon.com/machine-learning/inferentia/) 및 [Amazon EC2 DL1](https://aws.amazon.com/ec2/instance-types/dl1/)과 같이 워크로드에 따라 특정한 목적별 하드웨어의 장점을 활용합니다. AWS Inf2 인스턴스와 같은 Inferentia 인스턴스는 [동급 Amazon EC2 인스턴스에 비해 최대 50% 더 우수한 와트당 성능을 제공](https://aws.amazon.com/machine-learning/inferentia/)합니다.
+  가속 컴퓨팅 인스턴스의 사용량 지표를 수집합니다. 예를 들어, [Amazon CloudWatch의 NVIDIA GPU 지표 수집](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Agent-NVIDIA-GPU.html)에서와 같이 CloudWatch 에이전트를 사용하여 GPU에 대한 `utilization_gpu` 및 `utilization_memory`와 같은 지표를 수집할 수 있습니다.
+  코드, 네트워크 운영 및 하드웨어 액셀러레이터 설정을 최적화하여 기본 하드웨어가 반드시 제대로 활용되도록 해야 합니다.
  +  [GPU 설정 최적화](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/optimize_gpu.html) 
  +  [GPU Monitoring and Optimization in the Deep Learning AMI](https://docs.aws.amazon.com/dlami/latest/devguide/tutorial-gpu.html) 
  +  [Optimizing I/O for GPU performance tuning of deep learning training in Amazon SageMaker AI](https://aws.amazon.com/blogs/machine-learning/optimizing-i-o-for-gpu-performance-tuning-of-deep-learning-training-in-amazon-sagemaker/) 
+  최신 고성능 라이브러리 및 GPU 드라이버를 사용합니다.
+  자동화를 사용하여 사용하지 않는 GPU 인스턴스 사용을 해제합니다.

## 리소스
<a name="resources"></a>

 **관련 문서**: 
+  [Amazon Elastic Container Service에서 GPU 작업](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-gpu.html) 
+  [GPU 인스턴스](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/accelerated-computing-instances.html#gpu-instances) 
+  [Instances with AWS Trainium](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/accelerated-computing-instances.html#aws-trainium-instances) 
+  [Instances with AWS Inferentia](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/accelerated-computing-instances.html#aws-inferentia-instances) 
+  [Let’s Architect\$1 Architecting with custom chips and accelerators](https://aws.amazon.com/blogs/architecture/lets-architect-custom-chips-and-accelerators/) 
+  [가속 컴퓨팅](https://aws.amazon.com/ec2/instance-types/#Accelerated_Computing) 
+  [Amazon EC2 VT1 Instances](https://aws.amazon.com/ec2/instance-types/vt1/) 
+  [워크로드에 적합한 EC2 인스턴스 유형을 선택하려면 어떻게 해야 하나요?](https://aws.amazon.com/premiumsupport/knowledge-center/ec2-instance-choose-type-for-workload/)
+  [Choose the best AI accelerator and model compilation for computer vision inference with Amazon SageMaker AI](https://aws.amazon.com/blogs/machine-learning/choose-the-best-ai-accelerator-and-model-compilation-for-computer-vision-inference-with-amazon-sagemaker/) 

 **관련 비디오:** 
+  AWS re:Invent 2021 - [How to select Amazon Elastic Compute Cloud GPU instances for deep learning](https://www.youtube.com/watch?v=4bVrIbgGWEA&ab_channel=AWSEvents) 
+  [AWS re:Invent 2022 - [NEW LAUNCH\$1] Introducing AWS Inferentia2-based Amazon EC2 Inf2 instances](https://www.youtube.com/watch?v=jpqiG02Y2H4&ab_channel=AWSEvents) 
+  [AWS re:Invent 2022 - Accelerate deep learning and innovate faster with AWS Trainium](https://www.youtube.com/watch?v=YRqvfNwqUIA&ab_channel=AWSEvents) 
+  [AWS re:Invent 2022 - Deep learning on AWS with NVIDIA: From training to deployment](https://www.youtube.com/watch?v=l8AFfaCkp0E&ab_channel=AWSEvents) 

 **관련 예제:** 
+  [Amazon SageMaker AI and NVIDIA GPU Cloud (NGC)](https://github.com/aws-samples/amazon-sagemaker-nvidia-ngc-examples) 
+  [Use SageMaker AI with Trainium and Inferentia for optimized deep learning training and inferencing workloads](https://github.com/aws-samples/sagemaker-trainium-inferentia) 
+  [Optimizing NLP models with Amazon Elastic Compute Cloud Inf1 instances in Amazon SageMaker AI](https://github.com/aws-samples/aws-inferentia-huggingface-workshop) 