Create a shadow test
You can create a shadow test to compare the performance of a shadow variant against a production variant. You can run the test on an existing endpoint that is serving inference requests or you can create a new endpoint on which to run the test.
To create a shadow test you need to specify the following:
-
A production variant that receives and responds to 100 percent of the incoming inference requests.
-
A shadow variant that receives a percentage of the incoming requests, replicated from the production variant, but does not return any responses.
For each variant, you can use SageMaker AI to control the model, instance type, and instance count. You can configure the percentage of incoming requests, known as the traffic sampling percentage, that you want replicated to your shadow variant. SageMaker AI manages the replication of requests to your shadow variant and you can modify the traffic sampling percentage when your test is scheduled or running. You can also optionally turn on Data Capture to log requests and responses of your production and shadow variants.
Note
SageMaker AI supports a maximum of one shadow variant per endpoint. For an endpoint with a shadow variant, there can be a maximum of one production variant.
You can schedule the test to start at any time and continue for a specified duration. The default duration is 7 days and the maximum is 30 days. After the test is complete, the endpoint reverts to the state it was in prior to starting the test. This ensures that you do not have to manually clean up resources upon the completion of the test.
You can monitor a test that is running through a dashboard in the SageMaker AI console. The dashboard provides a side by side comparison of invocation metrics and instance metrics between the production and shadow variants, along with a tabular view with relevant metric statistics. This dashboard is also available for completed tests. Once you have reviewed the metrics, you can either choose to promote the shadow variant to be the new production variant or retain the existing production variant. Once you promote the shadow variant, it responds to all incoming requests. For more information, see Promote a shadow variant.
The following procedure describes how to create a shadow test through the SageMaker AI console. There are variations in the workflow depending on whether you want to use an existing endpoint or to create a new endpoint for the shadow test.
Prerequisites
Before creating a shadow test with the SageMaker AI console, you must have a SageMaker AI model ready to use. For more information about how to create a SageMaker AI model, see Deploy models for real-time inference.
You can get started with shadow tests with an existing endpoint with a production variant and a shadow variant, an existing endpoint with only a production variant, or just the SageMaker AI models you'd like to compare. Shadow tests support creating an endpoint and adding variants before your test begins.
Note
Certain endpoint features may make your endpoint incompatible with shadow tests. If your endpoint uses any of the following features, you cannot use shadow tests on your endpoint, and your request to set up shadow tests will lead to validation errors.
Serverless inference
Asynchronous inference
Marketplace containers
Multiple-container endpoints
Multi-model endpoints
Endpoints that use Inf1 (Inferentia-based) instances
Enter shadow test details
To start creating your shadow test, fill out the Enter shadow test details page by doing the following:
-
Open the SageMaker AI console
. -
In the left navigation panel, choose Inference, and then choose Shadow tests.
-
Choose Create shadow test.
-
Under Name, enter a name for the test.
-
(Optional) Under Description, enter a description for the test.
-
(Optional) Specify Tags using Key and Value pairs.
-
Choose Next.
Enter shadow test settings
After filling out the Enter shadow test details page, fill out the Enter shadow test settings page. If you already have a SageMaker AI Inference endpoint and a production variant, follow the Use an existing endpoint workflow. If you don't already have an endpoint, follow the Create a new endpoint workflow.
After completing the preceding procedures, you should now have a test scheduled to begin at your specified start date and time. You can view the progress of the test from a dashboard. For more information about viewing your test and the actions you can take, see How to view, monitor, and edit shadow tests.