Class CfnInferenceExperiment
- All Implemented Interfaces:
IConstruct,IDependable,IInspectable,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct
AWS::SageMaker::InferenceExperiment.
Creates an inference experiment using the configurations specified in the request.
Use this API to setup and schedule an experiment to compare model variants on a Amazon SageMaker inference endpoint. For more information about inference experiments, see Shadow tests .
Amazon SageMaker begins your experiment at the scheduled time and routes traffic to your endpoint's model variants based on your specified configuration.
While the experiment is in progress or after it has concluded, you can view metrics that compare your model variants. For more information, see View, monitor, and edit shadow tests .
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.sagemaker.*;
CfnInferenceExperiment cfnInferenceExperiment = CfnInferenceExperiment.Builder.create(this, "MyCfnInferenceExperiment")
.endpointName("endpointName")
.modelVariants(List.of(ModelVariantConfigProperty.builder()
.infrastructureConfig(ModelInfrastructureConfigProperty.builder()
.infrastructureType("infrastructureType")
.realTimeInferenceConfig(RealTimeInferenceConfigProperty.builder()
.instanceCount(123)
.instanceType("instanceType")
.build())
.build())
.modelName("modelName")
.variantName("variantName")
.build()))
.name("name")
.roleArn("roleArn")
.type("type")
// the properties below are optional
.dataStorageConfig(DataStorageConfigProperty.builder()
.destination("destination")
// the properties below are optional
.contentType(CaptureContentTypeHeaderProperty.builder()
.csvContentTypes(List.of("csvContentTypes"))
.jsonContentTypes(List.of("jsonContentTypes"))
.build())
.kmsKey("kmsKey")
.build())
.description("description")
.desiredState("desiredState")
.kmsKey("kmsKey")
.schedule(InferenceExperimentScheduleProperty.builder()
.endTime("endTime")
.startTime("startTime")
.build())
.shadowModeConfig(ShadowModeConfigProperty.builder()
.shadowModelVariants(List.of(ShadowModelVariantConfigProperty.builder()
.samplingPercentage(123)
.shadowModelVariantName("shadowModelVariantName")
.build()))
.sourceModelVariantName("sourceModelVariantName")
.build())
.statusReason("statusReason")
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.build();
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA fluent builder forCfnInferenceExperiment.static interfaceConfiguration specifying how to treat different headers.static interfaceThe Amazon S3 location and configuration for storing inference request and response data.static interfaceThe metadata of the endpoint.static interfaceThe start and end times of an inference experiment.static interfaceThe configuration for the infrastructure that the model will be deployed to.static interfaceContains information about the deployment options of a model.static interfaceThe infrastructure configuration for deploying the model to a real-time inference endpoint.static interfaceThe configuration ofShadowModeinference experiment type, which specifies a production variant to take all the inference requests, and a shadow variant to which Amazon SageMaker replicates a percentage of the inference requests.static interfaceThe name and sampling percentage of a shadow variant.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.core.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionCfnInferenceExperiment(Construct scope, String id, CfnInferenceExperimentProps props) Create a newAWS::SageMaker::InferenceExperiment.protectedCfnInferenceExperiment(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnInferenceExperiment(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionThe Amazon S3 location and configuration for storing inference request and response data.The description of the inference experiment.The desired state of the experiment after stopping.The name of the endpoint.The AWS Key Management Service key that Amazon SageMaker uses to encrypt captured data at rest using Amazon S3 server-side encryption.An array ofModelVariantConfigSummaryobjects.getName()The name of the inference experiment.The ARN of the IAM role that Amazon SageMaker can assume to access model artifacts and container images, and manage Amazon SageMaker Inference endpoints for model deployment.The duration for which the inference experiment ran or will run.The configuration ofShadowModeinference experiment type, which shows the production variant that takes all the inference requests, and the shadow variant to which Amazon SageMaker replicates a percentage of the inference requests.The error message for the inference experiment status result.getTags()An array of key-value pairs to apply to this resource.getType()The type of the inference experiment.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidsetDataStorageConfig(IResolvable value) The Amazon S3 location and configuration for storing inference request and response data.voidThe Amazon S3 location and configuration for storing inference request and response data.voidsetDescription(String value) The description of the inference experiment.voidsetDesiredState(String value) The desired state of the experiment after stopping.voidsetEndpointName(String value) The name of the endpoint.voidThe AWS Key Management Service key that Amazon SageMaker uses to encrypt captured data at rest using Amazon S3 server-side encryption.voidsetModelVariants(List<Object> value) An array ofModelVariantConfigSummaryobjects.voidsetModelVariants(IResolvable value) An array ofModelVariantConfigSummaryobjects.voidThe name of the inference experiment.voidsetRoleArn(String value) The ARN of the IAM role that Amazon SageMaker can assume to access model artifacts and container images, and manage Amazon SageMaker Inference endpoints for model deployment.voidsetSchedule(IResolvable value) The duration for which the inference experiment ran or will run.voidThe duration for which the inference experiment ran or will run.voidsetShadowModeConfig(IResolvable value) The configuration ofShadowModeinference experiment type, which shows the production variant that takes all the inference requests, and the shadow variant to which Amazon SageMaker replicates a percentage of the inference requests.voidThe configuration ofShadowModeinference experiment type, which shows the production variant that takes all the inference requests, and the shadow variant to which Amazon SageMaker replicates a percentage of the inference requests.voidsetStatusReason(String value) The error message for the inference experiment status result.voidThe type of the inference experiment.Methods inherited from class software.amazon.awscdk.core.CfnResource
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.core.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.core.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validateMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnInferenceExperiment
protected CfnInferenceExperiment(software.amazon.jsii.JsiiObjectRef objRef) -
CfnInferenceExperiment
protected CfnInferenceExperiment(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnInferenceExperiment
@Stability(Stable) public CfnInferenceExperiment(@NotNull Construct scope, @NotNull String id, @NotNull CfnInferenceExperimentProps props) Create a newAWS::SageMaker::InferenceExperiment.- Parameters:
scope-- scope in which this resource is defined.
id-- scoped id of the resource.
props-- resource properties.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector-- tree inspector to collect and process attributes.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrArn
-
getAttrCreationTime
-
getAttrEndpointMetadataEndpointConfigName
-
getAttrEndpointMetadataEndpointName
-
getAttrEndpointMetadataEndpointStatus
-
getAttrLastModifiedTime
-
getAttrStatus
-
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getTags
An array of key-value pairs to apply to this resource.For more information, see Tag .
-
getEndpointName
The name of the endpoint. -
setEndpointName
The name of the endpoint. -
getModelVariants
An array ofModelVariantConfigSummaryobjects.There is one for each variant in the inference experiment. Each
ModelVariantConfigSummaryobject in the array describes the infrastructure configuration for deploying the corresponding variant. -
setModelVariants
An array ofModelVariantConfigSummaryobjects.There is one for each variant in the inference experiment. Each
ModelVariantConfigSummaryobject in the array describes the infrastructure configuration for deploying the corresponding variant. -
setModelVariants
An array ofModelVariantConfigSummaryobjects.There is one for each variant in the inference experiment. Each
ModelVariantConfigSummaryobject in the array describes the infrastructure configuration for deploying the corresponding variant. -
getName
The name of the inference experiment. -
setName
The name of the inference experiment. -
getRoleArn
The ARN of the IAM role that Amazon SageMaker can assume to access model artifacts and container images, and manage Amazon SageMaker Inference endpoints for model deployment. -
setRoleArn
The ARN of the IAM role that Amazon SageMaker can assume to access model artifacts and container images, and manage Amazon SageMaker Inference endpoints for model deployment. -
getType
The type of the inference experiment. -
setType
The type of the inference experiment. -
getDataStorageConfig
The Amazon S3 location and configuration for storing inference request and response data. -
setDataStorageConfig
The Amazon S3 location and configuration for storing inference request and response data. -
setDataStorageConfig
@Stability(Stable) public void setDataStorageConfig(@Nullable CfnInferenceExperiment.DataStorageConfigProperty value) The Amazon S3 location and configuration for storing inference request and response data. -
getDescription
The description of the inference experiment. -
setDescription
The description of the inference experiment. -
getDesiredState
The desired state of the experiment after stopping. The possible states are the following:.Completed: The experiment completed successfullyCancelled: The experiment was canceled
-
setDesiredState
The desired state of the experiment after stopping. The possible states are the following:.Completed: The experiment completed successfullyCancelled: The experiment was canceled
-
getKmsKey
The AWS Key Management Service key that Amazon SageMaker uses to encrypt captured data at rest using Amazon S3 server-side encryption. -
setKmsKey
The AWS Key Management Service key that Amazon SageMaker uses to encrypt captured data at rest using Amazon S3 server-side encryption. -
getSchedule
The duration for which the inference experiment ran or will run.The maximum duration that you can set for an inference experiment is 30 days.
-
setSchedule
The duration for which the inference experiment ran or will run.The maximum duration that you can set for an inference experiment is 30 days.
-
setSchedule
@Stability(Stable) public void setSchedule(@Nullable CfnInferenceExperiment.InferenceExperimentScheduleProperty value) The duration for which the inference experiment ran or will run.The maximum duration that you can set for an inference experiment is 30 days.
-
getShadowModeConfig
The configuration ofShadowModeinference experiment type, which shows the production variant that takes all the inference requests, and the shadow variant to which Amazon SageMaker replicates a percentage of the inference requests.For the shadow variant it also shows the percentage of requests that Amazon SageMaker replicates.
-
setShadowModeConfig
The configuration ofShadowModeinference experiment type, which shows the production variant that takes all the inference requests, and the shadow variant to which Amazon SageMaker replicates a percentage of the inference requests.For the shadow variant it also shows the percentage of requests that Amazon SageMaker replicates.
-
setShadowModeConfig
@Stability(Stable) public void setShadowModeConfig(@Nullable CfnInferenceExperiment.ShadowModeConfigProperty value) The configuration ofShadowModeinference experiment type, which shows the production variant that takes all the inference requests, and the shadow variant to which Amazon SageMaker replicates a percentage of the inference requests.For the shadow variant it also shows the percentage of requests that Amazon SageMaker replicates.
-
getStatusReason
The error message for the inference experiment status result. -
setStatusReason
The error message for the inference experiment status result.
-