Skip to content

update_training_job

update_training_job(
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    training_job_name: Optional[TrainingJobName] = None,
    profiler_config: Optional[ProfilerConfigForUpdate] = None,
    profiler_rule_configurations: Optional[ProfilerRuleConfigurations] = None,
    resource_config: Optional[ResourceConfigForUpdate] = None,
    remote_debug_config: Optional[RemoteDebugConfigForUpdate] = None,
) -> UpdateTrainingJobResponse

Update a model training job to request a new Debugger profiling configuration or to change warm pool retention length.

Parameters:

Raises:

Source code in docs_src/capo_sagemaker/_services/sage_maker.py
def update_training_job(
    self,
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    training_job_name: Optional[
        "capo_sagemaker.types.training_job_name.TrainingJobName"
    ] = None,
    profiler_config: Optional[
        "capo_sagemaker.types.profiler_config_for_update.ProfilerConfigForUpdate"
    ] = None,
    profiler_rule_configurations: Optional[
        "capo_sagemaker.types.profiler_rule_configurations.ProfilerRuleConfigurations"
    ] = None,
    resource_config: Optional[
        "capo_sagemaker.types.resource_config_for_update.ResourceConfigForUpdate"
    ] = None,
    remote_debug_config: Optional[
        "capo_sagemaker.types.remote_debug_config_for_update.RemoteDebugConfigForUpdate"
    ] = None,
) -> "capo_sagemaker.types.update_training_job_response.UpdateTrainingJobResponse":
    """<p>Update a model training job to request a new Debugger profiling configuration or to change warm pool retention length.</p>

    Args:
        training_job_name: <p>The name of a training job to update the Debugger profiling configuration.</p>
        profiler_config: <p>Configuration information for Amazon SageMaker Debugger system monitoring, framework profiling, and storage paths.</p>
        profiler_rule_configurations: <p>Configuration information for Amazon SageMaker Debugger rules for profiling system and framework metrics.</p>
        resource_config: <p>The training job <code>ResourceConfig</code> to update warm pool retention length.</p>
        remote_debug_config: <p>Configuration for remote debugging while the training job is running. You can update the remote debugging configuration when the <code>SecondaryStatus</code> of the job is <code>Downloading</code> or <code>Training</code>.To learn more about the remote debugging functionality of SageMaker, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/train-remote-debugging.html">Access a training container through Amazon Web Services Systems Manager (SSM) for remote debugging</a>.</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.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.update_training_job_request.UpdateTrainingJobRequest]",
    ) -> OperationResponse[
        "capo_sagemaker.types.update_training_job_response.UpdateTrainingJobResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.update_training_job

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateTrainingJob")
    )
    input_: capo_sagemaker.types.update_training_job_request.UpdateTrainingJobRequest = {}
    if training_job_name is not None:
        input_["training_job_name"] = training_job_name
    if profiler_config is not None:
        input_["profiler_config"] = profiler_config
    if profiler_rule_configurations is not None:
        input_["profiler_rule_configurations"] = profiler_rule_configurations
    if resource_config is not None:
        input_["resource_config"] = resource_config
    if remote_debug_config is not None:
        input_["remote_debug_config"] = remote_debug_config

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