sagemaker.serve.ai_inference_recommender.jobs#

Job subclasses that add show_result to the inference recommender resources.

Classes

BenchmarkJob(*, ai_benchmark_job_name[, ...])

AIBenchmarkJob with a one-shot result reader.

RecommendationJob(*, ai_recommendation_job_name)

AIRecommendationJob with a one-shot result reader.

class sagemaker.serve.ai_inference_recommender.jobs.BenchmarkJob(*, ai_benchmark_job_name: str | PipelineVariable, ai_benchmark_job_arn: str | PipelineVariable | None = Unassigned(), ai_benchmark_job_status: str | PipelineVariable | None = Unassigned(), failure_reason: str | PipelineVariable | None = Unassigned(), benchmark_target: AIBenchmarkTarget | None = Unassigned(), output_config: AIBenchmarkOutputResult | None = Unassigned(), ai_workload_config_identifier: str | PipelineVariable | None = Unassigned(), role_arn: str | PipelineVariable | None = Unassigned(), network_config: AIBenchmarkNetworkConfig | None = Unassigned(), creation_time: datetime | None = Unassigned(), start_time: datetime | None = Unassigned(), end_time: datetime | None = Unassigned(), tags: List[Tag] | None = Unassigned())[source]#

Bases: AIBenchmarkJob

AIBenchmarkJob with a one-shot result reader.

All standard lifecycle methods (refresh, wait, stop, delete) are inherited from the underlying resource; show_result is the only addition.

ai_benchmark_job_arn: str | PipelineVariable | None#
ai_benchmark_job_name: str | PipelineVariable#
ai_benchmark_job_status: str | PipelineVariable | None#
ai_workload_config_identifier: str | PipelineVariable | None#
benchmark_target: AIBenchmarkTarget | None#
creation_time: datetime | None#
end_time: datetime | None#
failure_reason: str | PipelineVariable | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

network_config: AIBenchmarkNetworkConfig | None#
output_config: AIBenchmarkOutputResult | None#
role_arn: str | PipelineVariable | None#
show_result()[source]#

Download the benchmark output from S3 and return a parsed result.

Returns:

parsed metrics and run metadata. The job must be in a terminal state; show_result calls refresh() once but does not poll.

Return type:

BenchmarkResult

start_time: datetime | None#
tags: List[Tag] | None#
class sagemaker.serve.ai_inference_recommender.jobs.RecommendationJob(*, ai_recommendation_job_name: str | PipelineVariable, ai_recommendation_job_arn: str | PipelineVariable | None = Unassigned(), ai_recommendation_job_status: str | PipelineVariable | None = Unassigned(), failure_reason: str | PipelineVariable | None = Unassigned(), model_source: AIModelSource | None = Unassigned(), output_config: AIRecommendationOutputResult | None = Unassigned(), inference_specification: AIRecommendationInferenceSpecification | None = Unassigned(), ai_workload_config_identifier: str | PipelineVariable | None = Unassigned(), optimize_model: bool | None = Unassigned(), performance_target: AIRecommendationPerformanceTarget | None = Unassigned(), recommendations: List[AIRecommendation] | None = Unassigned(), role_arn: str | PipelineVariable | None = Unassigned(), compute_spec: AIRecommendationComputeSpec | None = Unassigned(), creation_time: datetime | None = Unassigned(), start_time: datetime | None = Unassigned(), end_time: datetime | None = Unassigned(), tags: List[Tag] | None = Unassigned())[source]#

Bases: AIRecommendationJob

AIRecommendationJob with a one-shot result reader.

All standard lifecycle methods (refresh, wait, stop, delete) are inherited from the underlying resource; show_result is the only addition.

ai_recommendation_job_arn: str | PipelineVariable | None#
ai_recommendation_job_name: str | PipelineVariable#
ai_recommendation_job_status: str | PipelineVariable | None#
ai_workload_config_identifier: str | PipelineVariable | None#
compute_spec: AIRecommendationComputeSpec | None#
creation_time: datetime | None#
end_time: datetime | None#
failure_reason: str | PipelineVariable | None#
inference_specification: AIRecommendationInferenceSpecification | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_source: AIModelSource | None#
optimize_model: bool | None#
output_config: AIRecommendationOutputResult | None#
performance_target: AIRecommendationPerformanceTarget | None#
recommendations: List[AIRecommendation] | None#
role_arn: str | PipelineVariable | None#
show_result() _RecommendationsView[source]#

Return the ranked recommendations produced by the job.

Returns the same list-like view as ModelBuilder.recommendations: repr() renders a comparative table across rows, .best is the top-ranked row, and each row pretty-prints and forwards attribute access to the underlying service shape. The job must be in a terminal state; show_result calls refresh() once but does not poll.

start_time: datetime | None#
tags: List[Tag] | None#