Skip to content

InstancePreference

Source code in docs_src/capo_sagemaker/types/instance_preference.py
class InstancePreference(TypedDict, closed=True):
    instance_type: NotRequired[
        "capo_sagemaker.types.training_instance_type.TrainingInstanceType"
    ]
    """<p>The ML compute instance type. An instance type can appear only once in an <code>InstancePreferences</code> list.</p>"""
    instance_count: NotRequired[
        "capo_sagemaker.types.training_instance_count.TrainingInstanceCount"
    ]
    """<p>The number of instances to launch if this instance type is selected. Specify the instance count for the training job in one of the following two ways:</p> <ol> <li> <p> <b>Per preference</b> – Set <code>InstanceCount</code> on every preference in the <code>InstancePreferences</code> list and don't set <code>ResourceConfig$InstanceCount</code>. Use this when each instance type needs a different number of instances to deliver equivalent compute.</p> </li> <li> <p> <b>One count for the job</b> – Set <code>ResourceConfig$InstanceCount</code> and omit it from every preference. SageMaker applies this to all instance types in the list.</p> </li> </ol> <p>For example, in a list of five preferences, either all five specify <code>InstanceCount</code> or none of them do. SageMaker rejects requests that set <code>InstanceCount</code> on only some preferences, that set it both per preference and in <code>ResourceConfig</code>, or that omit it in both places.</p>"""
    training_plan_arns: NotRequired[
        "capo_sagemaker.types.training_plan_arn_list.TrainingPlanArnList"
    ]
    """<p>The Amazon Resource Name (ARN) of a training plan to use if this instance type is selected. The plan's instance type must match <code>InstanceType</code>. A preference with a training plan uses that plan's reserved capacity; a preference without one uses on-demand capacity. Per-preference <code>TrainingPlanArns</code> is mutually exclusive with the job-level <code>TrainingPlanArn</code> in <code>ResourceConfig</code>.</p>"""

instance_count instance-attribute

instance_count: NotRequired[TrainingInstanceCount]

The number of instances to launch if this instance type is selected. Specify the instance count for the training job in one of the following two ways:

  1. Per preference – Set InstanceCount on every preference in the InstancePreferences list and don't set ResourceConfig$InstanceCount. Use this when each instance type needs a different number of instances to deliver equivalent compute.

  2. One count for the job – Set ResourceConfig$InstanceCount and omit it from every preference. SageMaker applies this to all instance types in the list.

For example, in a list of five preferences, either all five specify InstanceCount or none of them do. SageMaker rejects requests that set InstanceCount on only some preferences, that set it both per preference and in ResourceConfig, or that omit it in both places.

instance_type instance-attribute

instance_type: NotRequired[TrainingInstanceType]

The ML compute instance type. An instance type can appear only once in an InstancePreferences list.

training_plan_arns instance-attribute

training_plan_arns: NotRequired[TrainingPlanArnList]

The Amazon Resource Name (ARN) of a training plan to use if this instance type is selected. The plan's instance type must match InstanceType. A preference with a training plan uses that plan's reserved capacity; a preference without one uses on-demand capacity. Per-preference TrainingPlanArns is mutually exclusive with the job-level TrainingPlanArn in ResourceConfig.