0

I have a Sagemaker pipeline which has few steps - I am interested in the "HPO" step.

enter image description here

HPO represents the Hyperparameter tuning job. Is there a way to get the list of hyperparameter parameters in this HPO step of the Sagemaker pipeline? I have the Arn of the pipeline and I did this

import boto3
from botocore.config import Config

config = Config(retries=dict(max_attempts=20))
client_ = boto3.client('sagemaker',config=config)
client_.list_pipeline_execution_steps( PipelineExecutionArn='arn:aws:sagemaker:us-east-1:111111111111:pipeline/<pipelinename>/execution/xxxxxxxxxxxxxxxxx')

I get this...

{'PipelineExecutionSteps': [{'StepName': 'Final-Fit', 'StartTime': datetime.datetime(2022, 6, 15, 18, 13, 27, 969000, tzinfo=tzlocal()), 'EndTime': datetime.datetime(2022, 6, 15, 18, 18, 4, 528000, tzinfo=tzlocal()), 'StepStatus': 'Succeeded', 'AttemptCount': 0, 'Metadata': {'ProcessingJob': {'Arn': 'arn:aws:sagemaker:us-east-1:111111111111:processing-job/pipelines-xxxxxxxxxxx-final-fit-yyyyyyyyy'}}},

{'StepName': 'HPO', 'StartTime': datetime.datetime(2022, 6, 15, 15, 43, 34, 11000, tzinfo=tzlocal()), 'EndTime': datetime.datetime(2022, 6, 15, 18, 13, 27, 333000, tzinfo=tzlocal()), 'StepStatus': 'Succeeded', 'AttemptCount': 0, 'Metadata': {'TuningJob': {'Arn': 'arn:aws:sagemaker:us-east-1:111111111111:hyper-parameter-tuning-job/xxxxxxxxxx-hpo-zzzzzzzzz'}}},

Now I would like to list all the parameters used in 'StepName': 'HPO' which has an Arn : 'TuningJob': {'Arn': 'arn:aws:sagemaker:us-east-1:111111111111:hyper-parameter-tuning-job/xxxxxxxxxx-hpo-zzzzzzzzz'}

How do I get all the details about this TuningJob/Stepname=HPO ?

What function should I use?

NDS
  • 119
  • 13

1 Answers1

0

Yayyy! I found the answer.

The HPO step's Arn is this: 'Arn': 'arn:aws:sagemaker:us-east-1:111111111111:hyper-parameter-tuning-job/xxxxxxxxxx-hpo-zzzzzzzzz'

I took the last part, which is: xxxxxxxxxx-hpo-zzzzzzzzz

Then I used this function to get all the parameters:

stepresponse1 = client_.list_training_jobs_for_hyper_parameter_tuning_job( HyperParameterTuningJobName ='xxxxxxxxxx-hpo-zzzzzzzzz')
NDS
  • 119
  • 13