ladderlore
  • S3 や IAM などのサービス名を入力してください。

概念

Shadow variants and A/B tests

Test a new model on a live endpoint by splitting traffic (A/B) or by mirroring it to a shadow copy that no user sees.

このレッスンはまだ翻訳されていないため、英語で表示しています。

Callers
Endpoint
Production variant
Shadow variant
Compare metrics
  1. 1The application calls the endpoint.
  2. 2The production variant answers the caller.
  3. 3A copy of the request goes to the shadow variant. Its reply is dropped or logged.
  4. 4Production metrics go to the comparison.
  5. 5Shadow metrics go to the comparison.
The shadow variant gets a copy of each request. Only the production variant answers.

流れ

  1. 1The application calls the endpoint.
  2. 2The production variant answers the caller.
  3. 3A copy of the request goes to the shadow variant. Its reply is dropped or logged.
  4. 4Production metrics go to the comparison.
  5. 5Shadow metrics go to the comparison.
  • Traffic

    A/B test
    Split by weight
    Shadow test
    Sampled copy
  • Who answers

    A/B test
    Each variant, its share
    Shadow test
    Production only
  • Measures

    A/B test
    User results, accuracy
    Shadow test
    Latency, errors, outputs
  • User risk

    A/B test
    Some users get model B
    Shadow test
    None
A/B tests change what users get. Shadow tests do not.

1 / 2

  • Traffic

    A/B test
    Split by weight
    Shadow test
    Sampled copy
  • Who answers

    A/B test
    Each variant, its share
    Shadow test
    Production only
  • Measures

    A/B test
    User results, accuracy
    Shadow test
    Latency, errors, outputs

2 / 2

  • User risk

    A/B test
    Some users get model B
    Shadow test
    None
A/B tests change what users get. Shadow tests do not.

概要

A SageMaker AI endpoint can host several production variants: each a model with its own instance type and count, and a weight in the endpoint configuration. A variant gets its weight divided by the sum, so 1 and 1 give 50 percent each. That is an A/B test: real users split between model A and B, and you compare results. UpdateEndpointWeightsAndCapacities changes weights on a running endpoint with no redeploy: move to 25 and 75, then give the winner 100 percent and delete the old variant. TargetVariant in InvokeEndpoint overrides the weights for one request. CloudWatch reports Invocations and Latency per variant.

概要

A shadow variant gets a copy of live requests, but only the production variant answers the caller. The shadow response is discarded, or logged with data capture for offline checks, so nobody is affected if the new model is slow or wrong. Use it to compare latency, error rate and outputs of a new model, container or instance type before any user depends on it.

概要

In a shadow test you set the sampling percentage (the share of requests copied) and a duration: default 7 days, maximum 30. The console shows both variants side by side. You then promote the shadow variant, which answers all requests, or remove it. On promotion, keep the production instance settings (the safe choice) or the shadow settings, after testing at 100 percent sampling. An endpoint can have one shadow variant beside one production variant. Shadow tests do not work with serverless, asynchronous, multi-model or multiple-container endpoints, Marketplace containers or Inf1 instances.

概要

Pick by the question. “Does it run well?” needs a shadow test. “Do users do better with it?” needs an A/B test, because a shadow reply never reaches a user. A common path is a shadow test, then a small A/B share, then 100 percent.

覚えること

  • Production variants: weighted split. TargetVariant overrides weights.
  • Shadow variant: gets a copy of requests, response discarded or logged. No user impact.
  • Shadow test: 7 day default, 30 day maximum, one shadow variant per endpoint.

試験では

  • “Test a new model on live traffic with no effect on users” points to a shadow variant.
  • “Send 10 percent of users to the new model” points to production variant weights.
  • “Send one request to a chosen model version” points to TargetVariant.