Amazon SageMaker パイプラインの実行が失敗するのはなぜですか?

所要時間1分
0

Amazon SageMaker パイプラインの実行が失敗した原因をトラブルシューティングしたいと考えています。

解決方法

SageMaker で失敗したパイプラインの実行をトラブルシューティングするには、次の操作を行います。

注: AWS CLI コマンドの実行時にエラーが発生した場合は、AWS CLI の最新バージョンを使用していることを確認してください

1.    AWS コマンドラインインターフェイス (AWS CLI) のコマンド list-pipeline-executions を実行します。

注: ローカルマシンに AWS CLI が設定されていない場合は、AWS CloudShell コンソールを使用してください。

$ aws sagemaker list-pipeline-executions --pipeline-name test-pipeline-p-wzx9cplzrvdk

このコマンドは、お使いのパイプラインの次のようなパイプライン実行リストを返します。

"PipelineExecutionSummaries": [
        {
            "PipelineExecutionArn": "arn:aws:sagemaker:eu-west-1:1111222233334444:pipeline/test-pipeline-p-wzx9cplzrvdk/execution/lvejn1jl827b",
            "StartTime": "2022-09-27T12:56:44.646000+00:00",
            "PipelineExecutionStatus": "Failed",
            "PipelineExecutionDisplayName": "execution-1664283404791",
            "PipelineExecutionFailureReason": "Step failure: One or multiple steps failed."
        },
        {
            "PipelineExecutionArn": "arn:aws:sagemaker:eu-west-1:1111222233334444:pipeline/test-pipeline-p-wzx9cplzrvdk/execution/acvref9y1f47",
            "StartTime": "2022-09-27T12:13:28.762000+00:00",
            "PipelineExecutionStatus": "Succeeded",
            "PipelineExecutionDisplayName": "execution-1664280808943"
        }
    ]
}

2.    次のように、list-pipeline-executions-steps コマンドを実行して、失敗したステップを表示します。

$ aws sagemaker list-pipeline-execution-steps --pipeline-execution-arn arn:aws:sagemaker:eu-west-1:1111222233334444:pipeline/test-pipeline-p-wzx9cplzrvdk/execution/lvejn1jl827b

出力は次のようになります。

{
    "PipelineExecutionSteps": [
        {
            "StepName": "TrainAbaloneModel",
            "StartTime": "2022-09-27T13:00:49.235000+00:00",
            "EndTime": "2022-09-27T13:01:50.056000+00:00",
            "StepStatus": "Failed",
            "AttemptCount": 0,
            "FailureReason": "ClientError: ClientError: Please ensure the security group provided is valid",
            "Metadata": {
                "TrainingJob": {
                    "Arn": "arn:aws:sagemaker:eu-west-1:1111222233334444:training-job/pipelines-lvejn1jl827b-trainabalonemodel-u9l9wjassg"
                }
            }
        },
        {
            "StepName": "PreprocessAbaloneData",
            "StartTime": "2022-09-27T12:56:45.595000+00:00",
            "EndTime": "2022-09-27T13:00:48.638000+00:00",
            "StepStatus": "Succeeded",
            "AttemptCount": 0,
            "Metadata": {
                "ProcessingJob": {
                    "Arn": "arn:aws:sagemaker:eu-west-1:1111222233334444:processing-job/pipelines-lvejn1jl827b-preprocessabalonedat-6axq0kthyg"
                }
            }
        }
    ]
}

この場合、ジョブの VpcConfig オブジェクトに存在しないセキュリティグループが指定されていたため、トレーニングジョブステップが失敗しました。

失敗したステップの FailureReason が明確でない場合は、Amazon CloudWatch Logs で失敗した SageMaker ジョブまたはエンドポイントを確認して、さらにトラブルシューティングを行います。トレーニングジョブのログは CloudWatch ロググループ /aws/sagemaker/TrainingJobs で確認できます。ログストリームは次のようになります。

example-training-job-name/algo-example-instance-number-in-cluster-example-epoch-timestamp


関連情報

Amazon CloudWatch で Amazon SageMaker イベントのログを記録する

AWS公式
AWS公式更新しました 2年前
コメントはありません