Skip to content

stop_hyper_parameter_tuning_job

stop_hyper_parameter_tuning_job(
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    hyper_parameter_tuning_job_name: Optional[HyperParameterTuningJobName] = None,
) -> None

Stops a running hyperparameter tuning job and all running training jobs that the tuning job launched.

All model artifacts output from the training jobs are stored in Amazon Simple Storage Service (Amazon S3). All data that the training jobs write to Amazon CloudWatch Logs are still available in CloudWatch. After the tuning job moves to the Stopped state, it releases all reserved resources for the tuning job.

Parameters:

Raises:

Source code in docs_src/capo_sagemaker/_services/sage_maker.py
def stop_hyper_parameter_tuning_job(
    self,
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    hyper_parameter_tuning_job_name: Optional[
        "capo_sagemaker.types.hyper_parameter_tuning_job_name.HyperParameterTuningJobName"
    ] = None,
) -> None:
    """<p>Stops a running hyperparameter tuning job and all running training jobs that the tuning job launched.</p> <p>All model artifacts output from the training jobs are stored in Amazon Simple Storage Service (Amazon S3). All data that the training jobs write to Amazon CloudWatch Logs are still available in CloudWatch. After the tuning job moves to the <code>Stopped</code> state, it releases all reserved resources for the tuning job.</p>

    Args:
        hyper_parameter_tuning_job_name: <p>The name of the tuning job to stop.</p>

    Raises:
        capo_sagemaker.errors.resource_not_found.ResourceNotFound: <p>Resource being access is not found.</p>
        capo_sagemaker.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_sagemaker.types.stop_hyper_parameter_tuning_job_request.StopHyperParameterTuningJobRequest]",
    ) -> OperationResponse[None]:
        import capo_sagemaker._operations.sage_maker.stop_hyper_parameter_tuning_job

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StopHyperParameterTuningJob")
    )
    input_: capo_sagemaker.types.stop_hyper_parameter_tuning_job_request.StopHyperParameterTuningJobRequest = {}
    if hyper_parameter_tuning_job_name is not None:
        input_["hyper_parameter_tuning_job_name"] = hyper_parameter_tuning_job_name

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