

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# HyperPod クラスターにメトリクスエクスポーターパッケージをインストールする
<a name="sagemaker-hyperpod-cluster-observability-slurm-install-exporters"></a>

SageMaker HyperPod チームが提供する[基本設定ライフサイクルスクリプト](sagemaker-hyperpod-lifecycle-best-practices-slurm-slurm-base-config.md)には、さまざまなメトリクスエクスポーターパッケージのインストールも含まれています。インストールステップを有効にするには、[https://github.com/aws-samples/awsome-distributed-training/blob/main/1.architectures/5.sagemaker-hyperpod/LifecycleScripts/base-config/config.py](https://github.com/aws-samples/awsome-distributed-training/blob/main/1.architectures/5.sagemaker-hyperpod/LifecycleScripts/base-config/config.py) ファイルでパラメータ `enable_observability=True` を設定するだけでかまいません。ライフサイクルスクリプトは、以下のオープンソースメトリクスエクスポーターパッケージを使用してクラスターをブートストラップするよう設計されています。


|  |  |  | 
| --- |--- |--- |
| 名前 | スクリプトデプロイターゲットノード | エクスポーターの説明 | 
| [Prometheus 用の Slurm エクスポーター](https://github.com/vpenso/prometheus-slurm-exporter) | ヘッド (コントローラー) ノード |  Slurm アカウンティングメトリクスをエクスポートします。  | 
|  [Elastic Fabric Adapter (EFA) ノードエクスポーター](https://github.com/aws-samples/awsome-distributed-training/tree/main/4.validation_and_observability/3.efa-node-exporter)  |  コンピューティングノード  |  クラスターノードと EFA からメトリクスをエクスポートします。このパッケージは、[Prometheus ノードエクスポーター](https://github.com/prometheus/node_exporter)のフォークです。  | 
|  [NVIDIA Data Center GPU Management (DCGM) エクスポーター](https://github.com/NVIDIA/dcgm-exporter)  | コンピューティングノード |  NVIDIA GPU のヘルスおよびパフォーマンスに関する NVIDIA DCGM メトリックをエクスポートします。  | 

[https://github.com/aws-samples/awsome-distributed-training/blob/main/1.architectures/5.sagemaker-hyperpod/LifecycleScripts/base-config/config.py](https://github.com/aws-samples/awsome-distributed-training/blob/main/1.architectures/5.sagemaker-hyperpod/LifecycleScripts/base-config/config.py) ファイル内の `enable_observability=True` では、次のインストールステップが [https://github.com/aws-samples/awsome-distributed-training/blob/main/1.architectures/5.sagemaker-hyperpod/LifecycleScripts/base-config/lifecycle_script.py](https://github.com/aws-samples/awsome-distributed-training/blob/main/1.architectures/5.sagemaker-hyperpod/LifecycleScripts/base-config/lifecycle_script.py) スクリプトでアクティブ化されます。

```
# Install metric exporting software and Prometheus for observability
if Config.enable_observability:
    if node_type == SlurmNodeType.COMPUTE_NODE:
        ExecuteBashScript("./utils/install_docker.sh").run()
        ExecuteBashScript("./utils/install_dcgm_exporter.sh").run()
        ExecuteBashScript("./utils/install_efa_node_exporter.sh").run()

    if node_type == SlurmNodeType.HEAD_NODE:
        wait_for_scontrol()
        ExecuteBashScript("./utils/install_docker.sh").run()
        ExecuteBashScript("./utils/install_slurm_exporter.sh").run()
        ExecuteBashScript("./utils/install_prometheus.sh").run()
```

コンピューティングノードで、スクリプトは NVIDIA Data Center GPU Management (DCGM) エクスポーターと Elastic Fabric Adapter (EFA) ノードエクスポーターをインストールします。DCGM エクスポーターは Prometheus 用のエクスポーターであり、NVIDIA GPU、GPU の使用状況、パフォーマンス、ヘルスのモニタリングを可能にします。一方、EFA ノードエクスポーターは、HPC クラスターの低レイテンシーおよび高帯域幅通信に不可欠な、EFA ネットワークインターフェイスに関連するメトリクスを収集します。

ヘッドノードで、スクリプトは Prometheus 用の Slurm エクスポーターと [Prometheus オープンソースソフトウェア](https://prometheus.io/docs/introduction/overview/)をインストールします。Slurm エクスポーターは、Slurm ジョブ、パーティション、ノード状態に関連するメトリクスを Prometheus に提供します。

ライフサイクルスクリプトはすべてのエクスポーターパッケージを Docker コンテナとしてインストールするよう設計されているため、Docker パッケージはヘッドノードとコンピューティングノードの両方にもインストールする必要があります。これらのコンポーネントのスクリプトは、*Awsome Distributed Training GitHub リポジトリ*の [https://github.com/aws-samples/awsome-distributed-training/tree/main/1.architectures/5.sagemaker-hyperpod/LifecycleScripts/base-config/utils](https://github.com/aws-samples/awsome-distributed-training/tree/main/1.architectures/5.sagemaker-hyperpod/LifecycleScripts/base-config/utils) フォルダから簡単に入手できます。

エクスポーターパッケージでインストールされた HyperPod クラスターを正常に設定したら、次のトピックに進み、Amazon Managed Service for Prometheus と Amazon Managed Grafana の設定を完了します。