쿠키 기본 설정 선택

당사는 사이트와 서비스를 제공하는 데 필요한 필수 쿠키 및 유사한 도구를 사용합니다. 고객이 사이트를 어떻게 사용하는지 파악하고 개선할 수 있도록 성능 쿠키를 사용해 익명의 통계를 수집합니다. 필수 쿠키는 비활성화할 수 없지만 '사용자 지정' 또는 ‘거부’를 클릭하여 성능 쿠키를 거부할 수 있습니다.

사용자가 동의하는 경우 AWS와 승인된 제3자도 쿠키를 사용하여 유용한 사이트 기능을 제공하고, 사용자의 기본 설정을 기억하고, 관련 광고를 비롯한 관련 콘텐츠를 표시합니다. 필수가 아닌 모든 쿠키를 수락하거나 거부하려면 ‘수락’ 또는 ‘거부’를 클릭하세요. 더 자세한 내용을 선택하려면 ‘사용자 정의’를 클릭하세요.

추적 엔터티 수동 생성

포커스 모드
추적 엔터티 수동 생성 - Amazon SageMaker AI

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

원하는 속성에 대해 수동으로 추적 엔터티를 만들어 모델 거버넌스를 설정하고, 워크플로를 재현하고, 작업 기록을 유지할 수 있습니다. Amazon SageMaker AI가 자동으로 생성하는 추적 엔터티에 대한 자세한 내용은 섹션을 참조하세요Amazon SageMaker AI 생성 추적 엔터티. 다음 자습서에서는 SageMaker 훈련 작업과 엔드포인트 간에 아티팩트를 수동으로 만들고 연결한 다음 워크플로를 추적하는 데 필요한 단계를 보여줍니다.

연결을 제외한 모든 엔터티에 태그를 추가할 수 있습니다. 태그는 사용자 지정 정보를 제공하는 임의의 키-값 쌍입니다. 목록 또는 검색 쿼리를 태그별로 필터링하거나 정렬할 수 있습니다. 자세한 내용은의 AWS 리소스 태그 지정을 참조하세요AWS 일반 참조.

계보 개체를 생성하는 방법을 보여주는 샘플 노트북은 Amazon SageMaker 예제 GitHub 리포지토리의 Amazon SageMaker AI 계보 노트북을 참조하세요. Amazon SageMaker GitHub

엔터티 수동 생성

다음 절차에서는 SageMaker AI 훈련 작업과 엔드포인트 간에 아티팩트를 생성하고 연결하는 방법을 보여줍니다. 다음 절차를 수행합니다.

추적 엔터티 및 연결 가져오기
  1. 계보 추적 엔터티를 가져옵니다.

    import sys !{sys.executable} -m pip install -q sagemaker from sagemaker import get_execution_role from sagemaker.session import Session from sagemaker.lineage import context, artifact, association, action import boto3 boto_session = boto3.Session(region_name=region) sagemaker_client = boto_session.client("sagemaker")
  2. 입력 및 출력 아티팩트 생성

    code_location_arn = artifact.Artifact.create( artifact_name='source-code-location', source_uri='s3://...', artifact_type='code-location' ).artifact_arn # Similar constructs for train_data_location_arn and test_data_location_arn model_location_arn = artifact.Artifact.create( artifact_name='model-location', source_uri='s3://...', artifact_type='model-location' ).artifact_arn
  3. 모델을 훈련시키고 훈련 작업을 나타내는 trial_component_arn을 가져옵니다.

  4. 입력 아티팩트와 출력 아티팩트를 훈련 작업(시험 구성 요소)에 연결합니다.

    input_artifacts = [code_location_arn, train_data_location_arn, test_data_location_arn] for artifact_arn in input_artifacts: try: association.Association.create( source_arn=artifact_arn, destination_arn=trial_component_arn, association_type='ContributedTo' ) except: logging.info('association between {} and {} already exists', artifact_arn, trial_component_arn) output_artifacts = [model_location_arn] for artifact_arn in output_artifacts: try: association.Association.create( source_arn=trial_component_arn, destination_arn=artifact_arn, association_type='Produced' ) except: logging.info('association between {} and {} already exists', artifact_arn, trial_component_arn)
  5. 추론 엔드포인트를 생성합니다.

    predictor = mnist_estimator.deploy(initial_instance_count=1, instance_type='ml.m4.xlarge')
  6. 엔드포인트 컨텍스트를 생성합니다.

    from sagemaker.lineage import context endpoint = sagemaker_client.describe_endpoint(EndpointName=predictor.endpoint_name) endpoint_arn = endpoint['EndpointArn'] endpoint_context_arn = context.Context.create( context_name=predictor.endpoint_name, context_type='Endpoint', source_uri=endpoint_arn ).context_arn
  7. 훈련 작업(시험 구성 요소)과 엔드포인트 컨텍스트를 연결합니다.

    association.Association.create( source_arn=trial_component_arn, destination_arn=endpoint_context_arn )

워크플로 수동 추적

이전 섹션에서 생성한 워크플로를 수동으로 추적할 수 있습니다.

이전 예시의 엔드포인트 Amazon 리소스 이름(ARN)을 고려하여 다음 절차는 엔드포인트에 배포된 모델을 훈련시키는 데 사용된 데이터세트로 워크플로를 추적하는 방법을 보여줍니다. 다음 절차를 수행합니다.

엔드포인트에서 훈련 데이터 원본까지의 워크플로를 추적하려면
  1. 추적 엔터티를 가져옵니다.

    import sys !{sys.executable} -m pip install -q sagemaker from sagemaker import get_execution_role from sagemaker.session import Session from sagemaker.lineage import context, artifact, association, action import boto3 boto_session = boto3.Session(region_name=region) sagemaker_client = boto_session.client("sagemaker")
  2. 엔드포인트 ARN에서 엔드포인트 컨텍스트를 가져옵니다.

    endpoint_context_arn = sagemaker_client.list_contexts( SourceUri=endpoint_arn)['ContextSummaries'][0]['ContextArn']
  3. 시험 구성 요소와 엔드포인트 컨텍스트 간의 연결을 통해 시험 구성 요소를 가져옵니다.

    trial_component_arn = sagemaker_client.list_associations( DestinationArn=endpoint_context_arn)['AssociationSummaries'][0]['SourceArn']
  4. 시험 구성 요소와 엔드포인트 컨텍스트 간의 연결에서 훈련 데이터 위치 아티팩트를 가져옵니다.

    train_data_location_artifact_arn = sagemaker_client.list_associations( DestinationArn=trial_component_arn, SourceType='Model')['AssociationSummaries'][0]['SourceArn']
  5. 훈련 데이터 위치 아티팩트에서 훈련 데이터 위치를 가져옵니다.

    train_data_location = sagemaker_client.describe_artifact( ArtifactArn=train_data_location_artifact_arn)['Source']['SourceUri'] print(train_data_location)

    응답:

    s3://sagemaker-sample-data-us-east-2/mxnet/mnist/train

Limits

다음을 제외한 모든 엔터티, 실험 및 계보 간에 연결을 만들 수 있습니다.

  • 두 실험 엔터티 간에는 연결을 만들 수 없습니다. 실험 엔터티는 실험, 시험 및 시험 구성 요소로 구성됩니다.

  • 다른 연결을 사용하여 연결을 만들 수 있습니다.

이미 존재하는 엔터티를 생성하려고 하면 오류가 발생합니다.

수동으로 생성된 계보 엔터티의 최대 수
  • 작업: 3000

  • 아티팩트: 6000

  • 연결: 6000

  • 컨텍스트: 500

Amazon SageMaker AI에서 자동으로 생성되는 계보 개체 수에는 제한이 없습니다.

프라이버시사이트 이용 약관쿠키 기본 설정
© 2025, Amazon Web Services, Inc. 또는 계열사. All rights reserved.