Interface IResourceConfig
Specifies the resources, ML compute instances, and ML storage volumes to deploy for model training.
Namespace: Amazon.CDK.AWS.StepFunctions.Tasks
Assembly: Amazon.CDK.AWS.StepFunctions.Tasks.dll
Syntax (csharp)
public interface IResourceConfig
Syntax (vb)
Public Interface IResourceConfig
Remarks
ExampleMetadata: infused
Examples
new SageMakerCreateTrainingJob(this, "TrainSagemaker", new SageMakerCreateTrainingJobProps {
TrainingJobName = JsonPath.StringAt("$.JobName"),
AlgorithmSpecification = new AlgorithmSpecification {
AlgorithmName = "BlazingText",
TrainingInputMode = InputMode.FILE
},
InputDataConfig = new [] { new Channel {
ChannelName = "train",
DataSource = new DataSource {
S3DataSource = new S3DataSource {
S3DataType = S3DataType.S3_PREFIX,
S3Location = S3Location.FromJsonExpression("$.S3Bucket")
}
}
} },
OutputDataConfig = new OutputDataConfig {
S3OutputLocation = S3Location.FromBucket(Bucket.FromBucketName(this, "Bucket", "mybucket"), "myoutputpath")
},
ResourceConfig = new ResourceConfig {
InstanceCount = 1,
InstanceType = new InstanceType(JsonPath.StringAt("$.InstanceType")),
VolumeSize = Size.Gibibytes(50)
}, // optional: default is 1 instance of EC2 `M4.XLarge` with `10GB` volume
StoppingCondition = new StoppingCondition {
MaxRuntime = Duration.Hours(2)
}
});
Synopsis
Properties
InstanceCount | The number of ML compute instances to use. |
InstanceType | ML compute instance type. |
VolumeEncryptionKey | KMS key that Amazon SageMaker uses to encrypt data on the storage volume attached to the ML compute instance(s) that run the training job. |
VolumeSize | Size of the ML storage volume that you want to provision. |
Properties
InstanceCount
The number of ML compute instances to use.
double InstanceCount { get; }
Property Value
System.Double
Remarks
Default: 1 instance.
InstanceType
ML compute instance type.
InstanceType InstanceType { get; }
Property Value
Remarks
To provide an instance type from the task input, supply an instance type in the following way where the value in the task input is an EC2 instance type prepended with "ml.":
new InstanceType(JsonPath.StringAt("$.path.to.instanceType"));
Default: ec2.InstanceType(ec2.InstanceClass.M4, ec2.InstanceType.XLARGE)
VolumeEncryptionKey
KMS key that Amazon SageMaker uses to encrypt data on the storage volume attached to the ML compute instance(s) that run the training job.
virtual IKey VolumeEncryptionKey { get; }
Property Value
Remarks
Default: - Amazon SageMaker uses the default KMS key for Amazon S3 for your role's account
VolumeSize
Size of the ML storage volume that you want to provision.
Size VolumeSize { get; }
Property Value
Remarks
Default: 10 GB EBS volume.