GetTrainingJob

更新时间:
复制 MD 格式

Get training job details.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request syntax

GET /api/v1/trainingjobs/{TrainingJobId} HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

TrainingJobId

string

Yes

The ID of the training job.

train129f212o89d

Request parameters

Parameter

Type

Required

Description

Example

No parameters required.

Response elements

Element

Type

Description

Example

object

OutputChannels

array<object>

The configurations for the output data channels of the training job.

object

The configuration for an output data channel.

Name

string

The name of the output data.

model

OutputUri

string

The URI of the output data.

oss://test-bucket.oss-cn-hangzhou-internal.aliyuncs.com/path/to/output/model/

DatasetId

string

The dataset ID.

d-8o0hh35po15ejcdq2p

VersionName

string

The dataset version.

v1

Status

string

The status of the training job.

Running

HyperParameters

array<object>

The hyperparameter settings for the training job.

object

A hyperparameter for the training job.

Name

string

The name of the hyperparameter.

learning_rate

Value

string

The value of the hyperparameter.

0.0001

TrainingJobName

string

The training job name.

qwen_llm

TrainingJobId

string

The training job ID.

traini6hhxiq69eo

Scheduler

object

The scheduling configuration for the training job.

MaxRunningTimeInSeconds

string

The maximum runtime of the training job, in seconds. If the value is 0, the runtime is not limited.

0

MaxRunningTimeInMinutes

string

The maximum runtime, in minutes.

100

ReasonMessage

string

The reason for the training job failure.

None

WorkspaceId

string

The workspace ID.

86995

ComputeResource

object

The compute resource configuration.

EcsCount

integer

The number of ECS instances.

1

EcsSpec

string

The ECS instance type.

ecs.gn5-c8g1.2xlarge

ResourceId

string

The resource quota ID.

quotam670lixikcl

ResourceName

string

The resource quota name.

quota

InstanceCount

integer

The number of instances used from the resource quota.

1

InstanceSpec

object

The instance specification for the resource quota.

CPU

string

The number of vCPUs for the instance.

8

Memory

string

The memory size for the instance, in GiB.

32

SharedMemory

string

The shared memory size for the instance, in GiB.

32

GPU

string

The number of GPUs for the instance.

1

GPUType

string

The GPU type of the instance.

V100

UseSpotInstance

boolean

Indicates whether to use spot instances.

true

SpotSpec

object

The configuration for spot instances.

SpotStrategy

string

The bidding policy for the spot instance. Valid values:

  • SpotWithPriceLimit: Sets a maximum price for the spot instance.

  • SpotAsPriceGo: The system automatically places bids based on the real-time market price.

SpotWithPriceLimit

SpotDiscountLimit

number

The maximum hourly price for the spot instance. This parameter applies only when SpotStrategy is set to SpotWithPriceLimit.

0.9

Labels

array<object>

The labels for the training job.

object

A label for the training job.

Key

string

The label key.

CreatedBy

Value

string

The label value.

QuickStart

AlgorithmProvider

string

The algorithm provider.

pai

InputChannels

array<object>

The configurations for the input data channels of the training job.

object

The configuration for an input data channel.

DatasetId

string

The dataset ID.

d-475megosidivjfgfq6

Name

string

The name of the input data.

model

InputUri

string

The URI of the input data.

oss://test-bucket.oss-cn-hangzhou-internal.aliyuncs.com/path/to/input/model/

Options

string

The file system parameters for the input data.

ossAppendable=true

VersionName

string

The dataset version.

v1

AlgorithmName

string

The algorithm name.

llm_training

ReasonCode

string

The reason code for the training job's status.

TrainingJobSucceed

GmtModifiedTime

string

The time when the training job status was last updated.

2024-07-10T11:49:47Z

StatusTransitions

array<object>

The status transitions for the training job.

object

A status transition of the training job.

EndTime

string

The end time of the status.

2024-07-10T11:49:47Z

ReasonCode

string

The status code.

TrainingJobSucceed

ReasonMessage

string

The message for the status update.

KubeDL job runs successfully

StartTime

string

The start time of the status.

2024-07-10T11:49:47Z

Status

string

The status.

Creating

TrainingJobDescription

string

The training job description.

Qwen2大语言模型训练。

UserId

string

The user ID.

123456789

AlgorithmVersion

string

The algorithm version.

v0.0.1

LatestMetrics

array<object>

The latest metrics for the training job.

object

A monitoring metric for the training job.

Name

string

The name of the metric.

loss

Timestamp

string

The time when the metric was collected.

2024-07-10T11:49:47Z

Value

number

The value of the metric.

0.11

GmtCreateTime

string

The time when the training job was created.

2024-07-10T11:49:47Z

RequestId

string

The request ID.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

Instances

array<object>

The instances for the training job.

object

A training job instance.

Name

string

The instance name.

train1oug3yehan4-master-0

Role

string

The instance role.

master

Status

string

The instance status.

Succeeded

AlgorithmId

string

The training algorithm ID.

algo-xsldfvu1334

TrainingJobUrl

string

The URL of the training job details page.

https://pai.console.aliyun.com/?regionId=cn-hangzhou&workspaceId=1234#/training/jobs/train1ouyadsl8n4

RoleArn

string

The Alibaba Cloud Resource Name (ARN) of the RAM role used for delegated authorization.

acs:ram::{accountID}:role/{roleName}

AlgorithmSpec AlgorithmSpec

The definition of the temporary algorithm.

IsTempAlgo

boolean

Indicates whether a temporary algorithm is used.

true

LatestProgress

object

The latest progress of the training job.

OverallProgress

object

The overall progress of the training job.

Timestamp

string

The timestamp of the progress update.

2023-07-04T13:20:18Z

Value

number

The progress value.

0.75

RemainingTime

object

The estimated remaining time for the training job to complete, in seconds.

Timestamp

string

The timestamp of the progress update.

2023-07-04T13:20:18Z

Value

integer

The remaining time, in seconds.

3600

UserVpc

object

The user's VPC configuration.

VpcId

string

The VPC ID.

vpc-abcdef****

SwitchId

string

The vSwitch ID.

vs-abcdef****

SecurityGroupId

string

The security group ID.

sg-abcdef****

ExtendedCIDRs

array

The configuration for the extended CIDR blocks.

string

An extended CIDR block.

192.168.0.1/24

OutputModel

object

The model generated by the training job.

Uri

string

The URI of the model.

oss://test-bucket.oss-cn-hangzhou-internal.aliyuncs.com/path/to/model/output/

OutputChannelName

string

The name of the output channel for the model.

model

Settings JobSettings

The additional settings for the training job.

ExperimentConfig

object

The configuration of the experiment associated with the training job.

ExperimentId

string

The ID of the associated experiment.

exp-ds9aefia90v

ExperimentName

string

The name of the associated experiment.

large_language_model_train

Duration

integer

The duration of the training job, in seconds.

7200

Environments

object

The environment variables for the training job.

string

An environment variable for the training job.

debug=true

PythonRequirements

array

The required Python packages for the training job.

string

A required Python package for the training job.

torch>=2.2.0

Priority

integer

The priority of the training job.

0

AssignNodeSpec

AssignNodeSpec

Examples

Success response

JSON format

{
  "OutputChannels": [
    {
      "Name": "model",
      "OutputUri": "oss://test-bucket.oss-cn-hangzhou-internal.aliyuncs.com/path/to/output/model/",
      "DatasetId": "d-8o0hh35po15ejcdq2p",
      "VersionName": "v1"
    }
  ],
  "Status": "Running",
  "HyperParameters": [
    {
      "Name": "learning_rate",
      "Value": "0.0001"
    }
  ],
  "TrainingJobName": "qwen_llm",
  "TrainingJobId": "traini6hhxiq69eo",
  "Scheduler": {
    "MaxRunningTimeInSeconds": "0",
    "MaxRunningTimeInMinutes": "100"
  },
  "ReasonMessage": "None",
  "WorkspaceId": "86995",
  "ComputeResource": {
    "EcsCount": 1,
    "EcsSpec": "ecs.gn5-c8g1.2xlarge",
    "ResourceId": "quotam670lixikcl",
    "ResourceName": "quota",
    "InstanceCount": 1,
    "InstanceSpec": {
      "CPU": "8",
      "Memory": "32",
      "SharedMemory": "32",
      "GPU": "1",
      "GPUType": "V100"
    },
    "UseSpotInstance": true,
    "SpotSpec": {
      "SpotStrategy": "SpotWithPriceLimit",
      "SpotDiscountLimit": 0.9
    }
  },
  "Labels": [
    {
      "Key": "CreatedBy",
      "Value": "QuickStart"
    }
  ],
  "AlgorithmProvider": "pai",
  "InputChannels": [
    {
      "DatasetId": "d-475megosidivjfgfq6",
      "Name": "model",
      "InputUri": "oss://test-bucket.oss-cn-hangzhou-internal.aliyuncs.com/path/to/input/model/",
      "Options": "ossAppendable=true",
      "VersionName": "v1"
    }
  ],
  "AlgorithmName": "llm_training",
  "ReasonCode": "TrainingJobSucceed",
  "GmtModifiedTime": "2024-07-10T11:49:47Z",
  "StatusTransitions": [
    {
      "EndTime": "2024-07-10T11:49:47Z",
      "ReasonCode": "TrainingJobSucceed",
      "ReasonMessage": "KubeDL job runs successfully",
      "StartTime": "2024-07-10T11:49:47Z",
      "Status": "Creating"
    }
  ],
  "TrainingJobDescription": "Qwen2大语言模型训练。",
  "UserId": "123456789",
  "AlgorithmVersion": "v0.0.1",
  "LatestMetrics": [
    {
      "Name": "loss",
      "Timestamp": "2024-07-10T11:49:47Z",
      "Value": 0.11
    }
  ],
  "GmtCreateTime": "2024-07-10T11:49:47Z",
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
  "Instances": [
    {
      "Name": "train1oug3yehan4-master-0",
      "Role": "master",
      "Status": "Succeeded"
    }
  ],
  "AlgorithmId": "algo-xsldfvu1334",
  "TrainingJobUrl": "https://pai.console.aliyun.com/?regionId=cn-hangzhou&workspaceId=1234#/training/jobs/train1ouyadsl8n4",
  "RoleArn": "acs:ram::{accountID}:role/{roleName}",
  "AlgorithmSpec": {
    "OutputChannels": [
      {
        "Description": "",
        "Required": true,
        "Properties": {
          "test": "test",
          "test2": 1
        },
        "Name": "",
        "SupportedChannelTypes": [
          ""
        ]
      }
    ],
    "HyperParameters": [
      {
        "DefaultValue": "",
        "Type": "",
        "Description": "",
        "Required": true,
        "Name": "",
        "Range": {
          "Enum": [
            ""
          ],
          "MinLength": 0,
          "MaxLength": 0,
          "Minimum": "",
          "Maximum": "",
          "ExclusiveMinimum": true,
          "ExclusiveMaximum": true,
          "Pattern": ""
        },
        "DisplayName": ""
      }
    ],
    "JobType": "",
    "Command": [
      ""
    ],
    "MetricDefinitions": [
      {
        "Description": "train dataset oob score",
        "Regex": ".*train:oob_score=([-+]?[0-9]*\\\\.?[0-9]+(?:[eE][-+]?[0-9]+)?).*",
        "Name": "train:oob_score"
      }
    ],
    "InputChannels": [
      {
        "Description": "",
        "Required": true,
        "Properties": {
          "test": "test",
          "test2": 1
        },
        "Name": "",
        "SupportedChannelTypes": [
          ""
        ]
      }
    ],
    "SupportsDistributedTraining": true,
    "Image": "",
    "SupportedInstanceTypes": [
      ""
    ],
    "ComputeResource": {
      "Policy": {
        "Version": "",
        "Value": ""
      }
    },
    "CodeDir": {
      "LocationType": "",
      "LocationValue": {
        "test": "test",
        "test2": 1
      }
    },
    "Customization": {
      "CodeDir": true
    },
    "ResourceRequirements": [
      {
        "Key": "SupportedMachineTypes",
        "Operator": "in",
        "Values": [
          "GPU"
        ]
      }
    ],
    "ProgressDefinitions": {
      "OverallProgress": {
        "Description": "",
        "Regex": ""
      },
      "RemainingTime": {
        "Description": "",
        "Regex": ""
      }
    }
  },
  "IsTempAlgo": true,
  "LatestProgress": {
    "OverallProgress": {
      "Timestamp": "2023-07-04T13:20:18Z",
      "Value": 0.75
    },
    "RemainingTime": {
      "Timestamp": "2023-07-04T13:20:18Z",
      "Value": 3600
    }
  },
  "UserVpc": {
    "VpcId": "vpc-abcdef****",
    "SwitchId": "vs-abcdef****",
    "SecurityGroupId": "sg-abcdef****",
    "ExtendedCIDRs": [
      "192.168.0.1/24"
    ]
  },
  "OutputModel": {
    "Uri": "oss://test-bucket.oss-cn-hangzhou-internal.aliyuncs.com/path/to/model/output/",
    "OutputChannelName": "model"
  },
  "Settings": {
    "BusinessUserId": "166924",
    "Caller": "SilkFlow",
    "Tags": {
      "key": ""
    },
    "PipelineId": "pid-123456",
    "EnableTideResource": true,
    "EnableErrorMonitoringInAIMaster": false,
    "ErrorMonitoringArgs": "--enable-log-hang-detection true",
    "EnableRDMA": true,
    "EnableOssAppend": true,
    "OversoldType": "AcceptQuotaOverSold",
    "AdvancedSettings": {
      "test": "test",
      "test2": 1
    },
    "Driver": "535.54.03",
    "EnableSanityCheck": true,
    "SanityCheckArgs": "--sanity-check-timing=AfterJobFaultTolerant --sanity-check-timeout-ops=MarkJobFai",
    "JobReservedMinutes": 30,
    "JobReservedPolicy": "Always"
  },
  "ExperimentConfig": {
    "ExperimentId": "exp-ds9aefia90v",
    "ExperimentName": "large_language_model_train"
  },
  "Duration": 7200,
  "Environments": {
    "key": "debug=true"
  },
  "PythonRequirements": [
    "torch>=2.2.0"
  ],
  "Priority": 0,
  "AssignNodeSpec": {
    "EnableAssignNode": true,
    "NodeNames": "",
    "AntiAffinityNodeNames": ""
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.