Class ResourceConfig
Specifies the resources, ML compute instances, and ML storage volumes to deploy for model training.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.StepFunctions.Tasks
Assembly: Amazon.CDK.AWS.StepFunctions.Tasks.dll
Syntax (csharp)
public class ResourceConfig : Object, IResourceConfig
Syntax (vb)
Public Class ResourceConfig
Inherits Object
Implements 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
Constructors
ResourceConfig() |
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. |
Constructors
ResourceConfig()
public ResourceConfig()
Properties
InstanceCount
The number of ML compute instances to use.
public double InstanceCount { get; set; }
Property Value
System.Double
Remarks
Default: 1 instance.
InstanceType
ML compute instance type.
public InstanceType InstanceType { get; set; }
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.
public IKey VolumeEncryptionKey { get; set; }
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.
public Size VolumeSize { get; set; }
Property Value
Remarks
Default: 10 GB EBS volume.