Data Privacy in Amazon SageMaker AI
Amazon SageMaker AI collects aggregate information about the use of AWS-owned and open source libraries used during training. SageMaker AI uses this aggregate metadata to improve services and customer experience.
The following sections provide explanations for the type of metadata that SageMaker AI collects and how to opt out of metadata collection.
Types of information collected
- Usage Information
-
Metadata from AWS-owned and open source libraries that are used with SageMaker training, such as those used for distributed training, compilation, and quantization.
- Errors
-
Errors from unexpected behavior including failures, crashes, cascades, and failures that result from interacting with the SageMaker training platform.
How to opt out of metadata collection
You can opt out of sharing aggregated metadata with SageMaker training when creating a
training job using the CreateTrainingJob API. If you are using the console
to create training jobs, metadata collection is disabled by default.
You must choose to opt out of metadata collection for each training job that you submit. You must also choose to opt out in an API call as shown in the following examples. You cannot choose to opt out inside a training script.
The following section shows how you can opt out of metadata collection using the AWS CLI, AWS SDK for Python (Boto3), or the SageMaker Python SDK.
Opt out of metadata collection using the AWS Command Line Interface (AWS CLI)
To opt out of metadata collection using the AWS CLI, set the environment variable
OPT_OUT_TRACKING to 1 in the
create-training-job API as shown in the following code
example.
aws sagemaker create-training-job \ --training-job-nameyour_job_name\ --algorithm-specification AlgorithmName=your_algorithm_name\ --output-data-config S3OutputPath=s3://bucket-name/key-name-prefix\ --resource-config InstanceType=ml.c5.xlarge, InstanceCount=1\ --stopping-condition MaxRuntimeInSeconds=100\ --environment OPT_OUT_TRACKING=1
Opt out of metadata collection using the AWS SDK for Python (Boto3)
To opt out of metadata collection using the SDK for Python (Boto3), set the environment
variable OPT_OUT_TRACKING to 1 in the
create_training_job API as shown in the following code
example.
boto3.client('sagemaker').create_training_job( TrainingJobName='your_training_job', AlgorithmSpecification={ 'AlgorithmName': 'your_algorithm_name', 'TrainingInputMode': 'File', }, RoleArn='your_arn', OutputDataConfig={ 'S3OutputPath': 's3://bucket-name/key-name-prefix', }, ResourceConfig={ 'InstanceType': 'ml.m4.xlarge', 'InstanceCount':1, 'VolumeSizeInGB':123, }, StoppingCondition={ 'MaxRuntimeInSeconds':123, }, Environment={ 'OPT_OUT_TRACKING': '1' }, )
Opt out of metadata collection using the SageMaker Python SDK
To opt out of metadata collection using the SageMaker Python SDK, set the environment
variable OPT_OUT_TRACKING to 1 inside a SageMaker AI ModelTrainer as
shown in the following code example.
sagemaker.train.ModelTrainer( image_uri='path_to_container', role='rolearn', instance_count=1, instance_type='ml.c5.xlarge', environment={ 'OPT_OUT_TRACKING': '1' }, )
Opt out of metadata collection account-wide
If you want to opt-out of metadata collection for several accounts, you can set an environment variable to opt-out of tracking account-wide. You must use the SageMaker AI Python SDK to opt out of metadata collection at an account level.
The following code example shows how opt out of tracking account-wide.
SchemaVersion: '1.0' SageMaker: TrainingJob: Environment: 'OPT_OUT_TRACKING': '1'
For more information about how to opt out of tracking account-wide, see Configuring
and using defaults with the SageMaker Python SDK
Telemetry from inference endpoints
For real-time inference endpoints that run on GPU instances, SageMaker AI collects operational telemetry from the endpoint's instances. SageMaker AI uses this telemetry only for the inference recommendations that improve your endpoints (see Monitor endpoints with inference recommendations). The telemetry includes the following:
-
Metrics that the inference engine in your model container reports, such as request latency, throughput, and cache usage.
-
GPU metrics, such as utilization and memory use.
-
Configuration values that the inference engine reports in its startup logs, such as the engine version and its settings.
-
Records of changes to the endpoint, such as its creation, updates, scaling, and deletion, with the instance type and container image.
SageMaker AI doesn't collect your model artifacts, or the requests and responses that your endpoint serves.
How telemetry is handled
Telemetry is stored in the AWS Region where your endpoint runs and is analyzed within the same geographic area: endpoints in the Americas, in Europe/Middle East/Africa, and in Asia Pacific are each analyzed within that area. Telemetry is retained for up to 365 days and is used only to generate these recommendations. It is not used to train models and is not shared outside SageMaker AI.
Opt out of telemetry from an inference endpoint
To opt out, set the environment variable OPT_OUT_TRACKING, with
any value, in the Environment of a container when you create
the model with the CreateModel API. If any container of the model sets
the variable, SageMaker AI collects none of this telemetry from any endpoint that hosts the
model, and sends no inference recommendations notifications for it.
Opting out with OPT_OUT_TRACKING isn't available yet for
endpoints that host inference components.
The following AWS CLI command creates a model that opts out. Replace the following values with your own:
-
your_model_name– the name of your model. -
your_role_arn– the ARN of your SageMaker AI execution role. -
your_image_uri– the URI of your container image. -
s3://amzn-s3-demo-bucket/key-name-prefix/model.tar.gz– the Amazon S3 path to your model artifacts.
aws sagemaker create-model \ --model-nameyour_model_name\ --execution-role-arnyour_role_arn\ --primary-container Image=your_image_uri,ModelDataUrl=s3://amzn-s3-demo-bucket/key-name-prefix/model.tar.gz,Environment={OPT_OUT_TRACKING=1}
To opt out an existing endpoint, create a model that sets the variable, create an endpoint configuration that uses the model, and update the endpoint with that endpoint configuration.
After you opt out
Opting out stops collection for that endpoint; no further telemetry is gathered. Telemetry already collected is retained for the remainder of the retention period and is not deleted when you opt out.
Additional information
If your downstream service depends on SageMaker AI training
If you operate a service that relies on SageMaker training, it is highly recommended that you inform your customer about aggregate metadata collection in the SageMaker Training platform and present them with the choice to opt out. Alternatively, you can opt out of metadata collection on behalf of your customer.
If you are a client or a customer of a service that uses SageMaker AI training
If you are a client or customer of a service that uses SageMaker training, use your preferred method in the previous section to opt out of metadata collection.