

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

# Amazon SageMaker HyperPod タスクのガバナンス
<a name="sagemaker-hyperpod-eks-operate-console-ui-governance"></a>

SageMaker HyperPod タスクガバナンスはリソースの割り当てを合理化し、Amazon EKS クラスターのチームやプロジェクト全体でコンピューティングリソースを効率的に活用できるように設計されています。これにより、管理者は次の設定を行うことができます。
+ さまざまなタスクの優先度
+ 各チームのコンピューティング割り当て
+ 各チームがアイドル状態のコンピューティングリソースを貸し借りする方法
+ チームが自らのタスクを先取りした場合

HyperPod タスクガバナンスは Amazon EKS クラスターオブザーバビリティも提供し、クラスター容量をリアルタイムで可視化します。これにはコンピューティングの可用性と使用状況、チームの割り当てと使用状況、タスクの実行と待機時間に関する情報が含まれ、情報に基づいた意思決定とプロアクティブなリソース管理のための設定を行います。

次のセクションでは、Amazon EKS クラスターの HyperPod タスクガバナンスの設定、主要な概念、使用方法について説明します。

**Topics**
+ [

# SageMaker HyperPod タスクガバナンスのセットアップ
](sagemaker-hyperpod-eks-operate-console-ui-governance-setup.md)
+ [

# ダッシュボード
](sagemaker-hyperpod-eks-operate-console-ui-governance-metrics.md)
+ [

# タスク
](sagemaker-hyperpod-eks-operate-console-ui-governance-tasks.md)
+ [

# ポリシー
](sagemaker-hyperpod-eks-operate-console-ui-governance-policies.md)
+ [

# HyperPod タスクガバナンス AWS CLI コマンドの例
](sagemaker-hyperpod-eks-operate-console-ui-governance-cli.md)
+ [

# トラブルシューティング
](sagemaker-hyperpod-eks-operate-console-ui-governance-troubleshoot.md)
+ [

# Amazon SageMaker HyperPod タスクガバナンスの属性ドキュメント
](sagemaker-hyperpod-eks-operate-console-ui-governance-attributions.md)

# SageMaker HyperPod タスクガバナンスのセットアップ
<a name="sagemaker-hyperpod-eks-operate-console-ui-governance-setup"></a>

次のセクションでは、Amazon CloudWatch Observability EKS と SageMaker HyperPod のタスクガバナンスアドオンの設定方法について説明します。

[クラスター管理者の IAM ユーザー](sagemaker-hyperpod-prerequisites-iam.md#sagemaker-hyperpod-prerequisites-iam-cluster-admin)に、Amazon EKS を使用した HyperPod クラスター管理者向けの最小権限ポリシーが設定されていることを確認します。これには、SageMaker HyperPod コア APIs を実行し、 内の SageMaker HyperPod クラスターを管理し AWS アカウント、 でタスクを実行するアクセス許可が含まれます[Amazon EKS によってオーケストレーションされた SageMaker HyperPod クラスターを管理する](sagemaker-hyperpod-eks-operate.md)。

**Topics**
+ [

# ダッシュボードの設定
](sagemaker-hyperpod-eks-operate-console-ui-governance-setup-dashboard.md)
+ [

# タスクガバナンスの設定
](sagemaker-hyperpod-eks-operate-console-ui-governance-setup-task-governance.md)

# ダッシュボードの設定
<a name="sagemaker-hyperpod-eks-operate-console-ui-governance-setup-dashboard"></a>

Amazon SageMaker HyperPod Amazon CloudWatch オブザーバビリティ EKS アドオンを設定するには、以下の情報を使用します。これにより、EKS クラスターのハードウェア、チームの割り当て、タスクのメトリクスを表示する詳細なビジュアルダッシュボードを設定できます。

設定で問題が発生した場合は、「[トラブルシューティング](sagemaker-hyperpod-eks-operate-console-ui-governance-troubleshoot.md)」で既知の解決策を参照してください。

**Topics**
+ [

## HyperPod Amazon CloudWatch オブザーバビリティ EKS アドオンの前提条件
](#hp-eks-dashboard-prerequisites)
+ [

## HyperPod Amazon CloudWatch オブザーバビリティ EKS アドオンの設定
](#hp-eks-dashboard-setup)

## HyperPod Amazon CloudWatch オブザーバビリティ EKS アドオンの前提条件
<a name="hp-eks-dashboard-prerequisites"></a>

次のセクションでは、Amazon EKS オブザーバビリティアドオンをインストールする前に必要な前提条件について説明します。
+ [クラスター管理者の IAM ユーザー](sagemaker-hyperpod-prerequisites-iam.md#sagemaker-hyperpod-prerequisites-iam-cluster-admin)に、HyperPod クラスター管理者向けの最小権限ポリシーが設定されていることを確認します。
+ `CloudWatchAgentServerPolicy` IAM ポリシーをワーカーノードにアタッチします。これを行うには、次のコマンドを入力します。`my-worker-node-role` は、Kubernetes ワーカーノードで使用する IAM ロールに置き換えます。

  ```
  aws iam attach-role-policy \
  --role-name my-worker-node-role \
  --policy-arn arn:aws:iam::aws:policy/CloudWatchAgentServerPolicy
  ```

## HyperPod Amazon CloudWatch オブザーバビリティ EKS アドオンの設定
<a name="hp-eks-dashboard-setup"></a>

Amazon SageMaker HyperPod Amazon CloudWatch オブザーバビリティ EKS アドオンを設定するには、以下のオプションを使用します。

------
#### [ Setup using the SageMaker AI console ]

HyperPod タスクガバナンスダッシュボードを設定して可視化するには、次のアクセス許可が必要です。このセクションでは、「[クラスター管理者の IAM ユーザー](sagemaker-hyperpod-prerequisites-iam.md#sagemaker-hyperpod-prerequisites-iam-cluster-admin)」に記載されているアクセス許可について詳しく説明します。

タスクガバナンスを管理するには、以下のサンプルポリシーを使用します。

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "sagemaker:ListClusters",
                "sagemaker:DescribeCluster",
                "sagemaker:ListComputeQuotas",
                "sagemaker:CreateComputeQuota",
                "sagemaker:UpdateComputeQuota",
                "sagemaker:DescribeComputeQuota",
                "sagemaker:DeleteComputeQuota",
                "sagemaker:ListClusterSchedulerConfigs",
                "sagemaker:DescribeClusterSchedulerConfig",
                "sagemaker:CreateClusterSchedulerConfig",
                "sagemaker:UpdateClusterSchedulerConfig",
                "sagemaker:DeleteClusterSchedulerConfig",
                "eks:ListAddons",
                "eks:CreateAddon",
                "eks:DescribeAddon",
                "eks:DescribeCluster",
                "eks:DescribeAccessEntry",
                "eks:ListAssociatedAccessPolicies",
                "eks:AssociateAccessPolicy",
                "eks:DisassociateAccessPolicy"
            ],
            "Resource": "*"
        }
    ]
}
```

------

Amazon CloudWatch オブザーバビリティ Amazon EKS を管理し、SageMaker AI コンソールから HyperPod クラスターダッシュボードを表示するアクセス許可を付与するには、以下のサンプルポリシーを使用します。

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "eks:ListAddons",
                "eks:CreateAddon",
                "eks:UpdateAddon",
                "eks:DescribeAddon",
                "eks:DescribeAddonVersions",
                "sagemaker:DescribeCluster",
                "sagemaker:DescribeClusterNode",
                "sagemaker:ListClusterNodes",
                "sagemaker:ListClusters",
                "sagemaker:ListComputeQuotas",
                "sagemaker:DescribeComputeQuota",
                "sagemaker:ListClusterSchedulerConfigs",
                "sagemaker:DescribeClusterSchedulerConfig",
                "eks:DescribeCluster",
                "cloudwatch:GetMetricData",
                "eks:AccessKubernetesApi"
            ],
            "Resource": "*"
        }
    ]
}
```

------

SageMaker HyperPod コンソールの **[ダッシュボード]** タブに移動して、Amazon CloudWatch オブザーバビリティ EKS をインストールします。タスクガバナンス関連のメトリクスが **[ダッシュボード]** に含まれていることを確認するには、Kueue メトリクスチェックボックスを有効にします。Kueue メトリクスを有効にすると、無料利用枠の制限に達した後、CloudWatch **メトリクス** のコストが有効になります。詳細については、「[Amazon CloudWatch 料金表](https://aws.amazon.com/cloudwatch/pricing/)」の「**メトリクス**」を参照してください。

------
#### [ Setup using the EKS AWS CLI ]

次の EKS AWS CLI コマンドを使用してアドオンをインストールします。

```
aws eks create-addon --cluster-name cluster-name 
--addon-name amazon-cloudwatch-observability 
--configuration-values "configuration json"
```

以下は、設定値の JSON の例です。

```
{
    "agent": {
        "config": {
            "logs": {
                "metrics_collected": {
                    "kubernetes": {
                        "kueue_container_insights": true,
                        "enhanced_container_insights": true
                    },
                    "application_signals": { }
                }
            },
            "traces": {
                "traces_collected": {
                    "application_signals": { }
                }
            }
        },
    },
}
```

------
#### [ Setup using the EKS Console UI ]

1. [[EKS コンソール]](https://console.aws.amazon.com/eks/home#/clusters) に移動します。

1. クラスターを選択します。

1. **[アドオン]** を選択します。

1. **[Amazon CloudWatch オブザーバビリティ]** アドオンを探して、インストールします。アドオンは、2.4.0 以降のバージョンをインストールします。

1. 次の JSON 設定値を含めます。

   ```
   {
       "agent": {
           "config": {
               "logs": {
                   "metrics_collected": {
                       "kubernetes": {
                           "kueue_container_insights": true,
                           "enhanced_container_insights": true
                       },
                       "application_signals": { }
                   },
               },
               "traces": {
                   "traces_collected": {
                       "application_signals": { }
                   }
               }
           },
       },
   }
   ```

------

EKS オブザーバビリティアドオンのインストールが正常に完了したら、HyperPod コンソールの **[ダッシュボード]** タブで EKS クラスターのメトリクスを表示できます。

# タスクガバナンスの設定
<a name="sagemaker-hyperpod-eks-operate-console-ui-governance-setup-task-governance"></a>

このセクションでは、Amazon SageMaker HyperPod タスクガバナンス EKS アドオンの設定方法について説明します。これには、タスクの優先順位付け、チームへのコンピューティング割り当て、アイドル状態のコンピューティングの共有方法、チームへのタスクのプリエンプションを設定するためのアクセスの付与も含まれます。

設定で問題が発生した場合は、「[トラブルシューティング](sagemaker-hyperpod-eks-operate-console-ui-governance-troubleshoot.md)」で既知の解決策を参照してください。

**Topics**
+ [

## キューの設定
](#hp-eks-task-governance-kueue-settings)
+ [

## HyperPod タスクガバナンスの前提条件
](#hp-eks-task-governance-prerequisites)
+ [

## HyperPod タスクガバナンスの設定
](#hp-eks-task-governance-setup)

## キューの設定
<a name="hp-eks-task-governance-kueue-settings"></a>

HyperPod タスクガバナンス EKS アドオンは、HyperPod EKS クラスターに [Kueue](https://github.com/kubernetes-sigs/kueue/tree/main/apis/kueue) をインストールします。Kueue は、クォータとジョブがクォータをどのように消費するかを管理する kubernetes ネイティブのシステムです。


| EKS HyperPod タスクガバナンスのアドオンバージョン | アドオンの一部としてインストールされる Kueue のバージョン | 
| --- | --- | 
|  v1.1.3  |  v0.12.0  | 

**注記**  
Kueue v.012.0 以降には、インストールの一部として kueue-rbac-proxy は含まれません。以前のバージョンでは、kueue-rbac-proxy がインストールされている場合があります。例えば、Kueue v0.8.1 を使用している場合、kueue-rbac-proxy v0.18.1 を使用できます。

HyperPod タスクガバナンスは、Kubernetes ネイティブのジョブキューイング、スケジューリング、クォータ管理に Kueue を活用しており、HyperPod タスクガバナンス EKS アドオンとともにインストールされます。インストールすると、HyperPod は `KueueManagerConfig`、`ClusterQueues`、`LocalQueues`、`WorkloadPriorityClasses`、`ResourceFlavors`、`ValidatingAdmissionPolicies` などの SageMaker AI マネージド Kubernetes リソースを作成して変更します。Kubernetes 管理者はこれらのリソースの状態を柔軟に変更できますが、SageMaker AI マネージドリソースに加えられた変更は、サービスによって更新されたり上書きされたりする可能性があります。

HyperPod タスクガバナンスアドオンが Kueue を設定するために使用する設定の概要は、以下のとおりです。

```
  apiVersion: config.kueue.x-k8s.io/v1beta1
    kind: Configuration
    health:
      healthProbeBindAddress: :8081
    metrics:
      bindAddress: :8443
      enableClusterQueueResources: true
    webhook:
      port: 9443
    manageJobsWithoutQueueName: false
    leaderElection:
      leaderElect: true
      resourceName: c1f6bfd2.kueue.x-k8s.io
    controller:
      groupKindConcurrency:
        Job.batch: 5
        Pod: 5
        Workload.kueue.x-k8s.io: 5
        LocalQueue.kueue.x-k8s.io: 1
        ClusterQueue.kueue.x-k8s.io: 1
        ResourceFlavor.kueue.x-k8s.io: 1
    clientConnection:
      qps: 50
      burst: 100
    integrations:
      frameworks:
      - "batch/job"
      - "kubeflow.org/mpijob"
      - "ray.io/rayjob"
      - "ray.io/raycluster"
      - "jobset.x-k8s.io/jobset"
      - "kubeflow.org/mxjob"
      - "kubeflow.org/paddlejob"
      - "kubeflow.org/pytorchjob"
      - "kubeflow.org/tfjob"
      - "kubeflow.org/xgboostjob"
      - "pod"
      - "deployment"
      - "statefulset"
      - "leaderworkerset.x-k8s.io/leaderworkerset"
      podOptions:
        namespaceSelector:
          matchExpressions:
            - key: kubernetes.io/metadata.name
              operator: NotIn
              values: [ kube-system, kueue-system ]
    fairSharing:
      enable: true
      preemptionStrategies: [LessThanOrEqualToFinalShare, LessThanInitialShare]
    resources:
      excludeResourcePrefixes: []
```

各設定エントリの詳細については、Kueue ドキュメントの「[設定](https://kueue.sigs.k8s.io/docs/reference/kueue-config.v1beta1/#Configuration)」を参照してください。

## HyperPod タスクガバナンスの前提条件
<a name="hp-eks-task-governance-prerequisites"></a>
+ [クラスター管理者の IAM ユーザー](sagemaker-hyperpod-prerequisites-iam.md#sagemaker-hyperpod-prerequisites-iam-cluster-admin)に、HyperPod クラスター管理者向けの最小権限ポリシーが設定されていることを確認します。これには、SageMaker HyperPod コア APIs の実行、 内の SageMaker HyperPod クラスターの管理 AWS アカウント、 でのタスクの実行のためのアクセス許可が含まれます[Amazon EKS によってオーケストレーションされた SageMaker HyperPod クラスターを管理する](sagemaker-hyperpod-eks-operate.md)。
+ Kubernetes バージョン 1.30 以降が必要です。手順については、「[既存のクラスターを新しい Kubernetes バージョンに更新する](https://docs.aws.amazon.com/eks/latest/userguide/update-cluster.html)」を参照してください。
+ クラスターに既に Kueue がインストールされている場合は、EKS アドオンをインストールする前に Kueue をアンインストールします。
+ HyperPod タスクガバナンスアドオンをインストールする前に、HyperPod ノードが EKS クラスターに既に配置されている必要があります。

## HyperPod タスクガバナンスの設定
<a name="hp-eks-task-governance-setup"></a>

次に、HyperPod タスクガバナンスの設定方法について説明します。

------
#### [ Setup using the SageMaker AI console ]

次に、SageMaker HyperPod コンソールを使用した HyperPod タスクガバナンスの設定方法について説明します。

「[HyperPod Amazon CloudWatch オブザーバビリティ EKS アドオンの設定](sagemaker-hyperpod-eks-operate-console-ui-governance-setup-dashboard.md#hp-eks-dashboard-setup)」で、Amazon CloudWatch Observability EKS を管理し、SageMaker AI コンソールから HyperPod クラスターダッシュボードを表示するアクセス許可を既に付与している場合は、以下のすべてのアクセス許可が既に付与されています。まだ設定していない場合は、以下のサンプルポリシーを使用して、HyperPod タスクガバナンスアドオンを管理し、SageMaker AI コンソールから HyperPod クラスターダッシュボードを表示するアクセス許可を付与します。

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "eks:ListAddons",
                "eks:CreateAddon",
                "eks:UpdateAddon",
                "eks:DescribeAddon",
                "eks:DescribeAddonVersions",
                "sagemaker:DescribeCluster",
                "sagemaker:DescribeClusterNode",
                "sagemaker:ListClusterNodes",
                "sagemaker:ListClusters",
                "eks:DescribeCluster",
                "eks:AccessKubernetesApi"
            ],
            "Resource": "*"
        }
    ]
}
```

------

SageMaker HyperPod コンソールの **[ダッシュボード]** タブに移動して、Amazon SageMaker HyperPod タスクガバナンスアドオンをインストールします。

------
#### [ Setup using the Amazon EKS AWS CLI ]

サンプル [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/create-addon.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/create-addon.html) EKS AWS CLI コマンドを使用して、以下を使用して HyperPod タスクガバナンス Amazon EKS API とコンソール UI を設定します AWS CLI。

```
aws eks create-addon --region region --cluster-name cluster-name --addon-name amazon-sagemaker-hyperpod-taskgovernance
```

------

インストールが正常に完了すると、HyperPod SageMaker AI コンソールで **[ポリシー]** タブを表示できます。次の [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/describe-addon.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/describe-addon.html) EKS AWS CLI コマンドの例を使用してステータスを確認することもできます。

```
aws eks describe-addon --region region --cluster-name cluster-name --addon-name amazon-sagemaker-hyperpod-taskgovernance
```

# ダッシュボード
<a name="sagemaker-hyperpod-eks-operate-console-ui-governance-metrics"></a>

Amazon SageMaker HyperPod タスクガバナンスは、ハードウェア、チーム、タスクのメトリクスを含む Amazon EKS クラスターの使用率メト​​リクスの包括的なダッシュボードビューを提供します。以下は、HyperPod EKS クラスターダッシュボードで情報を提供します。

ダッシュボードでは、ハードウェア、チーム、タスクのメトリクスを含むクラスター使用率メト​​リクスの包括的なビューが提供されます。ダッシュボードを表示するには、EKS アドオンをインストールする必要があります。詳細については、「[ダッシュボードの設定](sagemaker-hyperpod-eks-operate-console-ui-governance-setup-dashboard.md)」を参照してください。

[Amazon SageMaker AI コンソール](https://console.aws.amazon.com/sagemaker/)の **[HyperPod クラスター]** で、HyperPod コンソールに移動すると、リージョン内の HyperPod クラスターのリストを表示できます。クラスターを選択し、**[ダッシュボード]** タブに移動します。ダッシュボードには、以下のメトリクスが表示されます。セクションのデータをダウンロードするには、対応する **[エクスポート]** をクリックします。

**使用率**

重要なコンピューティングリソースについて、EKS クラスターのポイントインタイムのヘルスと傾向ベースのメトリクスを提供します。デフォルトでは、**すべてのインスタンスグループ**が表示されます。インスタンスグループをフィルタリングするには、ドロップダウンメニューを使用します。このセクションに含まれるメトリクスは次のとおりです。
+ リカバリインスタンスの合計数、実行中の数、保留中の数。リカバリを保留中のインスタンスの数は、リカバリに注意が必要なインスタンスの数を示します。
+ GPU、GPU メモリ、vCPU、vCPU メモリ
+ GPU 使用率、GPU メモリ使用率、vCPU 使用率、vCPU メモリ使用率
+ GPU と vCPU の使用率のインタラクティブグラフ 

**チーム**

チーム固有のリソース管理に関する情報を提供します。これには、以下が含まれます。
+ インスタンスと GPU の割り当て
+ GPU 使用率
+ 借用された GPU 統計情報
+ タスクのステータス (実行中または保留中)
+ チーム全体の GPU 使用率とコンピューティング割り当ての棒グラフビュー
+ チームの詳細 GPU および vCPU 関連情報 デフォルトでは、表示される情報には**すべてのチーム**が含まれます。チームおよびインスタンスでフィルタリングするには、ドロップダウンメニューを選択します。インタラクティブプロットでは、時間でフィルタリングできます。

**タスク** 

**注記**  
ダッシュボードで HyperPod EKS クラスターのタスクを表示するには:  
指定された HyperPod 名前空間のデータサイエンティストユーザー用の Kubernetes ロールベースのアクセスコントロール (RBAC) を設定して、Amazon EKS オーケストされたクラスターでのタスク実行を承認します。名前空間は `hyperpod-ns-team-name` の形式に従います。RBAC アクセス許可を確立するには、「[チームロールの作成手順](https://github.com/aws/sagemaker-hyperpod-cli/tree/main/helm_chart#5-create-team-role)」を参照してください。
ジョブが適切な名前空間と優先クラスラベルで送信されていることを確認します。包括的な例については、「[SageMaker AI マネージドキューと名前空間にジョブを送信する](sagemaker-hyperpod-eks-operate-console-ui-governance-cli.md#hp-eks-cli-start-job)」を参照してください。

タスク関連のメトリクスに関する情報を提供します。これには、実行中のタスク数、保留中のタスク数、プリエンプトタスクの数、実行時間と待機時間の統計が含まれます。デフォルトでは、表示される情報には**すべてのチーム**が含まれます。ドロップダウンメニューを選択すると、チーム別にフィルタリングできます。インタラクティブプロットでは、時間でフィルタリングできます。

# タスク
<a name="sagemaker-hyperpod-eks-operate-console-ui-governance-tasks"></a>

Amazon SageMaker HyperPod EKS クラスタータスクに関する情報を紹介します。タスクは、クラスターに送信されるオペレーションまたはジョブです。これらは、トレーニング、実験の実行、推論などの機械学習オペレーションです。表示可能なタスクの詳細リストには、ステータス、実行時間、タスクごとのコンピューティング使用率などが含まれます。

[Amazon SageMaker AI コンソール](https://console.aws.amazon.com/sagemaker/)の **[HyperPod クラスター]** で、HyperPod コンソールに移動すると、リージョン内の HyperPod クラスターのリストを表示できます。クラスターを選択し、**[タスク]** タブに移動します。

**[タスク]** タブを管理者以外のユーザーに表示できるようにするには、管理者は「[IAM ロールの EKS クラスターにアクセスエントリを追加する](https://docs.aws.amazon.com/eks/latest/userguide/access-entries.html)」必要があります。

**注記**  
ダッシュボードで HyperPod EKS クラスターのタスクを表示するには:  
指定された HyperPod 名前空間のデータサイエンティストユーザー用の Kubernetes ロールベースのアクセスコントロール (RBAC) を設定して、Amazon EKS オーケストされたクラスターでのタスク実行を承認します。名前空間は `hyperpod-ns-team-name` の形式に従います。RBAC アクセス許可を確立するには、「[チームロールの作成手順](https://github.com/aws/sagemaker-hyperpod-cli/tree/main/helm_chart#5-create-team-role)」を参照してください。
ジョブが適切な名前空間と優先クラスラベルで送信されていることを確認します。包括的な例については、「[SageMaker AI マネージドキューと名前空間にジョブを送信する](sagemaker-hyperpod-eks-operate-console-ui-governance-cli.md#hp-eks-cli-start-job)」を参照してください。

EKS クラスターの場合、kubeflow (PyTorch、MPI、TensorFlow) タスクが表示されます。デフォルトでは、PyTorch タスクが表示されます。ドロップダウンメニューを選択するか、検索フィールドを使用して、PyTorch タスク、MPI タスク、TensorFlow タスクでフィルタリングできます。各タスクに表示される情報には、タスク名、ステータス、名前空間、優先クラス、作成時刻が含まれます。

# Amazon SageMaker HyperPod タスクガバナンスでのトポロジー認識スケジューリングの使用
<a name="sagemaker-hyperpod-eks-operate-console-ui-governance-tasks-scheduling"></a>

Amazon SageMaker HyperPod タスクガバナンスでのトポロジー認識スケジューリングは、Amazon EC2 インスタンスの物理ネットワークトポロジーに基づいてポッドを配置することで、分散機械学習ワークロードのトレーニング効率を最適化します。アベイラビリティーゾーン、ネットワークブロック、物理ラックなどの AWS インフラストラクチャの階層構造を考慮すると、トポロジー対応スケジューリングにより、頻繁な通信を必要とするポッドがネットワークレイテンシーを最小限に抑えるために近接してスケジュールされます。このインテリジェントな配置は、ポッド間の集中的な通信を伴う大規模な機械学習トレーニングジョブで特に効果的であり、トレーニング時間の短縮とクラスター全体にわたるリソース利用効率の向上につながります。

**注記**  
トポロジー認識スケジューリングを使用するには、HyperPod タスクガバナンスのバージョンが v1.2.2-eksbuild.1 以降であることを確認する必要があります。

トポロジー認識スケジューリングでは、次のインスタンスタイプがサポートされています。
+ ml.p3dn.24xlarge
+ ml.p4d.24xlarge
+ ml.p4de.24xlarge
+ ml.p5.48xlarge
+ ml.p5e.48xlarge
+ ml.p5en.48xlarge
+ ml.p6e-gb200.36xlarge
+ ml.trn1.2xlarge
+ ml.trn1.32xlarge
+ ml.trn1n.32xlarge
+ ml.trn2.48xlarge
+ ml.trn2u.48xlarge

トポロジー認識スケジューリングは、既存の HyperPod ワークフローと統合され、kubectl YAML ファイルと HyperPod CLI の両方を通じて柔軟なトポロジー設定を提供します。HyperPod タスクガバナンスは、トポロジーラベルを使用してクラスタノードを自動的に設定し、HyperPod タスクガバナンスポリシーおよびリソース借用メカニズムと組み合わせて使用することで、トポロジー認識スケジューリングが現在の運用プロセスを中断することを防ぎます。優先トポロジー仕様と必須トポロジー仕様の両方が組み込まれているため、トポロジー制約を満たせない場合に標準スケジューリングにフォールバックする柔軟性を維持しながら、特定のパフォーマンス要件に合わせてワークロードの配置を微調整できます。

HyperPod のトポロジー認識ラベルを活用することで、物理ネットワークインフラストラクチャを考慮したインテリジェントなポッド配置を介して、機械学習ワークロードを強化できます。HyperPod タスクガバナンスは、階層型データセンタートポロジーに基づいてポッドスケジューリングを自動的に最適化します。これは、分散 ML タスクのネットワークレイテンシーの短縮とトレーニングパフォーマンスの向上に直接つながります。このトポロジー認識機能は、関連するポッドをネットワーク階層内で戦略的に近接配置することで通信オーバーヘッドを最小限に抑えるため、特に大規模な機械学習ワークロードで役に立ちます。その結果、ポッド間の通信ネットワークレイテンシーが最適化され、リソース利用効率が向上し、コンピューティング集約型の AI/ML アプリケーションの全体的なパフォーマンスが向上します。これらはすべて、複雑なネットワークトポロジー構成を手動で管理する必要なく実現できます。

以下は、HyperPodタスクガバナンスがポッドをスケジュールできる利用可能なトポロジーネットワークレイヤーのラベルです。
+ topology.k8s.aws/network-node-layer-1
+ topology.k8s.aws/network-node-layer-2
+ topology.k8s.aws/network-node-layer-3
+ topology.k8s.aws/ultraserver-id

トポロジー認識スケジューリングを使用するには、YAML ファイルに次のラベルを含めます。
+ kueue.x-k8s.io/podset-required-topology - このジョブに必要なポッドが必要であり、ノード内のすべてのポッドが同じトポロジレイヤー内でスケジュールされる必要があることを示します。
+ kueue.x-k8s.io/podset-preferred-topology - このジョブに必要なポッドが必要であり、同じトポロジレイヤー内でのポッドのスケジュールが推奨されるものの、必須ではないことを示します。HyperPod タスクガバナンスは、次のトポロジレイヤーを試す前に、単一のレイヤー内でポッドのスケジュールを試行します。

リソースが同じトポロジラベルを共有していない場合、ジョブは中断され、待機リストに登録されます。Kueue が十分なリソースがあることを認識すると、ジョブを承認して実行します。

次の例は、YAML ファイルでラベルを使用する方法を説明しています。

```
apiVersion: batch/v1
kind: Job
metadata:
  name: test-tas-job
  namespace: hyperpod-ns-team-name
  labels:
    kueue.x-k8s.io/queue-name: hyperpod-ns-team-name-localqueue
    kueue.x-k8s.io/priority-class: PRIORITY_CLASS-priority
spec:
  parallelism: 10
  completions: 10
  suspend: true
  template:
    metadata:
      labels:
        kueue.x-k8s.io/queue-name: hyperpod-ns-team-name-localqueue
      annotations:
        kueue.x-k8s.io/podset-required-topology: "topology.k8s.aws/network-node-layer-3"
        or
        kueue.x-k8s.io/podset-preferred-topology: "topology.k8s.aws/network-node-layer-3"
    spec:
      nodeSelector:
        topology.k8s.aws/network-node-layer-3: TOPOLOGY_LABEL_VALUE
      containers:
        - name: dummy-job
          image: gcr.io/k8s-staging-perf-tests/sleep:v0.1.0
          args: ["3600s"]
          resources:
            requests:
              cpu: "100"
      restartPolicy: Never
```

次の表は、kubectl YAML ファイルで使用できる新しいパラメータを説明しています。


| パラメータ | 説明 | 
| --- | --- | 
| kueue.x-k8s.io/queue-name | ジョブの実行に使用するキューの名前。この queue-name の形式は hyperpod-ns-team-name-localqueue である必要があります。 | 
| kueue.x-k8s.io/priority-class | ポッドのスケジューリングの優先度を指定できます。この仕様はオプションです。 | 
| annotations | ジョブにアタッチするトポロジーの注釈が含まれます。利用可能なトポロジーは、kueue.x-k8s.io/podset-required-topology と kueue.x-k8s.io/podset-preferred-topology です。注釈または nodeSelector のどちらかを使用できますが、両方を同時に使用することはできません。 | 
| nodeSelector | Amazon EC2 インスタンスの配置レイヤーを表すネットワークレイヤーを指定します。このフィールドまたは注釈のどちらかを使用しますが、両方を同時に使用することはできません。YAML ファイルでは、nodeSelector パラメータを使用してポッドの正確なレイヤーを選択することもできます。ラベルの値を取得するには、[DescribeInstanceTopology](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeInstanceTopology.html) API オペレーションを使用します。 | 

HyperPod CLI を使用してジョブを実行し、トポロジー認識スケジューリングを使用することもできます。HyperPod CLI の詳細については、「[SageMaker HyperPod CLI コマンド](sagemaker-hyperpod-eks-hyperpod-cli-reference.md)」を参照してください。

```
hyp create hyp-pytorch-job \                                            
  --version 1.1 \
  --job-name sample-pytorch-job \
  --image 123456789012.dkr.ecr.us-west-2.amazonaws.com/ptjob:latest \
  --pull-policy "Always" \
  --tasks-per-node 1 \
  --max-retry 1 \
  --priority high-priority \
  --namespace hyperpod-ns-team-name \
  --queue-name hyperpod-ns-team-name-localqueue \
  --preferred-topology-label topology.k8s.aws/network-node-layer-1
```

トポロジーラベルを使用して PytorchJob を実行するために使用できる設定ファイルの例は、次のとおりです。MPI ジョブと Tensorflow ジョブを実行する場合、ファイルはほぼ同様です。代わりにこれらのジョブを実行したい場合は、PyTorchJob の代わりに適切なイメージを使用するなど、設定ファイルを適宜変更します。PyTorchJob を実行する場合は、プライマリノードとワーカーノードに異なるトポロジを割り当てることができます。PyTorchJob には常に単一のプライマリノードが存在するため、ワーカーポッドをサポートするにはトポロジーを使用することをお勧めします。

```
apiVersion: kubeflow.org/v1
kind: PyTorchJob
metadata:
  annotations: {}
  labels:
    kueue.x-k8s.io/queue-name: hyperpod-ns-team-name-localqueue
  name: tas-test-pytorch-job
  namespace: hyperpod-ns-team-name
spec:
  pytorchReplicaSpecs:
    Master:
      replicas: 1
      restartPolicy: OnFailure
      template:
        metadata:
          labels:
            kueue.x-k8s.io/queue-name: hyperpod-ns-team-name-localqueue
        spec:
          containers:
          - command:
            - python3
            - /opt/pytorch-mnist/mnist.py
            - --epochs=1
            image: docker.io/kubeflowkatib/pytorch-mnist:v1beta1-45c5727
            imagePullPolicy: Always
            name: pytorch
    Worker:
      replicas: 10
      restartPolicy: OnFailure
      template:
        metadata:
          # annotations:
            # kueue.x-k8s.io/podset-required-topology: "topology.k8s.aws/network-node-layer-3"
          labels:
            kueue.x-k8s.io/queue-name: hyperpod-ns-team-name-localqueue
        spec:
          containers:
          - command:
            - python3
            - /opt/pytorch-mnist/mnist.py
            - --epochs=1
            image: docker.io/kubeflowkatib/pytorch-mnist:v1beta1-45c5727
            imagePullPolicy: Always
            name: pytorch
            resources:
              limits:
                cpu: 1
              requests:
                memory: 200Mi
                cpu: 1
          #nodeSelector:
          #  topology.k8s.aws/network-node-layer-3: xxxxxxxxxxx
```

クラスターのトポロジーを確認するには、[DescribeInstanceTopology](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeInstanceTopology.html) API オペレーションを使用します。デフォルトでは、トポロジは AWS マネジメントコンソール および Amazon SageMaker Studio では非表示になっています。使用しているインターフェイスでこれらを表示するには、以下の手順を実行します。

**SageMaker Studio**

1. SageMaker Studio で、使用するクラスターに移動します。

1. タスクビューで、名前列のオプションメニューを選択し、**[列の管理]** をクリックします。

1. **[リクエストされたトポロジー]** と **[トポロジーの制約]** を選択して列を追加し、Kubernetes ポッドのリストでトポロジー情報を表示します。

**AWS マネジメントコンソール**

1. Amazon SageMaker AI コンソール ([https://console.aws.amazon.com/sagemaker/](https://console.aws.amazon.com/sagemaker/)) を開きます。

1. **[HyperPod クラスター]** で、**[クラスターの管理]** をクリックします。

1. **[タスク]** タブをクリックしてから歯車アイコンをクリックします。

1. インスタンス属性で、**[リクエストされたトポロジー]** と **[トポロジの制約]** を切り替えます。

1. **[確認]** をクリックして、テーブルでトポロジー情報を表示します。

# ポリシー
<a name="sagemaker-hyperpod-eks-operate-console-ui-governance-policies"></a>

Amazon SageMaker HyperPod タスクガバナンスは、Amazon EKS クラスターリソースの割り当て方法とタスクの優先順位付け方法を簡素化します。以下では、HyperPod EKS クラスターポリシーについて説明します。データガバナンスをセットアップする方法については、「[タスクガバナンスの設定](sagemaker-hyperpod-eks-operate-console-ui-governance-setup-task-governance.md)」を参照してください。

ポリシーは、**[コンピューティングの優先順位付け]** と **[コンピューティング割り当て]** に分割されます。以下のポリシーの概念は、これらのポリシーに基づいて整理されています。

**[コンピューティングの優先順位付け]**、つまりクラスターポリシーは、アイドル状態のコンピューティングリソースをどのように借用し、チームごとにタスクをどのように優先順位付けするかを決定します。
+ **[アイドル状態のコンピューティング割り当て]** は、アイドル状態のコンピューティングリソースをチーム間でどのように割り当てるかを定義します。つまり、未使用のコンピューティングリソースをチームからどのように借用するかを定義します。**[アイドル状態のコンピューティング割り当て]** を選択する際は、次のいずれかを選択できます。
  + **先着順**: 適用すると、チーム間の優先順位付けは行われず、各タスクが割り当て超過リソースを取得する可能性は均等になります。タスクは送信順に優先順位付けされます。つまり、ユーザーが最初にリクエストすれば、アイドル状態のコンピューティングリソースを 100% 使用できる可能性があります。
  + **適性な共有**: 適用すると、チームは割り当てられた**適正な共有の加重**に基づいてアイドル状態のコンピューティングリソースを借りることができます。これらの重みは、**[コンピューティング割り当て]** で定義されます。使用方法の詳細については、「[アイドル状態のコンピューティングリソースを共有する例](#hp-eks-task-governance-policies-examples)」をご覧ください。
+ **[タスクの優先順位付け]** は、コンピューティングリソースが利用可能になった場合にタスクがどのようにキューに入れられるかを定義します。**[タスクの優先順位付け]** を選択する際は、次のいずれかを選択できます。
  + **先着順**:適用すると、タスクはリクエストした順にキューに入れられます。
  + **タスクの順位付け**: 適用すると、タスクは優先順位で定義された順序でキューに入れられます。このオプションを選択した場合は、優先クラスと、その優先度の加重を追加する必要があります。同じ優先クラスのタスクは、先着順で実行されます。コンピューティング割り当てで有効にすると、タスクはチーム内の優先度の高いタスクによって、優先度の低いタスクよりも優先されます。

    データサイエンティストがクラスターにジョブを送信する際は、YAML ファイルで優先クラス名を使用します。優先クラスは `priority-class-name-priority` の形式です。例については、[SageMaker AI マネージドキューと名前空間にジョブを送信する](sagemaker-hyperpod-eks-operate-console-ui-governance-cli.md#hp-eks-cli-start-job)を参照してください。
  + **優先クラス**: これらのクラスは、キャパシティを借用する際のタスクの相対的な優先度を設定します。借用クォータを使用してタスクが実行されている場合、タスクに利用可能なキャパシティが不足していると、そのタスクよりも優先度の高い別のタスクによってプリエンプトされる場合があります。**[コンピューティング割り当て]** で **[プリエンプション]** が有効になっている場合、優先度の高いタスクが自分のチーム内のタスクよりも優先される場合があります。
+ **未割り当てのリソース共有**により、チームはコンピューティングクォータを通じてどのチームにも割り当てられていないコンピューティングリソースを借用できます。有効にすると、チームが未割り当てのクラスター容量を自動的に借用できるようになります。詳細については、「[未割り当てのリソース共有の仕組み](#sagemaker-hyperpod-eks-operate-console-ui-governance-policies-idle-resource-sharing-how-it-works)」を参照してください。

**[コンピューティング割り当て]**、つまりコンピューティングクォータは、チームのコンピューティング割り当てと、適性な共有のアイドル状態のコンピューティング割り当てにおけるチームに割り当てられた加重 (優先度) を定義します。
+ **チーム名**: チームの名前です。対応する**名前空間** (`hyperpod-ns-team-name` 型) が作成されます。
+ **メンバー**: チーム名前空間のメンバー。Amazon EKS でオーケストレーションされた HyperPod クラスターでタスクを実行するには、このチームに参加させるデータサイエンティストユーザーに対して Kubernetes のロールベースのアクセスコントロール (RBAC) を設定する必要があります。Kubernetes RBAC を設定するには、「[チームロールの作成](https://github.com/aws/sagemaker-hyperpod-cli/tree/main/helm_chart#5-create-team-role)」の手順を使用します。
+ **適正な共有の加重**: これは、**[適正な共有]** が **[アイドル状態のコンピューティング割り当て]** に適用される場合にチームに割り当てられる優先順位付けのレベルです。最高優先度の加重は 100 で、最低優先度の加重は 0 です。加重が高いほど、チームは共有キャパシティ内の未使用のリソースにより早くアクセスできます。加重が 0 の場合、優先順位が最も低く、このチームが他のチームと比較して常に不利になることを意味します。

  適正な共有の加重は、利用可能なリソースを他のユーザーと競う際に、このチームに比較上の優位性を提供します。アドミッションは、加重が最も高く、借用が最も少ないチームからのタスクのスケジューリングを優先します。例えば、チーム A の加重が 10 で、チーム B の加重が 5 の場合、チーム A は未使用のリソースへのアクセスに関して優先権を持ち、チーム B よりも先にジョブがスケジュールされます。
+ **タスクのプリエンプション**: コンピューティングは、優先度に基づいてタスクから引き継がれます。デフォルトでは、アイドル状態のコンピューティングを貸すチームが、他のチームのタスクをプリエンプトします。
+ **貸借**: アイドル状態のコンピューティングがチームによってどのように貸し出されているか、また、チームが他のチームから借りることができるかどうか。
  + **パーセンテージベースの借用制限**: チームが借用できるアイドル状態のコンピューティングの制限。保証されたクォータに対するパーセンテージで表されます。チームは、割り当てられたコンピューティングの最大 10,000% を借用できます。ここで指定した値はパーセンテージとして解釈されます。例えば、500 の値は 500% と解釈されます。この割合は、チームのクォータ内のすべてのリソースタイプ (CPU、GPU、メモリ) とインスタンスタイプに均一に適用されます。
  + **絶対借用制限**: チームが借用できるアイドル状態のコンピューティングの制限。インスタンスタイプあたりの絶対リソース値として定義されます。これにより、特定のインスタンスタイプの借用動作をきめ細かく制御できます。インスタンス数、アクセラレーター、vCPU、メモリ、アクセラレーターパーティションなど、**コンピューティングクォータ**と同じスキーマを使用して絶対制限を指定する必要があります。チームのクォータで 1 つ以上のインスタンスタイプの絶対制限を指定できます。

優先クラスや名前空間など、これらの概念の使用方法については、「[HyperPod タスクガバナンス AWS CLI コマンドの例](sagemaker-hyperpod-eks-operate-console-ui-governance-cli.md)」を参照してください。

## アイドル状態のコンピューティングリソースを共有する例
<a name="hp-eks-task-governance-policies-examples"></a>

適切なクォータ管理を確保するため、予約済みクォータの合計は、クラスターでそのリソースに対して利用可能なキャパシティを超えることはできなりません。例えば、クラスターが 20 個の `ml.c5.2xlarge` インスタンスで設定されている場合、チームに割り当てられる累積クォータは 20 未満である必要があります。

チームの **[コンピューティング割り当て]** ポリシーで **[貸借]** または **[貸す]** が許可されている場合、アイドル状態のキャパシティはこれらのチーム間で共有されます。例えば、チーム A とチーム B では **[貸借]** が有効になっています。チーム A のクォータは 6 ですが、ジョブには 2 つのみを使用し、チーム B のクォータは 5 で、ジョブには 4 を使用しています。チーム B に 4 つのリソースを必要とするジョブが送信された場合、3 つがチーム A から借用されます。

チームの **[コンピューティング割り当て]** ポリシーが **[貸さないでください]** に設定されている場合、チームは独自の割り当てを超えて追加のキャパシティを借りることはできません。

## 未割り当てのリソース共有の仕組み
<a name="sagemaker-hyperpod-eks-operate-console-ui-governance-policies-idle-resource-sharing-how-it-works"></a>

未割り当てのリソース共有は、クラスター内のコンピューティングクォータに割り当てられていないリソースのプールを自動的に管理します。つまり、HyperPod はクラスターの状態を継続的にモニタリングし、時間の経過とともに自動的に正しい設定に更新します。

**初期セットアップ**
+ ClusterSchedulerConfig `Enabled`で `IdleResourceSharing`を に設定すると (デフォルトでは `Disabled`)、HyperPod タスクガバナンスはクラスターのモニタリングを開始し、合計ノード容量からチームクォータを差し引いて使用可能なアイドルリソースを計算します。
+ 未割り当てのリソース共有 ClusterQueues は、借用可能なリソースプールを表すために作成されます。
+ 割り当てられていないリソース共有を初めて有効にすると、インフラストラクチャのセットアップに数分かかります。ポリシー`Status`と ClusterSchedulerConfig `DetailedStatus` を使用して進行状況をモニタリングできます。

**継続的な照合**
+ HyperPod タスクガバナンスは、ノードの追加や削除、クラスターキュークォータの更新などの変更を継続的にモニタリングします。
+  変更が発生すると、未割り当てのリソース共有はクォータを再計算し、ClusterQueues を更新します。照合は通常、数秒以内に完了します。

**モニタリング**

 未割り当てのリソース共有が完全に設定されていることを確認するには、未割り当てのリソース共有 ClusterQueues を確認します。

```
kubectl get clusterqueue | grep hyperpod-ns-idle-resource-sharing
```

のような名前の ClusterQueues が表示されると`hyperpod-ns-idle-resource-sharing-cq-1`、未割り当てのリソース共有がアクティブになります。クラスター内のリソースフレーバーの数によっては、未割り当てのリソース共有 ClusterQueues が複数存在する場合があることに注意してください。

## 未割り当てのリソース共有のノード適格性
<a name="sagemaker-hyperpod-eks-operate-console-ui-governance-policies-idle-resource-sharing-node-eligibility"></a>

未割り当ての Resource Sharing には、次の要件を満たすノードのみが含まれます。

1. **ノード準備完了ステータス**
   + 未割り当てのリソースプールに寄与するには、ノードのステータスが `Ready` である必要があります。
   + `NotReady` または他の準備ができていない状態のノードは、容量計算から除外されます。
   + ノードが になると`Ready`、次の調整サイクルに自動的に含まれます。

1. **ノードのスケジュール可能なステータス**
   + を持つノード`spec.unschedulable: true`は、未割り当てのリソース共有から除外されます。
   + ノードが再びスケジュール可能になると、次の調整サイクルに自動的に含まれます。

1. **MIG 設定 (GPU ノードのみ)**
   + MIG (マルチインスタンス GPU) パーティショニングを使用する GPU ノード`success`の場合、割り当てられていないリソース共有に MIG プロファイルを提供するには、 `nvidia.com/mig.config.state`ラベルに と表示する必要があります。
   + これらのノードは、MIG 設定が正常に完了すると自動的に再試行されます。

1. **サポートされているインスタンスタイプ**
   + インスタンスは、サポートされている SageMaker HyperPod インスタンスタイプである必要があります。
   + SageMaker HyperPod クラスターでサポートされているインスタンスタイプのリストを参照してください。

**Topics**
+ [

## アイドル状態のコンピューティングリソースを共有する例
](#hp-eks-task-governance-policies-examples)
+ [

## 未割り当てのリソース共有の仕組み
](#sagemaker-hyperpod-eks-operate-console-ui-governance-policies-idle-resource-sharing-how-it-works)
+ [

## 未割り当てのリソース共有のノード適格性
](#sagemaker-hyperpod-eks-operate-console-ui-governance-policies-idle-resource-sharing-node-eligibility)
+ [

# ポリシーの作成
](sagemaker-hyperpod-eks-operate-console-ui-governance-policies-create.md)
+ [

# ポリシーを編集する
](sagemaker-hyperpod-eks-operate-console-ui-governance-policies-edit.md)
+ [

# ポリシーを削除する
](sagemaker-hyperpod-eks-operate-console-ui-governance-policies-delete.md)
+ [

# Amazon SageMaker HyperPod タスクガバナンスでのコンピューティングクォータの割り当て
](sagemaker-hyperpod-eks-operate-console-ui-governance-policies-compute-allocation.md)

# ポリシーの作成
<a name="sagemaker-hyperpod-eks-operate-console-ui-governance-policies-create"></a>

**[クラスターポリシー]** と **[コンピューティング割り当て]** 設定は、**[ポリシー]** タブで作成できます。以下の設定を作成する方法の手順は、次のとおりです。
+ **[クラスターポリシー]** を作成して、タスクの優先順位付け方法とアイドル状態のコンピューティング割り当て方法を更新します。
+ **[コンピューティング割り当て]** を作成して、チームの新しいコンピューティング割り当てポリシーを作成します。
**注記**  
**[コンピューティング割り当て]** を作成する際、Amazon EKS でオーケストレーションされた HyperPod クラスターでタスクを実行するために、対応する名前空間のデータサイエンティストユーザーに対して Kubernetes のロールベースのアクセスコントロール (RBAC) を設定する必要があります。名前空間の形式は `hyperpod-ns-team-name` です。Kubernetes RBAC を設定するには、「[チームロールの作成](https://github.com/aws/sagemaker-hyperpod-cli/tree/main/helm_chart#5-create-team-role)」の手順を使用します。

HyperPod タスクガバナンス EKS クラスターポリシーの概念については、「[ポリシー](sagemaker-hyperpod-eks-operate-console-ui-governance-policies.md)」を参照してください。

**HyperPod タスクガバナンスポリシーを作成する**

この手順では、HyperPod でセットアップされた Amazon EKS クラスターが作成済みであることを前提としています。まだプッシュしていない場合は、「[Amazon EKS オーケストレーションを使用した SageMaker HyperPod クラスターの作成](sagemaker-hyperpod-eks-operate-console-ui-create-cluster.md)」を参照してください。

1. [Amazon SageMaker AI コンソール](https://console.aws.amazon.com/sagemaker/)に移動します。

1. 左側のナビゲーションペインで **[HyperPod クラスター]** を選択し、**[クラスターの管理]** をクリックします。

1. **[SageMaker HyperPod クラスター]** にリストされている Amazon EKS クラスターを選択します。

1. **[Policies]** タブを選択します。

1. **[クラスターポリシー]** を作成するには:

   1. 対応する **[編集]** をクリックして、タスクの優先順位付け方法とアイドル状態のコンピューティング割り当て方法を更新します。

   1. 変更が完了したら、**[送信]** をクリックします。

1. **[コンピューティング割り当て]** を作成するには:

1. 

   1. 対応する **[作成]** をクリックします。これにより、コンピューティング割り当ての作成ページが表示されます。

   1. 変更が完了したら、**[送信]** をクリックします。

# ポリシーを編集する
<a name="sagemaker-hyperpod-eks-operate-console-ui-governance-policies-edit"></a>

**[クラスターポリシー]** と **[コンピューティング割り当て]** 設定は、**[ポリシー]** タブで編集できます。以下の設定を編集する方法の手順は、次のとおりです。
+ **[クラスターポリシー]** を編集して、タスクの優先順位付け方法とアイドル状態のコンピューティング割り当て方法を更新します。
+ **[コンピューティング割り当て]** を編集して、チームの新しいコンピューティング割り当てポリシーを作成します。
**注記**  
**[コンピューティング割り当て]** を作成する際、Amazon EKS でオーケストレーションされた HyperPod クラスターでタスクを実行するために、対応する名前空間のデータサイエンティストユーザーに対して Kubernetes のロールベースのアクセスコントロール (RBAC) を設定する必要があります。名前空間の形式は `hyperpod-ns-team-name` です。Kubernetes RBAC を設定するには、「[チームロールの作成](https://github.com/aws/sagemaker-hyperpod-cli/tree/main/helm_chart#5-create-team-role)」の手順を使用します。

HyperPod タスクガバナンス EKS クラスターポリシーの概念の詳細については、「[ポリシー](sagemaker-hyperpod-eks-operate-console-ui-governance-policies.md)」を参照してください。

**HyperPod タスクガバナンスポリシーを編集する**

この手順では、HyperPod でセットアップされた Amazon EKS クラスターが作成済みであることを前提としています。まだプッシュしていない場合は、「[Amazon EKS オーケストレーションを使用した SageMaker HyperPod クラスターの作成](sagemaker-hyperpod-eks-operate-console-ui-create-cluster.md)」を参照してください。

1. [Amazon SageMaker AI コンソール](https://console.aws.amazon.com/sagemaker/)に移動します。

1. 左側のナビゲーションペインで **[HyperPod クラスター]** を選択し、**[クラスターの管理]** をクリックします。

1. **[SageMaker HyperPod クラスター]** にリストされている Amazon EKS クラスターを選択します。

1. **[Policies]** タブを選択します。

1. **[クラスターポリシー]** を編集するには:

   1. 対応する **[編集]** をクリックして、タスクの優先順位付け方法とアイドル状態のコンピューティング割り当て方法を更新します。

   1. 変更が完了したら、**[送信]** をクリックします。

1. **[コンピューティング割り当て]** を編集するには:

1. 

   1. **[コンピューティング割り当て]** で編集する設定を選択します。これにより、設定の詳細ページが開きます。

   1. これらの設定を編集する場合は、**[編集]** をクリックします。

   1. 変更が完了したら、**[送信]** をクリックします。

# ポリシーを削除する
<a name="sagemaker-hyperpod-eks-operate-console-ui-governance-policies-delete"></a>

**[クラスターポリシー]** と **[コンピューティング割り当て]** 設定は、SageMaker AI コンソールまたは AWS CLIを使用して削除できます。次のページでは、SageMaker HyperPod タスクガバナンスポリシーと設定を削除する方法について説明します。

HyperPod タスクガバナンス EKS クラスターポリシーの概念の詳細については、「[ポリシー](sagemaker-hyperpod-eks-operate-console-ui-governance-policies.md)」を参照してください。

**注記**  
タスクガバナンスポリシーの一覧表示または削除で問題が発生した場合は、クラスター管理者のアクセス許可の最小セットを更新する必要がある場合があります。「[クラスター管理者の IAM ユーザー](sagemaker-hyperpod-prerequisites-iam.md#sagemaker-hyperpod-prerequisites-iam-cluster-admin)」セクションの **[Amazon EKS]** タブを参照してください。詳細については、「[クラスターの削除](sagemaker-hyperpod-eks-operate-console-ui-governance-troubleshoot.md#hp-eks-troubleshoot-delete-policies)」を参照してください。

## HyperPod タスクガバナンスポリシーを削除する (コンソール)
<a name="sagemaker-hyperpod-eks-operate-console-ui-governance-policies-delete-console"></a>

以下では、SageMaker AI コンソールを使用して HyperPod タスクガバナンスポリシーを削除します。

**注記**  
SageMaker AI コンソールを使用して **[クラスターポリシー]** (`ClusterSchedulerConfig`) を削除することはできません。を使用してこれを行う方法については AWS CLI、「」を参照してください[HyperPod タスクガバナンスポリシーを削除する (AWS CLI)](#sagemaker-hyperpod-eks-operate-console-ui-governance-policies-delete-cli)。

**タスクガバナンスポリシーを削除するには (コンソール)**

1. [Amazon SageMaker AI コンソール](https://console.aws.amazon.com/sagemaker/)に移動します。

1. 左側のナビゲーションペインで **[HyperPod クラスター]** を選択し、**[クラスターの管理]** をクリックします。

1. **[SageMaker HyperPod クラスター]** にリストされている Amazon EKS クラスターを選択します。

1. **[Policies]** タブを選択します。

1. **[コンピューティング割り当て]** を削除するには (`ComputeQuota`):

   1. **[コンピューティング割り当て]** セクションで、削除する設定を選択します。

   1. **[アクション]** ドロップダウンメニューで、**[削除]** を選択します。

   1. タスクを実行するには、手順に従ってください。

## HyperPod タスクガバナンスポリシーを削除する (AWS CLI)
<a name="sagemaker-hyperpod-eks-operate-console-ui-governance-policies-delete-cli"></a>

以下では AWS CLI 、 を使用して HyperPod タスクガバナンスポリシーを削除します。

**注記**  
次のコマンドを使用して問題が発生した場合は、 を更新する必要がある場合があります AWS CLI。詳細については、「[AWS CLIの最新バージョンのインストールまたは更新](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html)」を参照してください。

**タスクガバナンスポリシーを削除するには (AWS CLI)**

まず、以下の AWS CLI コマンドの変数を設定します。

```
REGION=aws-region
```

1. 削除するポリシーに関連付けられた *cluster-arn* を取得します。次の AWS CLI コマンドを使用して、 内のクラスターを一覧表示できます AWS リージョン。

   ```
   aws sagemaker list-clusters \
       --region ${REGION}
   ```

1. コンピューティング割り当てを削除するには (`ComputeQuota`):

   1. HyperPod クラスターに関連付けられているすべてのコンピューティングクォータを一覧表示します。

      ```
      aws sagemaker list-compute-quotas \
          --cluster-arn cluster-arn \
          --region ${REGION}
      ```

   1. 削除する各 `compute-quota-id` に対して、以下のコマンドを実行してコンピューティングクォータを削除します。

      ```
      aws sagemaker delete-compute-quota \
          --compute-quota-id compute-quota-id \
          --region ${REGION}
      ```

1. クラスターポリシーを削除するには (`ClusterSchedulerConfig`):

   1. HyperPod クラスターに関連付けられているすべてのクラスターポリシーを一覧表示します。

      ```
      aws sagemaker list-cluster-scheduler-configs \
          --cluster-arn cluster-arn \
          --region ${REGION}
      ```

   1. 削除する各 `cluster-scheduler-config-id` に対して、以下のコマンドを実行してコンピューティングクォータを削除します。

      ```
      aws sagemaker delete-cluster-scheduler-config 
          --cluster-scheduler-config-id scheduler-config-id \
          --region ${REGION}
      ```

# Amazon SageMaker HyperPod タスクガバナンスでのコンピューティングクォータの割り当て
<a name="sagemaker-hyperpod-eks-operate-console-ui-governance-policies-compute-allocation"></a>

クラスター管理者は、購入したコンピューティングリソースを組織がどのように使用するかを決定できます。これにより、無駄なリソースやアイドル状態のリソースを削減できます。コンピューティングクォータを割り当てて、チームが未使用のリソースを相互に借りられるようにすることができます。HyperPod タスクガバナンスのコンピューティングクォータ割り当てにより、管理者はインスタンスレベル、さらにはよりきめ細かいリソースレベルでリソースを割り当てることができます。この機能により、インスタンス全体を割り当てるのではなく、個々のコンピューティングリソースをきめ細かく制御できるため、柔軟かつ効率的なリソース管理をチームに提供できます。きめ細かいレベルでの割り当てにより、従来のインスタンスレベルの割り当てに伴う非効率性が解消されます。このアプローチにより、リソース使用率を最適化し、アイドル状態のコンピューティングリソースを低減できます。

コンピューティングクォータ割り当てでは、アクセラレータ、vCPU、メモリの 3 種類のリソース割り当てをサポートしています。アクセラレータは、高速コンピューティングインスタンス内のコンポーネントであり、浮動小数点数計算、グラフィック処理、データパターンマッチングなどの機能を実行します。アクセラレータには、GPU、Trainium アクセラレータ、ニューロンコアなどがあります。マルチチーム GPU 共有の場合、異なるチームが同じインスタンスタイプから特定のGPU割り当てを受け取ることができ、アクセラレータハードウェアの使用率を最大化できます。データの前処理やモデルのキャッシュシナリオのために追加の RAM を必要とするメモリ集約型のワークロードの場合、デフォルトの GPU 対メモリ比率を超えてメモリクォータを割り当てることができます。GPU トレーニング以外にも、大量の CPU リソースを必要とする、CPU 負荷の高い前処理タスクでは、独立した CPU リソース割り当てを割り当てることができます。

値を指定すると、HyperPod タスクガバナンスは、**割り当てられたリソースをインスタンスで利用可能なリソースの総量で割った**式を使用して比率を計算します。HyperPod タスクガバナンスはこの比率を使用して、他のリソースにデフォルトの割り当てを適用しますが、これらのデフォルトをオーバーライドして、ユースケースに基づいてカスタマイズすることもできます。以下は、HyperPod タスクガバナンスが値に基づいてリソースを割り当てる方法のサンプルシナリオです。
+ **アクセラレータのみを指定** - HyperPod タスクガバナンスは、アクセラレータの値に基づいて、vCPU とメモリにデフォルトの比率を適用します。
+ **vCPU のみを指定** - HyperPod タスクガバナンスは比率を計算し、それをメモリに適用します。アクセラレータは 0 に設定されます。
+ **メモリのみを指定** - メモリ指定のワークロードを実行するにはコンピューティングリソースが必要であるため、HyperPod タスクガバナンスは比率を計算し、それを vCPU に適用します。アクセラレータは 0 に設定されます。

クォータ割り当てをプログラムで制御するには、[ ComputeQuotaResourceConfig](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_ComputeQuotaResourceConfig.html) オブジェクトを使用し、割り当てを整数で指定します。

```
{
    "ComputeQuotaConfig": {
        "ComputeQuotaResources": [{
            "InstanceType": "ml.g5.24xlarge",
            "Accelerators": "16",
            "vCpu": "200.0",
            "MemoryInGiB": "2.0"
        }]
    }
}
```

デフォルトを含む、割り当てられたすべての割り当てを確認するには、[ DescribeComputeQuota](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_DescribeComputeQuota.html) オペレーションを使用します。割り当てを更新するには、[UpdateComputeQuota](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_UpdateComputeQuota.html) オペレーションを使用します。

HyperPod CLI を使用してコンピューティングクォータを割り当てることもできます。HyperPod CLI の詳細については、「[Amazon EKS によってオーケストレーションされた SageMaker HyperPod クラスターでジョブを実行する](sagemaker-hyperpod-eks-run-jobs.md)」を参照してください。次の例は、HyperPod CLI を使用してコンピューティングクォータを設定する方法を説明しています。

```
hyp create hyp-pytorch-job --version 1.1 --job-name sample-job \
--image 123456789012.dkr.ecr.us-west-2.amazonaws.com/ptjob:latest \
--pull-policy "Always" \
--tasks-per-node 1 \
--max-retry 1 \
--priority high-priority \
--namespace hyperpod-ns-team-name \
--queue-name hyperpod-ns-team-name-localqueue \
--instance-type sample-instance-type \
--accelerators 1 \
--vcpu 3 \
--memory 1 \
--accelerators-limit 1 \
--vcpu-limit 4 \
--memory-limit 2
```

 AWS コンソールを使用してクォータを割り当てるには、次の手順に従います。

1. Amazon SageMaker AI コンソール ([https://console.aws.amazon.com/sagemaker/](https://console.aws.amazon.com/sagemaker/)) を開きます。

1. [HyperPod クラスター] で、**[クラスターの管理]** をクリックします。

1. **[コンピューティング割り当て]** で、**[作成]** をクリックします。

1. まだインスタンスがない場合は、**[割り当てを追加]** をクリックしてインスタンスを追加します。

1. **[割り当て]** で、インスタンスまたは個々のリソースごとの割り当てを選択します。個々のリソースで割り当てると、SageMaker AI は選択した比率に基づいて他のリソースに自動的に割り当てを行います。この比率に基づく割り当てを上書きするには、対応するトグルを使用してそのコンピューティングを上書きします。

1. ステップ 4 と 5 を繰り返して、追加のインスタンスを設定します。

コンピューティングクォータを割り当てたら、HyperPod CLI または `kubectl` を使用してジョブを送信できます。HyperPod は、利用可能なクォータに基づいてワークロードを効率的にスケジュールします。

# GPU パーティションクォータの割り当て
<a name="sagemaker-hyperpod-eks-operate-console-ui-governance-policies-compute-allocation-gpu-partitions"></a>

コンピューティングクォータの割り当てを拡張して GPU パーティショニングをサポートすることで、GPU パーティションレベルできめ細かなリソース共有が可能になります。クラスター内のサポートされている GPUs で GPU パーティショニングを有効にすると、各物理 GPU を、定義されたコンピューティング、メモリ、ストリーミングマルチプロセッサ割り当てを持つ複数の独立した GPUs にパーティショニングできます。GPU パーティショニングの詳細については、「」を参照してください[Amazon SageMaker HyperPod での GPU パーティションの使用 HyperPod](sagemaker-hyperpod-eks-gpu-partitioning.md)。特定の GPU パーティションをチームに割り当てることで、ハードウェアレベルの分離と予測可能なパフォーマンスを維持しながら、複数のチームが 1 つの GPU を共有できます。

例えば、8 つの H100 GPUs を持つ ml.p5.48xlarge インスタンスは GPU パーティションに分割でき、タスク要件に基づいて個々のパーティションを異なるチームに割り当てることができます。GPU パーティション割り当てを指定すると、HyperPod タスクガバナンスは GPU レベルの割り当てと同様に、GPU パーティションに基づいて比例 vCPU クォータとメモリクォータを計算します。このアプローチは、アイドル容量を排除し、同じ物理 GPU 上の複数の同時タスク間で費用対効果の高いリソース共有を可能にすることで、GPU 使用率を最大化します。

## コンピューティングクォータの作成
<a name="sagemaker-hyperpod-eks-operate-console-ui-governance-policies-compute-allocation-gpu-partitions-creating"></a>

```
aws sagemaker create-compute-quota \
  --name "fractional-gpu-quota" \
  --compute-quota-config '{
    "ComputeQuotaResources": [
      {
        "InstanceType": "ml.p4d.24xlarge",
        "AcceleratorPartition": {
            "Count": 4,
            "Type": "mig-1g.5gb"
        }
      }
    ],
    "ResourceSharingConfig": { 
      "Strategy": "LendAndBorrow", 
      "BorrowLimit": 100 
    }
  }'
```

## クォータリソースの検証
<a name="sagemaker-hyperpod-eks-operate-console-ui-governance-policies-compute-allocation-gpu-partitions-verifying"></a>

```
# Check ClusterQueue
kubectl get clusterqueues
kubectl describe clusterqueue QUEUE_NAME

# Check ResourceFlavors
kubectl get resourceflavor
kubectl describe resourceflavor FLAVOR_NAME
```

# HyperPod タスクガバナンス AWS CLI コマンドの例
<a name="sagemaker-hyperpod-eks-operate-console-ui-governance-cli"></a>

HyperPod は、Kubectl または HyperPod カスタム CLI を介して EKS で使用できます。これらのコマンドは Studio または から使用できます AWS CLI。以下に、HyperPod コマンドを使用してクラスターの詳細を表示する方法に関する SageMaker HyperPod AWS CLI タスクガバナンスの例を示します。インストール方法などの詳細については、「[HyperPod CLI Github リポジトリ](https://github.com/aws/sagemaker-hyperpod-cli)」を参照してください。

**Topics**
+ [

## クラスターアクセラレーターデバイスのクォータ情報を取得する
](#hp-eks-cli-get-clusters)
+ [

## SageMaker AI マネージドキューと名前空間にジョブを送信する
](#hp-eks-cli-start-job)
+ [

## ジョブの一覧表示
](#hp-eks-cli-list-jobs)
+ [

## ジョブの詳細情報を取得する
](#hp-eks-cli-get-job)
+ [

## ジョブの停止と停止解除
](#hp-eks-cli-patch-job)
+ [

## ジョブのデバッグ
](#hp-eks-cli-other)

## クラスターアクセラレーターデバイスのクォータ情報を取得する
<a name="hp-eks-cli-get-clusters"></a>

以下のコマンド例は、クラスタアクセラレータのデバイスクォータに関する情報を取得します。

```
hyperpod get-clusters -n hyperpod-ns-test-team
```

この例の名前空間 `hyperpod-ns-test-team` は、コンピューティング割り当ての作成時に指定されたチーム名 `test-team` に基づいて Kubernetes に作成されます。詳細については、「[ポリシーを編集する](sagemaker-hyperpod-eks-operate-console-ui-governance-policies-edit.md)」を参照してください。

レスポンスの例:

```
[
    {
        "Cluster": "hyperpod-eks-test-cluster-id",
        "InstanceType": "ml.g5.xlarge",
        "TotalNodes": 2,
        "AcceleratorDevicesAvailable": 1,
        "NodeHealthStatus=Schedulable": 2,
        "DeepHealthCheckStatus=Passed": "N/A",
        "Namespaces": {
            "hyperpod-ns-test-team": {
                "TotalAcceleratorDevices": 1,
                "AvailableAcceleratorDevices": 1
            }
        }
    }
]
```

## SageMaker AI マネージドキューと名前空間にジョブを送信する
<a name="hp-eks-cli-start-job"></a>

次のコマンド例では、HyperPod クラスターにジョブを送信します。1 つのチームにのみアクセスできる場合、HyperPod AWS CLI は自動的にキューを割り当てます。それ以外の場合は、複数のキューが検出されると、選択可能なすべてのオプションが表示されます。

```
hyperpod start-job --job-name hyperpod-cli-test --job-kind kubeflow/PyTorchJob --image docker.io/kubeflowkatib/pytorch-mnist-cpu:v1beta1-bc09cfd --entry-script /opt/pytorch-mnist/mnist.py --pull-policy IfNotPresent --instance-type ml.g5.xlarge --node-count 1 --tasks-per-node 1 --results-dir ./result --priority training-priority
```

優先度クラスは、タスクの優先順位付けとアイドル状態のコンピューティング割り当て方法を定義する**クラスターポリシー**で定義されます。データサイエンティストがジョブを送信すると、優先クラス名のいずれかを `priority-class-name-priority` 形式で使用します。この例では、`training-priority` は「トレーニング」という名前の優先クラスを参照します。ポリシーの概念の詳細については、「[ポリシー](sagemaker-hyperpod-eks-operate-console-ui-governance-policies.md)」を参照してください。

優先クラスが指定されていない場合、ジョブは優先度の低いジョブとして扱われ、タスクランキング値は 0 です。

優先クラスが指定されていても、**[クラスターポリシー]** で定義されている優先クラスの 1 つに対応していない場合、送信は失敗し、エラーメッセージは定義された優先クラスのセットを提供します。

以下のコマンドを使用し、YAML 設定ファイルを使用してジョブを送信することもできます。

```
hyperpod start-job --config-file ./yaml-configuration-file-name.yaml
```

以下は、上記のジョブの送信と同等の YAML 設定ファイルの例です。

```
defaults:
  - override hydra/job_logging: stdout
hydra:
  run:
    dir: .
  output_subdir: null
training_cfg:
  entry_script: /opt/pytorch-mnist/mnist.py
  script_args: []
  run:
    name: hyperpod-cli-test
    nodes: 1
    ntasks_per_node: 1
cluster:
  cluster_type: k8s
  instance_type: ml.g5.xlarge
  custom_labels:
    kueue.x-k8s.io/priority-class: training-priority
  cluster_config:
    label_selector:
      required:
        sagemaker.amazonaws.com/node-health-status:
          - Schedulable
      preferred:
        sagemaker.amazonaws.com/deep-health-check-status:
          - Passed
      weights:
        - 100
    pullPolicy: IfNotPresent
base_results_dir: ./result
container: docker.io/kubeflowkatib/pytorch-mnist-cpu:v1beta1-bc09cfd
env_vars:
  NCCL_DEBUG: INFO
```

または、`kubectl` を使用してジョブを送信し、タスクが **[ダッシュボード]** タブに表示されるようにすることもできます。以下は、kubectl コマンドの例です。

```
kubectl apply -f ./yaml-configuration-file-name.yaml
```

ジョブを送信する際は、キュー名と優先クラスラベルを含めます。例えば、キュー名 `hyperpod-ns-team-name-localqueue` と優先クラス `priority-class-name-priority` では、次のラベルを含める必要があります。
+ `kueue.x-k8s.io/queue-name: hyperpod-ns-team-name-localqueue` 
+ `kueue.x-k8s.io/priority-class: priority-class-name-priority`

次の YAML 設定スニペットは、元の設定ファイルにラベルを追加して、タスクが **[ダッシュボード]** タブに表示されるようにする方法を示しています。

```
metadata:
    name: job-name
    namespace: hyperpod-ns-team-name
    labels:
        kueue.x-k8s.io/queue-name: hyperpod-ns-team-name-localqueue
        kueue.x-k8s.io/priority-class: priority-class-name-priority
```

## ジョブの一覧表示
<a name="hp-eks-cli-list-jobs"></a>

次のコマンドは、ジョブとその詳細を一覧表示します。

```
hyperpod list-jobs
```

レスポンスの例:

```
{
    "jobs": [
        {
            "Name": "hyperpod-cli-test",
            "Namespace": "hyperpod-ns-test-team",
            "CreationTime": "2024-11-18T21:21:15Z",
            "Priority": "training",
            "State": "Succeeded"
        }
    ]
}
```

## ジョブの詳細情報を取得する
<a name="hp-eks-cli-get-job"></a>

次のコマンドは、ジョブの詳細を提供します。名前空間が指定されていない場合、HyperPod AWS CLI はアクセスできる SageMaker AI によって管理される名前空間を取得します。

```
hyperpod get-job --job-name hyperpod-cli-test
```

レスポンスの例:

```
{
    "Name": "hyperpod-cli-test",
    "Namespace": "hyperpod-ns-test-team",
    "Label": {
        "app": "hyperpod-cli-test",
        "app.kubernetes.io/managed-by": "Helm",
        "kueue.x-k8s.io/priority-class": "training"
    },
    "CreationTimestamp": "2024-11-18T21:21:15Z",
    "Status": {
        "completionTime": "2024-11-18T21:25:24Z",
        "conditions": [
            {
                "lastTransitionTime": "2024-11-18T21:21:15Z",
                "lastUpdateTime": "2024-11-18T21:21:15Z",
                "message": "PyTorchJob hyperpod-cli-test is created.",
                "reason": "PyTorchJobCreated",
                "status": "True",
                "type": "Created"
            },
            {
                "lastTransitionTime": "2024-11-18T21:21:17Z",
                "lastUpdateTime": "2024-11-18T21:21:17Z",
                "message": "PyTorchJob hyperpod-ns-test-team/hyperpod-cli-test is running.",
                "reason": "PyTorchJobRunning",
                "status": "False",
                "type": "Running"
            },
            {
                "lastTransitionTime": "2024-11-18T21:25:24Z",
                "lastUpdateTime": "2024-11-18T21:25:24Z",
                "message": "PyTorchJob hyperpod-ns-test-team/hyperpod-cli-test successfully completed.",
                "reason": "PyTorchJobSucceeded",
                "status": "True",
                "type": "Succeeded"
            }
        ],
            "replicaStatuses": {
                "Worker": {
                    "selector": "training.kubeflow.org/job-name=hyperpod-cli-test,training.kubeflow.org/operator-name=pytorchjob-controller,training.kubeflow.org/replica-type=worker",
                    "succeeded": 1
                }
            },
        "startTime": "2024-11-18T21:21:15Z"
    },
    "ConsoleURL": "https://us-west-2.console.aws.amazon.com/sagemaker/home?region=us-west-2#/cluster-management/hyperpod-eks-test-cluster-id“
}
```

## ジョブの停止と停止解除
<a name="hp-eks-cli-patch-job"></a>

送信されたジョブの一部をスケジューラから削除する場合には、HyperPod AWS CLI はオーケストレーションからジョブを一時的に削除する `suspend` コマンドを提供しています。`unsuspend` コマンドによってジョブが手動で停止解除されない限り、停止されたジョブはスケジュールされなくなります。

ジョブを一時的に停止するには:

```
hyperpod patch-job suspend --job-name hyperpod-cli-test
```

ジョブをキューに戻すには:

```
hyperpod patch-job unsuspend --job-name hyperpod-cli-test
```

## ジョブのデバッグ
<a name="hp-eks-cli-other"></a>

HyperPod AWS CLI には、ジョブ送信の問題をデバッグするための他のコマンドも用意されています。例えば、HyperPod AWS CLI Github リポジトリ`get-logs`の `list-pods`と です。

# トラブルシューティング
<a name="sagemaker-hyperpod-eks-operate-console-ui-governance-troubleshoot"></a>

次のページには、HyperPod EKS クラスターのトラブルシューティングに関する既知のソリューションが記載されています。

**Topics**
+ [

## [Dashboard] (ダッシュボード) タブ
](#hp-eks-troubleshoot-dashboard)
+ [

## タスクタブ
](#hp-eks-troubleshoot-tasks)
+ [

## ポリシー
](#hp-eks-troubleshoot-policies)
+ [

## クラスターの削除
](#hp-eks-troubleshoot-delete-policies)
+ [

## 未割り当てのリソース共有
](#hp-eks-troubleshoot-unallocated-resource-sharing)

## [Dashboard] (ダッシュボード) タブ
<a name="hp-eks-troubleshoot-dashboard"></a>

**EKS アドオンのインストールに失敗しました**

EKS アドオンのインストールを正常に完了するには、Kubernetes バージョン 1.30 以降が必要です。更新するには、「[Kubernetes バージョンを更新する](https://docs.aws.amazon.com/eks/latest/userguide/update-cluster.html)」を参照してください。

EKS アドオンのインストールを正常に完了するには、すべてのノードが **[準備完了]** ステータスで、すべてのポッドが **[実行中]** ステータスである必要があります。

ノードのステータスを確認するには、 [https://docs.aws.amazon.com/cli/latest/reference/sagemaker/list-cluster-nodes.html](https://docs.aws.amazon.com/cli/latest/reference/sagemaker/list-cluster-nodes.html) AWS CLI コマンドを使用するか、EKS [コンソールで EKS](https://console.aws.amazon.com/eks/home#/clusters) クラスターに移動し、ノードのステータスを表示します。各ノードの問題を解決するか、管理者にお問い合わせください。ノードのステータスが **[不明]** の場合は、ノードを削除します。すべてのノードのステータスが **[準備完了]** になったら、[Amazon SageMaker AI コンソール](https://console.aws.amazon.com/sagemaker/)から HyperPod への EKS アドオンのインストールを再試行します。

ポッドのステータスを確認するには、[Kubernetes CLI](https://kubernetes.io/docs/reference/kubectl/) コマンド `kubectl get pods -n cloudwatch-agent` を使用するか、[EKS コンソール](https://console.aws.amazon.com/eks/home#/clusters)で EKS クラスターに移動し、名前空間 `cloudwatch-agent` を持つポッドのステータスを表示します。ポッドの問題を解決するか、管理者に連絡して問題を解決してください。すべてのポッドのステータスが **[実行中]** になったら、[Amazon SageMaker AI コンソール](https://console.aws.amazon.com/sagemaker/)から HyperPod への EKS アドオンのインストールを再試行します。

トラブルシューティングの詳細については、「[Amazon CloudWatch オブザーバビリティ EKS アドオンのトラブルシューティング](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/install-CloudWatch-Observability-EKS-addon.html#Container-Insights-setup-EKS-addon-troubleshoot)」を参照してください。

## タスクタブ
<a name="hp-eks-troubleshoot-tasks"></a>

**クラスターでカスタムリソース定義 (CRD) が設定されていない**というエラーメッセージが表示された場合は、ドメイン実行ロールに `EKSAdminViewPolicy` ポリシーと `ClusterAccessRole` ポリシーを付与します。
+ 実行ロールを取得する方法の詳細については、「[実行ロールを取得する](sagemaker-roles.md#sagemaker-roles-get-execution-role)」を参照してください。
+ IAM ユーザーまたはグループにポリシーをアタッチする方法については、「[IAM ID のアクセス許可の追加および削除](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_manage-attach-detach.html)」を参照してください。

## ポリシー
<a name="hp-eks-troubleshoot-policies"></a>

HyperPod API またはコンソールを使用したポリシー関連エラーのソリューション一覧は、以下のとおりです。
+ ポリシーのステータスが `CreateFailed` または `CreateRollbackFailed` の場合、失敗したポリシーを削除して新しいポリシーを作成する必要があります。
+ ポリシーのステータスが `UpdateFailed` の場合、同じポリシー ARN を使用して更新を再試行します。
+ ポリシーのステータスが `UpdateRollbackFailed` の場合、失敗したポリシーを削除して新しいポリシーを作成する必要があります。
+ ポリシーのステータスが `DeleteFailed` または `DeleteRollbackFailed` の場合、同じポリシー ARN を使用して削除を再試行します。
  + HyperPod コンソールを使用して**コンピューティング優先順位付け**またはクラスターポリシーを削除しようとしてエラーが発生した場合は、API を使用して `cluster-scheduler-config` を削除してみます。リソースのステータスを確認するには、コンピューティング割り当ての詳細ページに移動します。

失敗の詳細を確認するには、describe API を使用します。

## クラスターの削除
<a name="hp-eks-troubleshoot-delete-policies"></a>

クラスターの削除に関連するエラーの既知のソリューションは、以下のとおりです。
+ SageMaker HyperPod タスクガバナンスポリシーがアタッチされたためにクラスターの削除に失敗した場合、[ポリシーを削除する](sagemaker-hyperpod-eks-operate-console-ui-governance-policies-delete.md) が必要です。
+ 以下のアクセス許可がないためにクラスターの削除に失敗した場合、クラスター管理者のアクセス許可の最小限のセットを更新する必要があります。「[クラスター管理者の IAM ユーザー](sagemaker-hyperpod-prerequisites-iam.md#sagemaker-hyperpod-prerequisites-iam-cluster-admin)」セクションの **[Amazon EKS]** タブを参照してください。
  + `sagemaker:ListComputeQuotas`
  + `sagemaker:ListClusterSchedulerConfig`
  + `sagemaker:DeleteComputeQuota`
  + `sagemaker:DeleteClusterSchedulerConfig`

## 未割り当てのリソース共有
<a name="hp-eks-troubleshoot-unallocated-resource-sharing"></a>

未割り当てのリソースプール容量が想定よりも小さい場合:

1. **ノードの準備完了ステータスを確認する**

   ```
   kubectl get nodes
   ```

   STATUS 列にすべてのノード`Ready`のステータスが表示されていることを確認します。

1. **ノードのスケジュール可能なステータスを確認する**

   ```
   kubectl get nodes -o custom-columns=NAME:.metadata.name,UNSCHEDULABLE:.spec.unschedulable
   ```

   ノードに `<none>`または `false` ( ではなく) が表示されていることを確認します`true`。

1. **未割り当てのリソース共有 ClusterQueues を一覧表示します。**

   ```
   kubectl get clusterqueue | grep hyperpod-ns-idle-resource-sharing
   ```

   これにより、未割り当てのリソース共有 ClusterQueues がすべて表示されます。ClusterQueues が表示されない場合は、ClusterSchedulerConfig ポリシー`FailureReason`の で、デバッグを続行する失敗メッセージがあるかどうかを確認してください。

1. **未割り当てのリソース共有クォータを確認します。**

   ```
   kubectl describe clusterqueue hyperpod-ns-idle-resource-sharing-<index>
   ```

   `spec.resourceGroups[].flavors[].resources` セクションをチェックして、各リソースフレーバーに割り当てられたクォータを確認します。

   クラスター内のリソースフレーバーの数によっては、複数の未割り当てのリソース共有 ClusterQueues が存在する場合があります。

1. **MIG 設定ステータス (GPU ノード):**

   ```
   kubectl get nodes -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.metadata.labels.nvidia\.com/mig\.config\.state}{"\n"}{end}'
   ```

   MIG 対応ノード`success`の状態が表示されていることを確認します。

# Amazon SageMaker HyperPod タスクガバナンスの属性ドキュメント
<a name="sagemaker-hyperpod-eks-operate-console-ui-governance-attributions"></a>

以下では、Amazon SageMaker HyperPod タスクガバナンスで使用されるマテリアルの属性とサードパーティーライセンスについて説明します。

**Topics**
+ [

## [base-files](https://packages.debian.org/bookworm/base-files)
](#hp-eks-task-governance-attributions-base-files)
+ [

## [netbase](https://packages.debian.org/source/stable/netbase)
](#hp-eks-task-governance-attributions-netbase)
+ [

## [golang-lru](https://github.com/hashicorp/golang-lru)
](#hp-eks-task-governance-attributions-golang-lru)

## [base-files](https://packages.debian.org/bookworm/base-files)
<a name="hp-eks-task-governance-attributions-base-files"></a>

```
This is the Debian prepackaged version of the Debian Base System
Miscellaneous files. These files were written by Ian Murdock
<imurdock@debian.org> and Bruce Perens <bruce@pixar.com>.

This package was first put together by Bruce Perens <Bruce@Pixar.com>,
from his own sources.

The GNU Public Licenses in /usr/share/common-licenses were taken from
ftp.gnu.org and are copyrighted by the Free Software Foundation, Inc.

The Artistic License in /usr/share/common-licenses is the one coming
from Perl and its SPDX name is "Artistic License 1.0 (Perl)".


Copyright © 1995-2011 Software in the Public Interest.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

On Debian systems, the complete text of the GNU General
Public License can be found in `/usr/share/common-licenses/GPL'.
```

## [netbase](https://packages.debian.org/source/stable/netbase)
<a name="hp-eks-task-governance-attributions-netbase"></a>

```
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Comment:
 This package was created by Peter Tobias tobias@et-inf.fho-emden.de on
 Wed, 24 Aug 1994 21:33:28 +0200 and maintained by Anthony Towns
 <ajt@debian.org> until 2001.
 It is currently maintained by Marco d'Itri <md@linux.it>.

Files: *
Copyright:
 Copyright © 1994-1998 Peter Tobias
 Copyright © 1998-2001 Anthony Towns
 Copyright © 2002-2022 Marco d'Itri
License: GPL-2
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License, version 2, as
 published by the Free Software Foundation.
 .
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 .
 You should have received a copy of the GNU General Public License along
 with this program; if not, write to the Free Software Foundation,
 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 .
 On Debian systems, the complete text of the GNU General Public License
 version 2 can be found in '/usr/share/common-licenses/GPL-2'.
```

## [golang-lru](https://github.com/hashicorp/golang-lru)
<a name="hp-eks-task-governance-attributions-golang-lru"></a>

```
Copyright © 2014 HashiCorp, Inc.

Mozilla Public License, version 2.0

1. Definitions

1.1. "Contributor"

     means each individual or legal entity that creates, contributes to the
     creation of, or owns Covered Software.

1.2. "Contributor Version"

     means the combination of the Contributions of others (if any) used by a
     Contributor and that particular Contributor's Contribution.

1.3. "Contribution"

     means Covered Software of a particular Contributor.

1.4. "Covered Software"

     means Source Code Form to which the initial Contributor has attached the
     notice in Exhibit A, the Executable Form of such Source Code Form, and
     Modifications of such Source Code Form, in each case including portions
     thereof.

1.5. "Incompatible With Secondary Licenses"
     means

     a. that the initial Contributor has attached the notice described in
        Exhibit B to the Covered Software; or

     b. that the Covered Software was made available under the terms of
        version 1.1 or earlier of the License, but not also under the terms of
        a Secondary License.

1.6. "Executable Form"

     means any form of the work other than Source Code Form.

1.7. "Larger Work"

     means a work that combines Covered Software with other material, in a
     separate file or files, that is not Covered Software.

1.8. "License"

     means this document.

1.9. "Licensable"

     means having the right to grant, to the maximum extent possible, whether
     at the time of the initial grant or subsequently, any and all of the
     rights conveyed by this License.

1.10. "Modifications"

     means any of the following:

     a. any file in Source Code Form that results from an addition to,
        deletion from, or modification of the contents of Covered Software; or

     b. any new file in Source Code Form that contains any Covered Software.

1.11. "Patent Claims" of a Contributor

      means any patent claim(s), including without limitation, method,
      process, and apparatus claims, in any patent Licensable by such
      Contributor that would be infringed, but for the grant of the License,
      by the making, using, selling, offering for sale, having made, import,
      or transfer of either its Contributions or its Contributor Version.

1.12. "Secondary License"

      means either the GNU General Public License, Version 2.0, the GNU Lesser
      General Public License, Version 2.1, the GNU Affero General Public
      License, Version 3.0, or any later versions of those licenses.

1.13. "Source Code Form"

      means the form of the work preferred for making modifications.

1.14. "You" (or "Your")

      means an individual or a legal entity exercising rights under this
      License. For legal entities, "You" includes any entity that controls, is
      controlled by, or is under common control with You. For purposes of this
      definition, "control" means (a) the power, direct or indirect, to cause
      the direction or management of such entity, whether by contract or
      otherwise, or (b) ownership of more than fifty percent (50%) of the
      outstanding shares or beneficial ownership of such entity.


2. License Grants and Conditions

2.1. Grants

     Each Contributor hereby grants You a world-wide, royalty-free,
     non-exclusive license:

     a. under intellectual property rights (other than patent or trademark)
        Licensable by such Contributor to use, reproduce, make available,
        modify, display, perform, distribute, and otherwise exploit its
        Contributions, either on an unmodified basis, with Modifications, or
        as part of a Larger Work; and

     b. under Patent Claims of such Contributor to make, use, sell, offer for
        sale, have made, import, and otherwise transfer either its
        Contributions or its Contributor Version.

2.2. Effective Date

     The licenses granted in Section 2.1 with respect to any Contribution
     become effective for each Contribution on the date the Contributor first
     distributes such Contribution.

2.3. Limitations on Grant Scope

     The licenses granted in this Section 2 are the only rights granted under
     this License. No additional rights or licenses will be implied from the
     distribution or licensing of Covered Software under this License.
     Notwithstanding Section 2.1(b) above, no patent license is granted by a
     Contributor:

     a. for any code that a Contributor has removed from Covered Software; or

     b. for infringements caused by: (i) Your and any other third party's
        modifications of Covered Software, or (ii) the combination of its
        Contributions with other software (except as part of its Contributor
        Version); or

     c. under Patent Claims infringed by Covered Software in the absence of
        its Contributions.

     This License does not grant any rights in the trademarks, service marks,
     or logos of any Contributor (except as may be necessary to comply with
     the notice requirements in Section 3.4).

2.4. Subsequent Licenses

     No Contributor makes additional grants as a result of Your choice to
     distribute the Covered Software under a subsequent version of this
     License (see Section 10.2) or under the terms of a Secondary License (if
     permitted under the terms of Section 3.3).

2.5. Representation

     Each Contributor represents that the Contributor believes its
     Contributions are its original creation(s) or it has sufficient rights to
     grant the rights to its Contributions conveyed by this License.

2.6. Fair Use

     This License is not intended to limit any rights You have under
     applicable copyright doctrines of fair use, fair dealing, or other
     equivalents.

2.7. Conditions

     Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in
     Section 2.1.


3. Responsibilities

3.1. Distribution of Source Form

     All distribution of Covered Software in Source Code Form, including any
     Modifications that You create or to which You contribute, must be under
     the terms of this License. You must inform recipients that the Source
     Code Form of the Covered Software is governed by the terms of this
     License, and how they can obtain a copy of this License. You may not
     attempt to alter or restrict the recipients' rights in the Source Code
     Form.

3.2. Distribution of Executable Form

     If You distribute Covered Software in Executable Form then:

     a. such Covered Software must also be made available in Source Code Form,
        as described in Section 3.1, and You must inform recipients of the
        Executable Form how they can obtain a copy of such Source Code Form by
        reasonable means in a timely manner, at a charge no more than the cost
        of distribution to the recipient; and

     b. You may distribute such Executable Form under the terms of this
        License, or sublicense it under different terms, provided that the
        license for the Executable Form does not attempt to limit or alter the
        recipients' rights in the Source Code Form under this License.

3.3. Distribution of a Larger Work

     You may create and distribute a Larger Work under terms of Your choice,
     provided that You also comply with the requirements of this License for
     the Covered Software. If the Larger Work is a combination of Covered
     Software with a work governed by one or more Secondary Licenses, and the
     Covered Software is not Incompatible With Secondary Licenses, this
     License permits You to additionally distribute such Covered Software
     under the terms of such Secondary License(s), so that the recipient of
     the Larger Work may, at their option, further distribute the Covered
     Software under the terms of either this License or such Secondary
     License(s).

3.4. Notices

     You may not remove or alter the substance of any license notices
     (including copyright notices, patent notices, disclaimers of warranty, or
     limitations of liability) contained within the Source Code Form of the
     Covered Software, except that You may alter any license notices to the
     extent required to remedy known factual inaccuracies.

3.5. Application of Additional Terms

     You may choose to offer, and to charge a fee for, warranty, support,
     indemnity or liability obligations to one or more recipients of Covered
     Software. However, You may do so only on Your own behalf, and not on
     behalf of any Contributor. You must make it absolutely clear that any
     such warranty, support, indemnity, or liability obligation is offered by
     You alone, and You hereby agree to indemnify every Contributor for any
     liability incurred by such Contributor as a result of warranty, support,
     indemnity or liability terms You offer. You may include additional
     disclaimers of warranty and limitations of liability specific to any
     jurisdiction.

4. Inability to Comply Due to Statute or Regulation

   If it is impossible for You to comply with any of the terms of this License
   with respect to some or all of the Covered Software due to statute,
   judicial order, or regulation then You must: (a) comply with the terms of
   this License to the maximum extent possible; and (b) describe the
   limitations and the code they affect. Such description must be placed in a
   text file included with all distributions of the Covered Software under
   this License. Except to the extent prohibited by statute or regulation,
   such description must be sufficiently detailed for a recipient of ordinary
   skill to be able to understand it.

5. Termination

5.1. The rights granted under this License will terminate automatically if You
     fail to comply with any of its terms. However, if You become compliant,
     then the rights granted under this License from a particular Contributor
     are reinstated (a) provisionally, unless and until such Contributor
     explicitly and finally terminates Your grants, and (b) on an ongoing
     basis, if such Contributor fails to notify You of the non-compliance by
     some reasonable means prior to 60 days after You have come back into
     compliance. Moreover, Your grants from a particular Contributor are
     reinstated on an ongoing basis if such Contributor notifies You of the
     non-compliance by some reasonable means, this is the first time You have
     received notice of non-compliance with this License from such
     Contributor, and You become compliant prior to 30 days after Your receipt
     of the notice.

5.2. If You initiate litigation against any entity by asserting a patent
     infringement claim (excluding declaratory judgment actions,
     counter-claims, and cross-claims) alleging that a Contributor Version
     directly or indirectly infringes any patent, then the rights granted to
     You by any and all Contributors for the Covered Software under Section
     2.1 of this License shall terminate.

5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user
     license agreements (excluding distributors and resellers) which have been
     validly granted by You or Your distributors under this License prior to
     termination shall survive termination.

6. Disclaimer of Warranty

   Covered Software is provided under this License on an "as is" basis,
   without warranty of any kind, either expressed, implied, or statutory,
   including, without limitation, warranties that the Covered Software is free
   of defects, merchantable, fit for a particular purpose or non-infringing.
   The entire risk as to the quality and performance of the Covered Software
   is with You. Should any Covered Software prove defective in any respect,
   You (not any Contributor) assume the cost of any necessary servicing,
   repair, or correction. This disclaimer of warranty constitutes an essential
   part of this License. No use of  any Covered Software is authorized under
   this License except under this disclaimer.

7. Limitation of Liability

   Under no circumstances and under no legal theory, whether tort (including
   negligence), contract, or otherwise, shall any Contributor, or anyone who
   distributes Covered Software as permitted above, be liable to You for any
   direct, indirect, special, incidental, or consequential damages of any
   character including, without limitation, damages for lost profits, loss of
   goodwill, work stoppage, computer failure or malfunction, or any and all
   other commercial damages or losses, even if such party shall have been
   informed of the possibility of such damages. This limitation of liability
   shall not apply to liability for death or personal injury resulting from
   such party's negligence to the extent applicable law prohibits such
   limitation. Some jurisdictions do not allow the exclusion or limitation of
   incidental or consequential damages, so this exclusion and limitation may
   not apply to You.

8. Litigation

   Any litigation relating to this License may be brought only in the courts
   of a jurisdiction where the defendant maintains its principal place of
   business and such litigation shall be governed by laws of that
   jurisdiction, without reference to its conflict-of-law provisions. Nothing
   in this Section shall prevent a party's ability to bring cross-claims or
   counter-claims.

9. Miscellaneous

   This License represents the complete agreement concerning the subject
   matter hereof. If any provision of this License is held to be
   unenforceable, such provision shall be reformed only to the extent
   necessary to make it enforceable. Any law or regulation which provides that
   the language of a contract shall be construed against the drafter shall not
   be used to construe this License against a Contributor.


10. Versions of the License

10.1. New Versions

      Mozilla Foundation is the license steward. Except as provided in Section
      10.3, no one other than the license steward has the right to modify or
      publish new versions of this License. Each version will be given a
      distinguishing version number.

10.2. Effect of New Versions

      You may distribute the Covered Software under the terms of the version
      of the License under which You originally received the Covered Software,
      or under the terms of any subsequent version published by the license
      steward.

10.3. Modified Versions

      If you create software not governed by this License, and you want to
      create a new license for such software, you may create and use a
      modified version of this License if you rename the license and remove
      any references to the name of the license steward (except to note that
      such modified license differs from this License).

10.4. Distributing Source Code Form that is Incompatible With Secondary
      Licenses If You choose to distribute Source Code Form that is
      Incompatible With Secondary Licenses under the terms of this version of
      the License, the notice described in Exhibit B of this License must be
      attached.

Exhibit A - Source Code Form License Notice

      This Source Code Form is subject to the
      terms of the Mozilla Public License, v.
      2.0. If a copy of the MPL was not
      distributed with this file, You can
      obtain one at
      http://mozilla.org/MPL/2.0/.

If it is not possible or desirable to put the notice in a particular file,
then You may include the notice in a location (such as a LICENSE file in a
relevant directory) where a recipient would be likely to look for such a
notice.

You may add additional accurate notices of copyright ownership.

Exhibit B - "Incompatible With Secondary Licenses" Notice

      This Source Code Form is "Incompatible
      With Secondary Licenses", as defined by
      the Mozilla Public License, v. 2.0.
```