Changing the SageMaker Feature Transformer Strategy in an Inference Pipeline | AWS Certified Machine Learning - Specialty Exam

Changing the SageMaker Feature Transformer Strategy

Question

You work for the credit card division of a large financial services firm.

You are a machine learning specialist working on a credit card transaction classification model.

Your model will be used to classify your firm's customer transactions for use in direct marketing campaigns by your firm's marketing department.

You have built your model based on the SageMaker pre-built Linear Learner algorithm.

You have also deployed your model to an inference endpoint using an inference pipeline.

You perform your feature engineering via the SageMaker built-in feature transformers.

So you don't need to write your own feature engineering logic. You have defined the containers for your pipeline using the CreateModel SageMaker API, and you have created an inference endpoint using the SageMaker CreateEndpointConfig and CreateEndpoint APIs.

You have decided to change your pipeline to use a different SageMaker feature transformer strategy (change the strategy from the default None to SingleRecord)

How do you make this change to your inference pipeline?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Answer: D.

Option A is incorrect.

SageMaker inference pipelines are immutable, so you cannot change them while they are running.

Option B is incorrect.

It is true that your inference pipeline is immutable, but you change it via the UpdateEndpoint API.

You do not have to delete your pipeline and recreate it.

Option C is incorrect.

Your inference pipeline is immutable, but you change it via the UpdateEndpoint API, not a ReplaceEndpoint API.

The is no ReplaceEndpoint API.

Option D is correct.

Your inference pipeline is immutable.

You change it by deploying a new one via the UpdateEndpoint API.

SageMaker deploys the new inference pipeline, then switches incoming requests to the new one.

SageMaker then deletes the resources associated with the old pipeline.

Reference:

Please see the Amazon SageMaker developer guide titled Deploy an Inference Pipeline, the Amazon SageMaker developer guide titled CreateModel, the Amazon SageMaker developer guide titled UpdateModel, the Amazon SageMaker developer guide titled Use Amazon SageMaker Built-in Algorithms, and the SageMaker docs page titled Transformer.

In this scenario, the machine learning specialist has built a credit card transaction classification model using the SageMaker pre-built Linear Learner algorithm and deployed it to an inference endpoint using an inference pipeline. The feature engineering is performed using the SageMaker built-in feature transformers, and the containers for the pipeline are defined using the CreateModel SageMaker API. An inference endpoint is created using the SageMaker CreateEndpointConfig and CreateEndpoint APIs.

Now the specialist wants to change the feature transformer strategy from the default None to SingleRecord. The question is how to make this change to the inference pipeline.

Option A: Your pipeline model is mutable, meaning you can change it while it is running. This statement is incorrect because while it is possible to update a model while it is running, it is not possible to change the feature transformer strategy for a running inference pipeline.

Option B: Your pipeline is immutable, but you can update your inference pipeline by deleting the old one and redeploying the new one using the SageMaker CreateEndpointConfig and CreateEndpoint APIs. This statement is partially correct. The inference pipeline is immutable, meaning that it cannot be changed once it is created. Therefore, the old pipeline must be deleted and a new one must be deployed. However, the correct method to deploy the new pipeline is to use the SageMaker UpdateEndpoint API, not the CreateEndpointConfig and CreateEndpoint APIs.

Option C: Your pipeline is immutable, but you can change your inference pipeline by deploying a new one using the ReplaceEndpoint API. This statement is incorrect. While it is true that the inference pipeline is immutable, it cannot be changed by deploying a new one using the ReplaceEndpoint API. The ReplaceEndpoint API is used to replace an existing endpoint with a new one that has the same name but different configuration.

Option D: Your pipeline is immutable, but you can change your inference pipeline by deploying a new one using the UpdateEndpoint API. This statement is correct. The inference pipeline is immutable, so a new pipeline must be created with the desired feature transformer strategy. However, instead of deleting the old pipeline and creating a new one, the specialist can use the UpdateEndpoint API to deploy the new pipeline with the desired feature transformer strategy. This allows the existing endpoint to be updated with the new pipeline while preserving its configuration, such as the endpoint name, network settings, and instance type.

In summary, the correct answer is D. While the inference pipeline is immutable and cannot be changed, a new pipeline with the desired feature transformer strategy can be deployed using the UpdateEndpoint API. This allows the existing endpoint to be updated with the new pipeline while preserving its configuration.