> ## Documentation Index
> Fetch the complete documentation index at: https://wb-21fd5541-dependabot-github-actions-actions-cache-6.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> AWS 인프라에서 실험 추적, 메트릭 로깅, 모델 관리를 위해 W&B를 Amazon SageMaker와 통합하세요.

# SageMaker

W\&B는 [Amazon SageMaker](https://aws.amazon.com/sagemaker/)와 통합되어 하이퍼파라미터를 자동으로 가져오고, 분산된 run을 그룹화하며, 체크포인트에서 run을 재개합니다.

<div id="authentication">
  ## 인증
</div>

W\&B는 트레이닝 스크립트를 기준으로 한 상대 경로에서 `secrets.env` 파일을 찾고, `wandb.init()`가 호출되면 그 내용을 환경 변수로 로드합니다. 실험을 시작하는 데 사용하는 스크립트에서 `wandb.sagemaker_auth(path="source_dir")`를 호출해 `secrets.env` 파일을 생성할 수 있습니다. 이 파일은 `.gitignore`에 꼭 추가하세요!

<div id="existing-estimators">
  ## 기존 estimator
</div>

SageMaker의 사전 구성 estimator 중 하나를 사용 중이라면, wandb가 포함된 `requirements.txt`를 source 디렉터리에 추가해야 합니다.

```text theme={null}
wandb
```

Python 2에서 실행되는 estimator를 사용 중이라면, wandb를 설치하기 전에 이 [wheel](https://pythonwheels.com)에서 `psutil`을 직접 설치해야 합니다:

```text theme={null}
https://wheels.galaxyproject.org/packages/psutil-5.4.8-cp27-cp27mu-manylinux1_x86_64.whl
wandb
```

[GitHub](https://github.com/wandb/examples/tree/master/examples/pytorch/pytorch-cifar10-sagemaker)에서 전체 예제를 확인하고, [블로그](https://wandb.ai/site/articles/running-sweeps-with-sagemaker)에서 자세한 내용을 읽어보세요.

SageMaker와 W\&B를 사용해 감성 분석기를 배포하는 방법은 [Deploy Sentiment Analyzer Using SageMaker and W\&B tutorial](https://wandb.ai/authors/sagemaker/reports/Deploy-Sentiment-Analyzer-Using-SageMaker-and-W-B--VmlldzoxODA1ODE)에서도 확인할 수 있습니다.

<Warning>
  SageMaker 인테그레이션이 꺼져 있을 때만 W\&B sweep agent가 SageMaker 작업에서 예상대로 동작합니다. `wandb.init()` 호출을 수정해 SageMaker 인테그레이션을 끄세요.

  ```python theme={null}
  wandb.init(..., settings=wandb.Settings(sagemaker_disable=True))
  ```
</Warning>
