Skip to content

create_training_job async

create_training_job(
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    training_job_name: Optional[TrainingJobName] = None,
    hyper_parameters: Optional[HyperParameters] = None,
    algorithm_specification: Optional[AlgorithmSpecification] = None,
    role_arn: Optional[RoleArn] = None,
    input_data_config: Optional[InputDataConfig] = None,
    output_data_config: Optional[OutputDataConfig] = None,
    resource_config: Optional[ResourceConfig] = None,
    vpc_config: Optional[VpcConfig] = None,
    stopping_condition: Optional[StoppingCondition] = None,
    tags: Optional[TagList] = None,
    enable_network_isolation: Optional[Boolean] = None,
    enable_inter_container_traffic_encryption: Optional[Boolean] = None,
    enable_managed_spot_training: Optional[Boolean] = None,
    checkpoint_config: Optional[CheckpointConfig] = None,
    debug_hook_config: Optional[DebugHookConfig] = None,
    debug_rule_configurations: Optional[DebugRuleConfigurations] = None,
    tensor_board_output_config: Optional[TensorBoardOutputConfig] = None,
    experiment_config: Optional[ExperimentConfig] = None,
    profiler_config: Optional[ProfilerConfig] = None,
    profiler_rule_configurations: Optional[ProfilerRuleConfigurations] = None,
    environment: Optional[TrainingEnvironmentMap] = None,
    retry_strategy: Optional[RetryStrategy] = None,
    remote_debug_config: Optional[RemoteDebugConfig] = None,
    infra_check_config: Optional[InfraCheckConfig] = None,
    session_chaining_config: Optional[SessionChainingConfig] = None,
    serverless_job_config: Optional[ServerlessJobConfig] = None,
    mlflow_config: Optional[MlflowConfig] = None,
    model_package_config: Optional[ModelPackageConfig] = None,
) -> CreateTrainingJobResponse

Starts a model training job. After training completes, SageMaker saves the resulting model artifacts to an Amazon S3 location that you specify.

If you choose to host your model using SageMaker hosting services, you can use the resulting model artifacts as part of the model. You can also use the artifacts in a machine learning service other than SageMaker, provided that you know how to use them for inference.

In the request body, you provide the following:

  • AlgorithmSpecification - Identifies the training algorithm to use.

  • HyperParameters - Specify these algorithm-specific parameters to enable the estimation of model parameters during training. Hyperparameters can be tuned to optimize this learning process. For a list of hyperparameters for each training algorithm provided by SageMaker, see Algorithms.

    Do not include any security-sensitive information including account access IDs, secrets, or tokens in any hyperparameter fields. As part of the shared responsibility model, you are responsible for any potential exposure, unauthorized access, or compromise of your sensitive data if caused by security-sensitive information included in the request hyperparameter variable or plain text fields.

  • InputDataConfig - Describes the input required by the training job and the Amazon S3, EFS, or FSx location where it is stored.

  • OutputDataConfig - Identifies the Amazon S3 bucket where you want SageMaker to save the results of model training.

  • ResourceConfig - Identifies the resources, ML compute instances, and ML storage volumes to deploy for model training. In distributed training, you specify more than one instance.

  • EnableManagedSpotTraining - Optimize the cost of training machine learning models by up to 80% by using Amazon EC2 Spot instances. For more information, see Managed Spot Training.

  • RoleArn - The Amazon Resource Name (ARN) that SageMaker assumes to perform tasks on your behalf during model training. You must grant this role the necessary permissions so that SageMaker can successfully complete model training.

  • StoppingCondition - To help cap training costs, use MaxRuntimeInSeconds to set a time limit for training. Use MaxWaitTimeInSeconds to specify how long a managed spot training job has to complete.

  • Environment - The environment variables to set in the Docker container.

    Do not include any security-sensitive information including account access IDs, secrets, or tokens in any environment fields. As part of the shared responsibility model, you are responsible for any potential exposure, unauthorized access, or compromise of your sensitive data if caused by security-sensitive information included in the request environment variable or plain text fields.

  • RetryStrategy - The number of times to retry the job when the job fails due to an InternalServerError.

For more information about SageMaker, see How It Works.

Parameters:

  • training_job_name (Optional[TrainingJobName], default: None ) –

    The name of the training job. The name must be unique within an Amazon Web Services Region in an Amazon Web Services account.

  • hyper_parameters (Optional[HyperParameters], default: None ) –

    Algorithm-specific parameters that influence the quality of the model. You set hyperparameters before you start the learning process. For a list of hyperparameters for each training algorithm provided by SageMaker, see Algorithms.

    You can specify a maximum of 100 hyperparameters. Each hyperparameter is a key-value pair. Each key and value is limited to 256 characters, as specified by the Length Constraint.

    Do not include any security-sensitive information including account access IDs, secrets, or tokens in any hyperparameter fields. As part of the shared responsibility model, you are responsible for any potential exposure, unauthorized access, or compromise of your sensitive data if caused by any security-sensitive information included in the request hyperparameter variable or plain text fields.

  • algorithm_specification (Optional[AlgorithmSpecification], default: None ) –

    The registry path of the Docker image that contains the training algorithm and algorithm-specific metadata, including the input mode. For more information about algorithms provided by SageMaker, see Algorithms. For information about providing your own algorithms, see Using Your Own Algorithms with Amazon SageMaker.

  • role_arn (Optional[RoleArn], default: None ) –

    The Amazon Resource Name (ARN) of an IAM role that SageMaker can assume to perform tasks on your behalf.

    During model training, SageMaker needs your permission to read input data from an S3 bucket, download a Docker image that contains training code, write model artifacts to an S3 bucket, write logs to Amazon CloudWatch Logs, and publish metrics to Amazon CloudWatch. You grant permissions for all of these tasks to an IAM role. For more information, see SageMaker Roles.

    To be able to pass this role to SageMaker, the caller of this API must have the iam:PassRole permission.

  • input_data_config (Optional[InputDataConfig], default: None ) –

    An array of Channel objects. Each channel is a named input source. InputDataConfig describes the input data and its location.

    Algorithms can accept input data from one or more channels. For example, an algorithm might have two channels of input data, training_data and validation_data. The configuration for each channel provides the S3, EFS, or FSx location where the input data is stored. It also provides information about the stored data: the MIME type, compression method, and whether the data is wrapped in RecordIO format.

    Depending on the input mode that the algorithm supports, SageMaker either copies input data files from an S3 bucket to a local directory in the Docker container, or makes it available as input streams. For example, if you specify an EFS location, input data files are available as input streams. They do not need to be downloaded.

    Your input must be in the same Amazon Web Services region as your training job.

  • output_data_config (Optional[OutputDataConfig], default: None ) –

    Specifies the path to the S3 location where you want to store model artifacts. SageMaker creates subfolders for the artifacts.

  • resource_config (Optional[ResourceConfig], default: None ) –

    The resources, including the ML compute instances and ML storage volumes, to use for model training.

    ML storage volumes store model artifacts and incremental states. Training algorithms might also use ML storage volumes for scratch space. If you want SageMaker to use the ML storage volume to store the training data, choose File as the TrainingInputMode in the algorithm specification. For distributed training algorithms, specify an instance count greater than 1.

  • vpc_config (Optional[VpcConfig], default: None ) –

    A VpcConfig object that specifies the VPC that you want your training job to connect to. Control access to and from your training container by configuring the VPC. For more information, see Protect Training Jobs by Using an Amazon Virtual Private Cloud.

  • stopping_condition (Optional[StoppingCondition], default: None ) –

    Specifies a limit to how long a model training job can run. It also specifies how long a managed Spot training job has to complete. When the job reaches the time limit, SageMaker ends the training job. Use this API to cap model training costs.

    To stop a job, SageMaker sends the algorithm the SIGTERM signal, which delays job termination for 120 seconds. Algorithms can use this 120-second window to save the model artifacts, so the results of training are not lost.

  • tags (Optional[TagList], default: None ) –

    An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in different ways, for example, by purpose, owner, or environment. For more information, see Tagging Amazon Web Services Resources.

    Do not include any security-sensitive information including account access IDs, secrets, or tokens in any tags. As part of the shared responsibility model, you are responsible for any potential exposure, unauthorized access, or compromise of your sensitive data if caused by any security-sensitive information included in the request tag variable or plain text fields.

  • enable_network_isolation (Optional[Boolean], default: None ) –

    Isolates the training container. No inbound or outbound network calls can be made, except for calls between peers within a training cluster for distributed training. If you enable network isolation for training jobs that are configured to use a VPC, SageMaker downloads and uploads customer data and model artifacts through the specified VPC, but the training container does not have network access.

  • enable_inter_container_traffic_encryption (Optional[Boolean], default: None ) –

    To encrypt all communications between ML compute instances in distributed training, choose True. Encryption provides greater security for distributed training, but training might take longer. How long it takes depends on the amount of communication between compute instances, especially if you use a deep learning algorithm in distributed training. For more information, see Protect Communications Between ML Compute Instances in a Distributed Training Job.

  • enable_managed_spot_training (Optional[Boolean], default: None ) –

    To train models using managed spot training, choose True. Managed spot training provides a fully managed and scalable infrastructure for training machine learning models. this option is useful when training jobs can be interrupted and when there is flexibility when the training job is run.

    The complete and intermediate results of jobs are stored in an Amazon S3 bucket, and can be used as a starting point to train models incrementally. Amazon SageMaker provides metrics and logs in CloudWatch. They can be used to see when managed spot training jobs are running, interrupted, resumed, or completed.

  • checkpoint_config (Optional[CheckpointConfig], default: None ) –

    Contains information about the output location for managed spot training checkpoint data.

  • debug_rule_configurations (Optional[DebugRuleConfigurations], default: None ) –

    Configuration information for Amazon SageMaker Debugger rules for debugging output tensors.

  • profiler_rule_configurations (Optional[ProfilerRuleConfigurations], default: None ) –

    Configuration information for Amazon SageMaker Debugger rules for profiling system and framework metrics.

  • environment (Optional[TrainingEnvironmentMap], default: None ) –

    The environment variables to set in the Docker container.

    Do not include any security-sensitive information including account access IDs, secrets, or tokens in any environment fields. As part of the shared responsibility model, you are responsible for any potential exposure, unauthorized access, or compromise of your sensitive data if caused by security-sensitive information included in the request environment variable or plain text fields.

  • retry_strategy (Optional[RetryStrategy], default: None ) –

    The number of times to retry the job when the job fails due to an InternalServerError.

  • remote_debug_config (Optional[RemoteDebugConfig], default: None ) –

    Configuration for remote debugging. To learn more about the remote debugging functionality of SageMaker, see Access a training container through Amazon Web Services Systems Manager (SSM) for remote debugging.

  • infra_check_config (Optional[InfraCheckConfig], default: None ) –

    Contains information about the infrastructure health check configuration for the training job.

  • session_chaining_config (Optional[SessionChainingConfig], default: None ) –

    Contains information about attribute-based access control (ABAC) for the training job.

  • serverless_job_config (Optional[ServerlessJobConfig], default: None ) –

    The configuration for serverless training jobs.

  • mlflow_config (Optional[MlflowConfig], default: None ) –

    The MLflow configuration using SageMaker managed MLflow.

  • model_package_config (Optional[ModelPackageConfig], default: None ) –

    The configuration for the model package.

Raises:

  • ResourceInUse –

    Resource being accessed is in use.

  • ResourceLimitExceeded –

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

  • ResourceNotFound –

    Resource being access is not found.

  • UnknownServiceError –

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

Source code in docs_src/capo_sagemaker/_services/async_sage_maker.py
async def create_training_job(
    self,
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    training_job_name: Optional[
        "capo_sagemaker.types.training_job_name.TrainingJobName"
    ] = None,
    hyper_parameters: Optional[
        "capo_sagemaker.types.hyper_parameters.HyperParameters"
    ] = None,
    algorithm_specification: Optional[
        "capo_sagemaker.types.algorithm_specification.AlgorithmSpecification"
    ] = None,
    role_arn: Optional["capo_sagemaker.types.role_arn.RoleArn"] = None,
    input_data_config: Optional[
        "capo_sagemaker.types.input_data_config.InputDataConfig"
    ] = None,
    output_data_config: Optional[
        "capo_sagemaker.types.output_data_config.OutputDataConfig"
    ] = None,
    resource_config: Optional[
        "capo_sagemaker.types.resource_config.ResourceConfig"
    ] = None,
    vpc_config: Optional["capo_sagemaker.types.vpc_config.VpcConfig"] = None,
    stopping_condition: Optional[
        "capo_sagemaker.types.stopping_condition.StoppingCondition"
    ] = None,
    tags: Optional["capo_sagemaker.types.tag_list.TagList"] = None,
    enable_network_isolation: Optional[
        "capo_sagemaker.types.boolean.Boolean"
    ] = None,
    enable_inter_container_traffic_encryption: Optional[
        "capo_sagemaker.types.boolean.Boolean"
    ] = None,
    enable_managed_spot_training: Optional[
        "capo_sagemaker.types.boolean.Boolean"
    ] = None,
    checkpoint_config: Optional[
        "capo_sagemaker.types.checkpoint_config.CheckpointConfig"
    ] = None,
    debug_hook_config: Optional[
        "capo_sagemaker.types.debug_hook_config.DebugHookConfig"
    ] = None,
    debug_rule_configurations: Optional[
        "capo_sagemaker.types.debug_rule_configurations.DebugRuleConfigurations"
    ] = None,
    tensor_board_output_config: Optional[
        "capo_sagemaker.types.tensor_board_output_config.TensorBoardOutputConfig"
    ] = None,
    experiment_config: Optional[
        "capo_sagemaker.types.experiment_config.ExperimentConfig"
    ] = None,
    profiler_config: Optional[
        "capo_sagemaker.types.profiler_config.ProfilerConfig"
    ] = None,
    profiler_rule_configurations: Optional[
        "capo_sagemaker.types.profiler_rule_configurations.ProfilerRuleConfigurations"
    ] = None,
    environment: Optional[
        "capo_sagemaker.types.training_environment_map.TrainingEnvironmentMap"
    ] = None,
    retry_strategy: Optional[
        "capo_sagemaker.types.retry_strategy.RetryStrategy"
    ] = None,
    remote_debug_config: Optional[
        "capo_sagemaker.types.remote_debug_config.RemoteDebugConfig"
    ] = None,
    infra_check_config: Optional[
        "capo_sagemaker.types.infra_check_config.InfraCheckConfig"
    ] = None,
    session_chaining_config: Optional[
        "capo_sagemaker.types.session_chaining_config.SessionChainingConfig"
    ] = None,
    serverless_job_config: Optional[
        "capo_sagemaker.types.serverless_job_config.ServerlessJobConfig"
    ] = None,
    mlflow_config: Optional[
        "capo_sagemaker.types.mlflow_config.MlflowConfig"
    ] = None,
    model_package_config: Optional[
        "capo_sagemaker.types.model_package_config.ModelPackageConfig"
    ] = None,
) -> "capo_sagemaker.types.create_training_job_response.CreateTrainingJobResponse":
    """<p>Starts a model training job. After training completes, SageMaker saves the resulting model artifacts to an Amazon S3 location that you specify. </p> <p>If you choose to host your model using SageMaker hosting services, you can use the resulting model artifacts as part of the model. You can also use the artifacts in a machine learning service other than SageMaker, provided that you know how to use them for inference. </p> <p>In the request body, you provide the following: </p> <ul> <li> <p> <code>AlgorithmSpecification</code> - Identifies the training algorithm to use. </p> </li> <li> <p> <code>HyperParameters</code> - Specify these algorithm-specific parameters to enable the estimation of model parameters during training. Hyperparameters can be tuned to optimize this learning process. For a list of hyperparameters for each training algorithm provided by SageMaker, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/algos.html">Algorithms</a>. </p> <important> <p>Do not include any security-sensitive information including account access IDs, secrets, or tokens in any hyperparameter fields. As part of the shared responsibility model, you are responsible for any potential exposure, unauthorized access, or compromise of your sensitive data if caused by security-sensitive information included in the request hyperparameter variable or plain text fields.</p> </important> </li> <li> <p> <code>InputDataConfig</code> - Describes the input required by the training job and the Amazon S3, EFS, or FSx location where it is stored.</p> </li> <li> <p> <code>OutputDataConfig</code> - Identifies the Amazon S3 bucket where you want SageMaker to save the results of model training. </p> </li> <li> <p> <code>ResourceConfig</code> - Identifies the resources, ML compute instances, and ML storage volumes to deploy for model training. In distributed training, you specify more than one instance. </p> </li> <li> <p> <code>EnableManagedSpotTraining</code> - Optimize the cost of training machine learning models by up to 80% by using Amazon EC2 Spot instances. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/model-managed-spot-training.html">Managed Spot Training</a>. </p> </li> <li> <p> <code>RoleArn</code> - The Amazon Resource Name (ARN) that SageMaker assumes to perform tasks on your behalf during model training. You must grant this role the necessary permissions so that SageMaker can successfully complete model training. </p> </li> <li> <p> <code>StoppingCondition</code> - To help cap training costs, use <code>MaxRuntimeInSeconds</code> to set a time limit for training. Use <code>MaxWaitTimeInSeconds</code> to specify how long a managed spot training job has to complete. </p> </li> <li> <p> <code>Environment</code> - The environment variables to set in the Docker container.</p> <important> <p>Do not include any security-sensitive information including account access IDs, secrets, or tokens in any environment fields. As part of the shared responsibility model, you are responsible for any potential exposure, unauthorized access, or compromise of your sensitive data if caused by security-sensitive information included in the request environment variable or plain text fields.</p> </important> </li> <li> <p> <code>RetryStrategy</code> - The number of times to retry the job when the job fails due to an <code>InternalServerError</code>.</p> </li> </ul> <p> For more information about SageMaker, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/how-it-works.html">How It Works</a>. </p>

    Args:
        training_job_name: <p>The name of the training job. The name must be unique within an Amazon Web Services Region in an Amazon Web Services account. </p>
        hyper_parameters: <p>Algorithm-specific parameters that influence the quality of the model. You set hyperparameters before you start the learning process. For a list of hyperparameters for each training algorithm provided by SageMaker, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/algos.html">Algorithms</a>. </p> <p>You can specify a maximum of 100 hyperparameters. Each hyperparameter is a key-value pair. Each key and value is limited to 256 characters, as specified by the <code>Length Constraint</code>. </p> <important> <p>Do not include any security-sensitive information including account access IDs, secrets, or tokens in any hyperparameter fields. As part of the shared responsibility model, you are responsible for any potential exposure, unauthorized access, or compromise of your sensitive data if caused by any security-sensitive information included in the request hyperparameter variable or plain text fields.</p> </important>
        algorithm_specification: <p>The registry path of the Docker image that contains the training algorithm and algorithm-specific metadata, including the input mode. For more information about algorithms provided by SageMaker, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/algos.html">Algorithms</a>. For information about providing your own algorithms, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms.html">Using Your Own Algorithms with Amazon SageMaker</a>. </p>
        role_arn: <p>The Amazon Resource Name (ARN) of an IAM role that SageMaker can assume to perform tasks on your behalf. </p> <p>During model training, SageMaker needs your permission to read input data from an S3 bucket, download a Docker image that contains training code, write model artifacts to an S3 bucket, write logs to Amazon CloudWatch Logs, and publish metrics to Amazon CloudWatch. You grant permissions for all of these tasks to an IAM role. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-roles.html">SageMaker Roles</a>. </p> <note> <p>To be able to pass this role to SageMaker, the caller of this API must have the <code>iam:PassRole</code> permission.</p> </note>
        input_data_config: <p>An array of <code>Channel</code> objects. Each channel is a named input source. <code>InputDataConfig</code> describes the input data and its location. </p> <p>Algorithms can accept input data from one or more channels. For example, an algorithm might have two channels of input data, <code>training_data</code> and <code>validation_data</code>. The configuration for each channel provides the S3, EFS, or FSx location where the input data is stored. It also provides information about the stored data: the MIME type, compression method, and whether the data is wrapped in RecordIO format. </p> <p>Depending on the input mode that the algorithm supports, SageMaker either copies input data files from an S3 bucket to a local directory in the Docker container, or makes it available as input streams. For example, if you specify an EFS location, input data files are available as input streams. They do not need to be downloaded.</p> <p>Your input must be in the same Amazon Web Services region as your training job.</p>
        output_data_config: <p>Specifies the path to the S3 location where you want to store model artifacts. SageMaker creates subfolders for the artifacts. </p>
        resource_config: <p>The resources, including the ML compute instances and ML storage volumes, to use for model training. </p> <p>ML storage volumes store model artifacts and incremental states. Training algorithms might also use ML storage volumes for scratch space. If you want SageMaker to use the ML storage volume to store the training data, choose <code>File</code> as the <code>TrainingInputMode</code> in the algorithm specification. For distributed training algorithms, specify an instance count greater than 1.</p>
        vpc_config: <p>A <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_VpcConfig.html">VpcConfig</a> object that specifies the VPC that you want your training job to connect to. Control access to and from your training container by configuring the VPC. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/train-vpc.html">Protect Training Jobs by Using an Amazon Virtual Private Cloud</a>.</p>
        stopping_condition: <p>Specifies a limit to how long a model training job can run. It also specifies how long a managed Spot training job has to complete. When the job reaches the time limit, SageMaker ends the training job. Use this API to cap model training costs.</p> <p>To stop a job, SageMaker sends the algorithm the <code>SIGTERM</code> signal, which delays job termination for 120 seconds. Algorithms can use this 120-second window to save the model artifacts, so the results of training are not lost. </p>
        tags: <p>An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in different ways, for example, by purpose, owner, or environment. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services Resources</a>.</p> <important> <p>Do not include any security-sensitive information including account access IDs, secrets, or tokens in any tags. As part of the shared responsibility model, you are responsible for any potential exposure, unauthorized access, or compromise of your sensitive data if caused by any security-sensitive information included in the request tag variable or plain text fields.</p> </important>
        enable_network_isolation: <p>Isolates the training container. No inbound or outbound network calls can be made, except for calls between peers within a training cluster for distributed training. If you enable network isolation for training jobs that are configured to use a VPC, SageMaker downloads and uploads customer data and model artifacts through the specified VPC, but the training container does not have network access.</p>
        enable_inter_container_traffic_encryption: <p>To encrypt all communications between ML compute instances in distributed training, choose <code>True</code>. Encryption provides greater security for distributed training, but training might take longer. How long it takes depends on the amount of communication between compute instances, especially if you use a deep learning algorithm in distributed training. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/train-encrypt.html">Protect Communications Between ML Compute Instances in a Distributed Training Job</a>.</p>
        enable_managed_spot_training: <p>To train models using managed spot training, choose <code>True</code>. Managed spot training provides a fully managed and scalable infrastructure for training machine learning models. this option is useful when training jobs can be interrupted and when there is flexibility when the training job is run. </p> <p>The complete and intermediate results of jobs are stored in an Amazon S3 bucket, and can be used as a starting point to train models incrementally. Amazon SageMaker provides metrics and logs in CloudWatch. They can be used to see when managed spot training jobs are running, interrupted, resumed, or completed. </p>
        checkpoint_config: <p>Contains information about the output location for managed spot training checkpoint data.</p>
        debug_rule_configurations: <p>Configuration information for Amazon SageMaker Debugger rules for debugging output tensors.</p>
        profiler_rule_configurations: <p>Configuration information for Amazon SageMaker Debugger rules for profiling system and framework metrics.</p>
        environment: <p>The environment variables to set in the Docker container.</p> <important> <p>Do not include any security-sensitive information including account access IDs, secrets, or tokens in any environment fields. As part of the shared responsibility model, you are responsible for any potential exposure, unauthorized access, or compromise of your sensitive data if caused by security-sensitive information included in the request environment variable or plain text fields.</p> </important>
        retry_strategy: <p>The number of times to retry the job when the job fails due to an <code>InternalServerError</code>.</p>
        remote_debug_config: <p>Configuration for remote debugging. 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>
        infra_check_config: <p>Contains information about the infrastructure health check configuration for the training job.</p>
        session_chaining_config: <p>Contains information about attribute-based access control (ABAC) for the training job.</p>
        serverless_job_config: <p> The configuration for serverless training jobs. </p>
        mlflow_config: <p> The MLflow configuration using SageMaker managed MLflow. </p>
        model_package_config: <p> The configuration for the model package. </p>

    Raises:
        capo_sagemaker.errors.resource_in_use.ResourceInUse: <p>Resource being accessed is in use.</p>
        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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_sagemaker.types.create_training_job_request.CreateTrainingJobRequest]",
    ) -> AsyncOperationResponse[
        "capo_sagemaker.types.create_training_job_response.CreateTrainingJobResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.create_training_job

        (
            output,
            http_response,
        ) = await capo_sagemaker._operations.sage_maker.create_training_job.async_create_training_job(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateTrainingJob")
    )
    input_: capo_sagemaker.types.create_training_job_request.CreateTrainingJobRequest = {}
    if training_job_name is not None:
        input_["training_job_name"] = training_job_name
    if hyper_parameters is not None:
        input_["hyper_parameters"] = hyper_parameters
    if algorithm_specification is not None:
        input_["algorithm_specification"] = algorithm_specification
    if role_arn is not None:
        input_["role_arn"] = role_arn
    if input_data_config is not None:
        input_["input_data_config"] = input_data_config
    if output_data_config is not None:
        input_["output_data_config"] = output_data_config
    if resource_config is not None:
        input_["resource_config"] = resource_config
    if vpc_config is not None:
        input_["vpc_config"] = vpc_config
    if stopping_condition is not None:
        input_["stopping_condition"] = stopping_condition
    if tags is not None:
        input_["tags"] = tags
    if enable_network_isolation is not None:
        input_["enable_network_isolation"] = enable_network_isolation
    if enable_inter_container_traffic_encryption is not None:
        input_["enable_inter_container_traffic_encryption"] = (
            enable_inter_container_traffic_encryption
        )
    if enable_managed_spot_training is not None:
        input_["enable_managed_spot_training"] = enable_managed_spot_training
    if checkpoint_config is not None:
        input_["checkpoint_config"] = checkpoint_config
    if debug_hook_config is not None:
        input_["debug_hook_config"] = debug_hook_config
    if debug_rule_configurations is not None:
        input_["debug_rule_configurations"] = debug_rule_configurations
    if tensor_board_output_config is not None:
        input_["tensor_board_output_config"] = tensor_board_output_config
    if experiment_config is not None:
        input_["experiment_config"] = experiment_config
    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 environment is not None:
        input_["environment"] = environment
    if retry_strategy is not None:
        input_["retry_strategy"] = retry_strategy
    if remote_debug_config is not None:
        input_["remote_debug_config"] = remote_debug_config
    if infra_check_config is not None:
        input_["infra_check_config"] = infra_check_config
    if session_chaining_config is not None:
        input_["session_chaining_config"] = session_chaining_config
    if serverless_job_config is not None:
        input_["serverless_job_config"] = serverless_job_config
    if mlflow_config is not None:
        input_["mlflow_config"] = mlflow_config
    if model_package_config is not None:
        input_["model_package_config"] = model_package_config

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output