Skip to content

search_training_plan_offerings

search_training_plan_offerings(
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    instance_type: Optional[ReservedCapacityInstanceType] = None,
    instance_count: Optional[ReservedCapacityInstanceCount] = None,
    ultra_server_type: Optional[UltraServerType] = None,
    ultra_server_count: Optional[UltraServerCount] = None,
    start_time_after: Optional[Timestamp] = None,
    end_time_before: Optional[Timestamp] = None,
    duration_hours: Optional[TrainingPlanDurationHoursInput] = None,
    target_resources: Optional[SageMakerResourceNames] = None,
    training_plan_arn: Optional[String] = None,
) -> SearchTrainingPlanOfferingsResponse

Searches for available training plan offerings based on specified criteria.

  • Users search for available plan offerings based on their requirements (e.g., instance type, count, start time, duration).

  • And then, they create a plan that best matches their needs using the ID of the plan offering they want to use.

For more information about how to reserve GPU capacity for your SageMaker training jobs or SageMaker HyperPod clusters using Amazon SageMaker Training Plan , see CreateTrainingPlan .

Parameters:

  • instance_type (Optional[ReservedCapacityInstanceType], default: None ) –

    The type of instance you want to search for in the available training plan offerings. This field allows you to filter the search results based on the specific compute resources you require for your SageMaker training jobs or SageMaker HyperPod clusters. When searching for training plan offerings, specifying the instance type helps you find Reserved Instances that match your computational needs.

  • instance_count (Optional[ReservedCapacityInstanceCount], default: None ) –

    The number of instances you want to reserve in the training plan offerings. This allows you to specify the quantity of compute resources needed for your SageMaker training jobs or SageMaker HyperPod clusters, helping you find reserved capacity offerings that match your requirements.

  • ultra_server_type (Optional[UltraServerType], default: None ) –

    The type of UltraServer to search for, such as ml.u-p6e-gb200x72.

  • ultra_server_count (Optional[UltraServerCount], default: None ) –

    The number of UltraServers to search for.

  • start_time_after (Optional[Timestamp], default: None ) –

    A filter to search for training plan offerings with a start time after a specified date.

  • end_time_before (Optional[Timestamp], default: None ) –

    A filter to search for reserved capacity offerings with an end time before a specified date.

  • duration_hours (Optional[TrainingPlanDurationHoursInput], default: None ) –

    The desired duration in hours for the training plan offerings.

  • target_resources (Optional[SageMakerResourceNames], default: None ) –

    The target resources (e.g., SageMaker Training Jobs, SageMaker HyperPod, SageMaker Endpoints, Studio apps) to search for in the offerings.

    Training plans are specific to their target resource.

    • A training plan designed for SageMaker training jobs can only be used to schedule and run training jobs.

    • A training plan for HyperPod clusters can be used exclusively to provide compute resources to a cluster's instance group.

    • A training plan for SageMaker endpoints can be used exclusively to provide compute resources to SageMaker endpoints for model deployment.

    • A training plan for Studio apps can be used to launch JupyterLab and Code Editor apps on reserved training plan capacity.

  • training_plan_arn (Optional[String], default: None ) –

    The Amazon Resource Name (ARN); of an existing training plan to search for extension offerings. When specified, the API returns extension offerings that can be used to extend the specified training plan.

Raises:

  • ResourceLimitExceeded –

    You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_sagemaker/_services/sage_maker.py
def search_training_plan_offerings(
    self,
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    instance_type: Optional[
        "capo_sagemaker.types.reserved_capacity_instance_type.ReservedCapacityInstanceType"
    ] = None,
    instance_count: Optional[
        "capo_sagemaker.types.reserved_capacity_instance_count.ReservedCapacityInstanceCount"
    ] = None,
    ultra_server_type: Optional[
        "capo_sagemaker.types.ultra_server_type.UltraServerType"
    ] = None,
    ultra_server_count: Optional[
        "capo_sagemaker.types.ultra_server_count.UltraServerCount"
    ] = None,
    start_time_after: Optional["capo_sagemaker.types.timestamp.Timestamp"] = None,
    end_time_before: Optional["capo_sagemaker.types.timestamp.Timestamp"] = None,
    duration_hours: Optional[
        "capo_sagemaker.types.training_plan_duration_hours_input.TrainingPlanDurationHoursInput"
    ] = None,
    target_resources: Optional[
        "capo_sagemaker.types.sage_maker_resource_names.SageMakerResourceNames"
    ] = None,
    training_plan_arn: Optional["capo_sagemaker.types.string.String"] = None,
) -> "capo_sagemaker.types.search_training_plan_offerings_response.SearchTrainingPlanOfferingsResponse":
    """<p>Searches for available training plan offerings based on specified criteria. </p> <ul> <li> <p>Users search for available plan offerings based on their requirements (e.g., instance type, count, start time, duration). </p> </li> <li> <p>And then, they create a plan that best matches their needs using the ID of the plan offering they want to use. </p> </li> </ul> <p>For more information about how to reserve GPU capacity for your SageMaker training jobs or SageMaker HyperPod clusters using Amazon SageMaker Training Plan , see <code> <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateTrainingPlan.html">CreateTrainingPlan</a> </code>.</p>

    Args:
        instance_type: <p>The type of instance you want to search for in the available training plan offerings. This field allows you to filter the search results based on the specific compute resources you require for your SageMaker training jobs or SageMaker HyperPod clusters. When searching for training plan offerings, specifying the instance type helps you find Reserved Instances that match your computational needs.</p>
        instance_count: <p>The number of instances you want to reserve in the training plan offerings. This allows you to specify the quantity of compute resources needed for your SageMaker training jobs or SageMaker HyperPod clusters, helping you find reserved capacity offerings that match your requirements.</p>
        ultra_server_type: <p>The type of UltraServer to search for, such as ml.u-p6e-gb200x72.</p>
        ultra_server_count: <p>The number of UltraServers to search for.</p>
        start_time_after: <p>A filter to search for training plan offerings with a start time after a specified date.</p>
        end_time_before: <p>A filter to search for reserved capacity offerings with an end time before a specified date.</p>
        duration_hours: <p>The desired duration in hours for the training plan offerings.</p>
        target_resources: <p>The target resources (e.g., SageMaker Training Jobs, SageMaker HyperPod, SageMaker Endpoints, Studio apps) to search for in the offerings.</p> <p>Training plans are specific to their target resource.</p> <ul> <li> <p>A training plan designed for SageMaker training jobs can only be used to schedule and run training jobs.</p> </li> <li> <p>A training plan for HyperPod clusters can be used exclusively to provide compute resources to a cluster's instance group.</p> </li> <li> <p>A training plan for SageMaker endpoints can be used exclusively to provide compute resources to SageMaker endpoints for model deployment.</p> </li> <li> <p>A training plan for Studio apps can be used to launch JupyterLab and Code Editor apps on reserved training plan capacity.</p> </li> </ul>
        training_plan_arn: <p>The Amazon Resource Name (ARN); of an existing training plan to search for extension offerings. When specified, the API returns extension offerings that can be used to extend the specified training plan.</p>

    Raises:
        capo_sagemaker.errors.resource_limit_exceeded.ResourceLimitExceeded: <p> You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created. </p>
        capo_sagemaker.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_sagemaker.types.search_training_plan_offerings_request.SearchTrainingPlanOfferingsRequest]",
    ) -> OperationResponse[
        "capo_sagemaker.types.search_training_plan_offerings_response.SearchTrainingPlanOfferingsResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.search_training_plan_offerings

        output, http_response = (
            capo_sagemaker._operations.sage_maker.search_training_plan_offerings.search_training_plan_offerings(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("SearchTrainingPlanOfferings")
    )
    input_: capo_sagemaker.types.search_training_plan_offerings_request.SearchTrainingPlanOfferingsRequest = {}
    if instance_type is not None:
        input_["instance_type"] = instance_type
    if instance_count is not None:
        input_["instance_count"] = instance_count
    if ultra_server_type is not None:
        input_["ultra_server_type"] = ultra_server_type
    if ultra_server_count is not None:
        input_["ultra_server_count"] = ultra_server_count
    if start_time_after is not None:
        input_["start_time_after"] = start_time_after
    if end_time_before is not None:
        input_["end_time_before"] = end_time_before
    if duration_hours is not None:
        input_["duration_hours"] = duration_hours
    if target_resources is not None:
        input_["target_resources"] = target_resources
    if training_plan_arn is not None:
        input_["training_plan_arn"] = training_plan_arn

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output