/AWS1/IF_SGM=>CREATEAIRECOMMENDATIONJOB()¶
About CreateAIRecommendationJob¶
Creates a recommendation job that generates intelligent optimization recommendations for generative AI inference deployments. The job analyzes your model, workload configuration, and performance targets to recommend optimal instance types, model optimization techniques (such as quantization and speculative decoding), and deployment configurations.
Method Signature¶
METHODS /AWS1/IF_SGM~CREATEAIRECOMMENDATIONJOB
IMPORTING
!IV_AIRECOMMENDATIONJOBNAME TYPE /AWS1/SGMAIENTITYNAME OPTIONAL
!IO_MODELSOURCE TYPE REF TO /AWS1/CL_SGMAIMODELSOURCE OPTIONAL
!IO_OUTPUTCONFIG TYPE REF TO /AWS1/CL_SGMAIRECOUTPUTCONFIG OPTIONAL
!IV_AIWORKLOADCONFIGID TYPE /AWS1/SGMAIRESOURCEIDENTIFIER OPTIONAL
!IO_PERFORMANCETARGET TYPE REF TO /AWS1/CL_SGMAIRECPERFRMANCETGT OPTIONAL
!IV_ROLEARN TYPE /AWS1/SGMROLEARN OPTIONAL
!IO_INFERENCESPECIFICATION TYPE REF TO /AWS1/CL_SGMAIRECINFERENCESPEC OPTIONAL
!IV_OPTIMIZEMODEL TYPE /AWS1/SGMAIRECALLOWOPTMZTN OPTIONAL
!IO_COMPUTESPEC TYPE REF TO /AWS1/CL_SGMAIRECCOMPUTESPEC OPTIONAL
!IT_TAGS TYPE /AWS1/CL_SGMTAG=>TT_TAGLIST OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_sgmcreateairecjobrsp
RAISING
/AWS1/CX_SGMRESOURCEINUSE
/AWS1/CX_SGMRESOURCELIMITEXCD
/AWS1/CX_SGMRESOURCENOTFOUND
/AWS1/CX_SGMCLIENTEXC
/AWS1/CX_SGMSERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_airecommendationjobname TYPE /AWS1/SGMAIENTITYNAME /AWS1/SGMAIENTITYNAME¶
The name of the AI recommendation job. The name must be unique within your Amazon Web Services account in the current Amazon Web Services Region.
io_modelsource TYPE REF TO /AWS1/CL_SGMAIMODELSOURCE /AWS1/CL_SGMAIMODELSOURCE¶
The source of the model to optimize. Specify the Amazon S3 location of the model artifacts.
io_outputconfig TYPE REF TO /AWS1/CL_SGMAIRECOUTPUTCONFIG /AWS1/CL_SGMAIRECOUTPUTCONFIG¶
The output configuration for the recommendation job, including the Amazon S3 location for results and an optional model package group where the optimized model is registered.
iv_aiworkloadconfigid TYPE /AWS1/SGMAIRESOURCEIDENTIFIER /AWS1/SGMAIRESOURCEIDENTIFIER¶
The name or Amazon Resource Name (ARN) of the AI workload configuration to use for this recommendation job.
io_performancetarget TYPE REF TO /AWS1/CL_SGMAIRECPERFRMANCETGT /AWS1/CL_SGMAIRECPERFRMANCETGT¶
The performance targets for the recommendation job. Specify constraints on metrics such as time to first token (
ttft-ms),throughput, orcost.
iv_rolearn TYPE /AWS1/SGMROLEARN /AWS1/SGMROLEARN¶
The Amazon Resource Name (ARN) of an IAM role that enables Amazon SageMaker AI to perform tasks on your behalf.
Optional arguments:¶
io_inferencespecification TYPE REF TO /AWS1/CL_SGMAIRECINFERENCESPEC /AWS1/CL_SGMAIRECINFERENCESPEC¶
The inference framework configuration. Specify the framework (such as LMI or vLLM) for the recommendation job.
iv_optimizemodel TYPE /AWS1/SGMAIRECALLOWOPTMZTN /AWS1/SGMAIRECALLOWOPTMZTN¶
Whether to allow model optimization techniques such as quantization, speculative decoding, and kernel tuning. The default is
true.
io_computespec TYPE REF TO /AWS1/CL_SGMAIRECCOMPUTESPEC /AWS1/CL_SGMAIRECCOMPUTESPEC¶
The compute resource specification for the recommendation job. You can specify up to 3 instance types to consider, and optionally provide capacity reservation configuration.
it_tags TYPE /AWS1/CL_SGMTAG=>TT_TAGLIST TT_TAGLIST¶
The metadata that you apply to Amazon Web Services resources to help you categorize and organize them.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_sgmcreateairecjobrsp /AWS1/CL_SGMCREATEAIRECJOBRSP¶
Examples¶
Syntax Example¶
This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.
DATA(lo_result) = lo_client->createairecommendationjob(
io_computespec = new /aws1/cl_sgmaireccomputespec(
io_capacityreservationconfig = new /aws1/cl_sgmaicapresvconfig(
it_mlreservationarns = VALUE /aws1/cl_sgmaimlresvarnlist_w=>tt_aimlreservationarnlist(
( new /aws1/cl_sgmaimlresvarnlist_w( |string| ) )
)
iv_capreservationpreference = |string|
)
it_instancetypes = VALUE /aws1/cl_sgmairecinsttypelst_w=>tt_airecinstancetypelist(
( new /aws1/cl_sgmairecinsttypelst_w( |string| ) )
)
)
io_inferencespecification = new /aws1/cl_sgmairecinferencespec( |string| )
io_modelsource = new /aws1/cl_sgmaimodelsource( new /aws1/cl_sgmaimodelsources3( |string| ) )
io_outputconfig = new /aws1/cl_sgmairecoutputconfig(
iv_modelpackagegroupid = |string|
iv_s3outputlocation = |string|
)
io_performancetarget = new /aws1/cl_sgmairecperfrmancetgt(
it_constraints = VALUE /aws1/cl_sgmairecconstraint=>tt_airecconstraintlist(
( new /aws1/cl_sgmairecconstraint( |string| ) )
)
)
it_tags = VALUE /aws1/cl_sgmtag=>tt_taglist(
(
new /aws1/cl_sgmtag(
iv_key = |string|
iv_value = |string|
)
)
)
iv_airecommendationjobname = |string|
iv_aiworkloadconfigid = |string|
iv_optimizemodel = ABAP_TRUE
iv_rolearn = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
lv_airecommendationjobarn = lo_result->get_airecommendationjobarn( ).
ENDIF.