ResourceConfig Struct
Specifies the resources, ML compute instances, and ML storage volumes to deploy for model training.
Example
ts
new tasks.SageMakerCreateTrainingJob(this, 'TrainSagemaker', {
trainingJobName: sfn.JsonPath.stringAt('$.JobName'),
algorithmSpecification: {
algorithmName: 'BlazingText',
trainingInputMode: tasks.InputMode.FILE,
},
inputDataConfig: [{
channelName: 'train',
dataSource: {
s3DataSource: {
s3DataType: tasks.S3DataType.S3_PREFIX,
s3Location: tasks.S3Location.fromJsonExpression('$.S3Bucket'),
},
},
}],
outputDataConfig: {
s3OutputLocation: tasks.S3Location.fromBucket(s3.Bucket.fromBucketName(this, 'Bucket', 'amzn-s3-demo-bucket'), 'myoutputpath'),
},
resourceConfig: {
instanceCount: 1,
instanceType: new ec2.InstanceType(sfn.JsonPath.stringAt('$.InstanceType')),
volumeSize: Size.gibibytes(50),
}, // optional: default is 1 instance of EC2 `M4.XLarge` with `10GB` volume
stoppingCondition: {
maxRuntime: Duration.hours(2),
}, // optional: default is 1 hour
});
Properties
instanceCountnumberinstance_countint | floatinstanceCountNumberInstanceCountdoubleInstanceCount*float64= 1 instance.required#The number of ML compute instances to use.
instanceTypeInstanceTypeinstance_typeInstanceTypeinstanceTypeInstanceTypeInstanceTypeInstanceTypeInstanceTypeInstanceType= ec2.InstanceType(ec2.InstanceCla…required#ML compute instance type.
notes · default
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.":
ts
new ec2.InstanceType(sfn.JsonPath.stringAt('$.path.to.instanceType'));
Default: ec2.InstanceType(ec2.InstanceClass.M4, ec2.InstanceType.XLARGE)
volumeEncryptionKeyIKeyvolume_encryption_keyIKeyvolumeEncryptionKeyIKeyVolumeEncryptionKeyIKeyVolumeEncryptionKeyIKey= Amazon SageMaker uses the defaul…#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.
default
Default: Amazon SageMaker uses the default KMS key for Amazon S3 for your role's account