Skip to content

create_ai_benchmark_job

create_ai_benchmark_job(
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    ai_benchmark_job_name: Optional[AIEntityName] = None,
    benchmark_target: Optional[AIBenchmarkTarget] = None,
    output_config: Optional[AIBenchmarkOutputConfig] = None,
    ai_workload_config_identifier: Optional[AIResourceIdentifier] = None,
    role_arn: Optional[RoleArn] = None,
    network_config: Optional[AIBenchmarkNetworkConfig] = None,
    tags: Optional[TagList] = None,
) -> CreateAIBenchmarkJobResponse

Creates a benchmark job that runs performance benchmarks against inference infrastructure using a predefined AI workload configuration. The benchmark job measures metrics such as latency, throughput, and cost for your generative AI inference endpoints.

Parameters:

  • ai_benchmark_job_name (Optional[AIEntityName], default: None ) –

    The name of the AI benchmark job. The name must be unique within your Amazon Web Services account in the current Amazon Web Services Region.

  • benchmark_target (Optional[AIBenchmarkTarget], default: None ) –

    The target endpoint to benchmark. Specify a SageMaker endpoint by providing its name or Amazon Resource Name (ARN).

  • output_config (Optional[AIBenchmarkOutputConfig], default: None ) –

    The output configuration for the benchmark job, including the Amazon S3 location where benchmark results are stored.

  • ai_workload_config_identifier (Optional[AIResourceIdentifier], default: None ) –

    The name or Amazon Resource Name (ARN) of the AI workload configuration to use for this benchmark job.

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

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

  • network_config (Optional[AIBenchmarkNetworkConfig], default: None ) –

    The network configuration for the benchmark job, including VPC settings.

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

    The metadata that you apply to Amazon Web Services resources to help you categorize and organize them. Each tag consists of a key and a value, both of which you define.

Raises:

Source code in docs_src/capo_sagemaker/_services/sage_maker.py
def create_ai_benchmark_job(
    self,
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    ai_benchmark_job_name: Optional[
        "capo_sagemaker.types.ai_entity_name.AIEntityName"
    ] = None,
    benchmark_target: Optional[
        "capo_sagemaker.types.ai_benchmark_target.AIBenchmarkTarget"
    ] = None,
    output_config: Optional[
        "capo_sagemaker.types.ai_benchmark_output_config.AIBenchmarkOutputConfig"
    ] = None,
    ai_workload_config_identifier: Optional[
        "capo_sagemaker.types.ai_resource_identifier.AIResourceIdentifier"
    ] = None,
    role_arn: Optional["capo_sagemaker.types.role_arn.RoleArn"] = None,
    network_config: Optional[
        "capo_sagemaker.types.ai_benchmark_network_config.AIBenchmarkNetworkConfig"
    ] = None,
    tags: Optional["capo_sagemaker.types.tag_list.TagList"] = None,
) -> "capo_sagemaker.types.create_ai_benchmark_job_response.CreateAIBenchmarkJobResponse":
    """<p>Creates a benchmark job that runs performance benchmarks against inference infrastructure using a predefined AI workload configuration. The benchmark job measures metrics such as latency, throughput, and cost for your generative AI inference endpoints.</p>

    Args:
        ai_benchmark_job_name: <p>The name of the AI benchmark job. The name must be unique within your Amazon Web Services account in the current Amazon Web Services Region.</p>
        benchmark_target: <p>The target endpoint to benchmark. Specify a SageMaker endpoint by providing its name or Amazon Resource Name (ARN).</p>
        output_config: <p>The output configuration for the benchmark job, including the Amazon S3 location where benchmark results are stored.</p>
        ai_workload_config_identifier: <p>The name or Amazon Resource Name (ARN) of the AI workload configuration to use for this benchmark job.</p>
        role_arn: <p>The Amazon Resource Name (ARN) of an IAM role that enables Amazon SageMaker AI to perform tasks on your behalf.</p>
        network_config: <p>The network configuration for the benchmark job, including VPC settings.</p>
        tags: <p>The metadata that you apply to Amazon Web Services resources to help you categorize and organize them. Each tag consists of a key and a value, both of which you define.</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.
    """

    def _handler(
        req: "OperationRequest[capo_sagemaker.types.create_ai_benchmark_job_request.CreateAIBenchmarkJobRequest]",
    ) -> OperationResponse[
        "capo_sagemaker.types.create_ai_benchmark_job_response.CreateAIBenchmarkJobResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.create_ai_benchmark_job

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateAIBenchmarkJob")
    )
    input_: capo_sagemaker.types.create_ai_benchmark_job_request.CreateAIBenchmarkJobRequest = {}
    if ai_benchmark_job_name is not None:
        input_["ai_benchmark_job_name"] = ai_benchmark_job_name
    if benchmark_target is not None:
        input_["benchmark_target"] = benchmark_target
    if output_config is not None:
        input_["output_config"] = output_config
    if ai_workload_config_identifier is not None:
        input_["ai_workload_config_identifier"] = ai_workload_config_identifier
    if role_arn is not None:
        input_["role_arn"] = role_arn
    if network_config is not None:
        input_["network_config"] = network_config
    if tags is not None:
        input_["tags"] = tags

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