> ## Documentation Index
> Fetch the complete documentation index at: https://wb-21fd5541-docs-2751.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()`를 호출하면 그 내용을 환경 변수로 로드합니다. `secrets.env` 파일을 생성하려면 실험을 시작하는 데 사용하는 스크립트에서 `wandb.sagemaker_auth(path="source_dir")`를 호출하세요. 이 파일을 `.gitignore`에 추가하세요.

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

SageMaker의 미리 구성된 estimator 중 하나를 사용 중이라면 `wandb`가 포함된 `requirements.txt` 파일을 소스 디렉터리에 추가하세요:

```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의 SageMaker 예시](https://github.com/wandb/examples/tree/master/examples/pytorch/pytorch-cifar10-sagemaker)를 참조하세요. SageMaker에서 스윕을 실행하는 방법에 대한 자세한 내용은 [SageMaker 스윕 관련 W\&B 블로그 게시물](https://wandb.ai/site/articles/running-sweeps-with-sagemaker)을 참조하세요.

SageMaker와 W\&B를 사용해 감정 분석기를 배포하는 튜토리얼은 [Deploy Sentiment Analyzer Using SageMaker and W\&B](https://wandb.ai/authors/sagemaker/reports/Deploy-Sentiment-Analyzer-Using-SageMaker-and-W-B--VmlldzoxODA1ODE)를 참조하세요.

<Warning>
  W\&B sweep agent는 SageMaker 인테그레이션이 비활성화되어 있을 때만 SageMaker 작업 내에서 올바르게 작동합니다. SageMaker 인테그레이션을 끄려면 `wandb.init()` 호출을 다음과 같이 수정하세요.

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