SageMakerTrainingSessionRuntime / Client / get_training_operation_result
get_training_operation_result¶
- SageMakerTrainingSessionRuntime.Client.get_training_operation_result(**kwargs)¶
Retrieves the current status and result of a previously submitted training operation. Poll this operation until the status reaches a terminal state (Completed, Failed, or Skipped).
See also: AWS API Documentation
Request Syntax
response = client.get_training_operation_result( trainingSessionName='string', operationId='string' )
- Parameters:
trainingSessionName (string) –
[REQUIRED]
The name of the training session that owns the operation.
operationId (string) –
[REQUIRED]
The unique identifier of the operation to retrieve, returned by
ExecuteTrainingOperation.
- Return type:
dict
- Returns:
Response Syntax
{ 'status': 'Pending'|'InProgress'|'Completed'|'Failed'|'Skipped', 'operationResult': { 'forward': { 'lossFnOutputType': 'string', 'lossFnOutputs': [ { 'string': { 'data': {...}|[...]|123|123.4|'string'|True|None, 'dtype': 'string', 'shape': [ 123, ] } }, ], 'metrics': { 'string': 123.0 }, 'tokenUsage': { 'trainingTokens': 123 } }, 'forwardBackward': { 'lossFnOutputType': 'string', 'lossFnOutputs': [ { 'string': { 'data': {...}|[...]|123|123.4|'string'|True|None, 'dtype': 'string', 'shape': [ 123, ] } }, ], 'metrics': { 'string': 123.0 }, 'tokenUsage': { 'trainingTokens': 123 } }, 'optimizerStep': { 'metrics': { 'string': 123.0 } }, 'saveWeights': { 'modelPackageArn': 'string' }, 'saveState': { 'modelPackageArn': 'string' }, 'loadState': {} }, 'errorDetails': 'string', 'tokenUsage': { 'trainingTokens': 123 } }
Response Structure
(dict) –
status (string) –
The current status of the operation. Possible values are
Pending,InProgress,Completed,Failed, orSkipped.operationResult (dict) –
The result payload of the operation. The service populates this field only when the status is
Completed. The populated member of the union corresponds to the operation type that was submitted.Note
This is a Tagged Union structure. Only one of the following top level keys will be set:
forward,forwardBackward,optimizerStep,saveWeights,saveState,loadState. If a client receives an unknown member it will setSDK_UNKNOWN_MEMBERas the top level key, which maps to the name or tag of the unknown member. The structure ofSDK_UNKNOWN_MEMBERis as follows:'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
forward (dict) –
The result from a forward-only pass.
lossFnOutputType (string) –
The data type of the loss function output tensors.
lossFnOutputs (list) –
The loss function output tensors, keyed by name.
(dict) –
(string) –
(dict) –
A tensor with data, data type, and shape metadata.
data (document) –
The raw tensor data as JSON. The format is determined by the
dtypefield: integer arrays forint64, floating-point arrays forfloat32.dtype (string) –
The data type of the tensor elements, such as
int64orfloat32.shape (list) –
The dimensions of the tensor, such as [batch_size, seq_length].
(integer) –
metrics (dict) –
The training metrics emitted by the engine, such as loss values.
(string) –
(float) –
tokenUsage (dict) –
The token usage statistics for metering.
trainingTokens (integer) –
The number of training tokens consumed by the operation.
forwardBackward (dict) –
The result from a forward and backward pass.
lossFnOutputType (string) –
The data type of the loss function output tensors.
lossFnOutputs (list) –
The loss function output tensors, keyed by name.
(dict) –
(string) –
(dict) –
A tensor with data, data type, and shape metadata.
data (document) –
The raw tensor data as JSON. The format is determined by the
dtypefield: integer arrays forint64, floating-point arrays forfloat32.dtype (string) –
The data type of the tensor elements, such as
int64orfloat32.shape (list) –
The dimensions of the tensor, such as [batch_size, seq_length].
(integer) –
metrics (dict) –
The training metrics emitted by the engine, such as loss values.
(string) –
(float) –
tokenUsage (dict) –
The token usage statistics for metering.
trainingTokens (integer) –
The number of training tokens consumed by the operation.
optimizerStep (dict) –
The result from an optimizer step.
metrics (dict) –
The training metrics emitted by the engine after the optimizer step.
(string) –
(float) –
saveWeights (dict) –
The result from saving model weights.
modelPackageArn (string) –
The ARN of the model package created for the saved weights.
saveState (dict) –
The result from saving full training state.
modelPackageArn (string) –
The ARN of the model package created for the saved state checkpoint.
loadState (dict) –
The result from loading training state.
errorDetails (string) –
A message describing why the operation failed. The service populates this field only when the status is
Failed.tokenUsage (dict) –
The token usage statistics for metering purposes. The service populates this field for forward and forwardBackward operations upon completion.
trainingTokens (integer) –
The number of training tokens consumed by the operation.
Exceptions