Help Center/ ModelArts/ API Reference/ Training Management/ Obtaining the General Specifications Supported by a Training Job
Updated on 2025-08-20 GMT+08:00

Obtaining the General Specifications Supported by a Training Job

Function

This API is used to obtain the supported resource specifications of training jobs on ModelArts.

This API applies to the following scenario: When you need to know the resource specifications supported by the platform to configure training jobs, you can use this API to obtain the specification list. Before using this API, ensure that you have the permission to view the resource specifications. After the query is complete, the platform returns the supported resource specifications. If you do not have the permission to perform operations, the API will return an error message.

Debugging

You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.

URI

GET /v2/{project_id}/training-job-flavors

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition: Project ID. For details, see Obtaining a Project ID and Name.

Constraints: The value can contain 1 to 64 characters. Letters, digits, and hyphens (-) are allowed.

Range: N/A

Default Value: N/A

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

flavor_type

No

String

Definition: Specification type to be obtained. If this parameter is not specified, all specification types are queried.

Constraints: N/A

Range: Enums:

  • CPU

  • GPU

  • Ascend

Default Value: N/A

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

total_count

Integer

Definition: Total number of training job resource flavors.

Range: N/A

flavors

Array of FlavorResponse objects

Definition: List of training job resource flavors.

Table 4 FlavorResponse

Parameter

Type

Description

flavor_id

String

Definition: Resource flavor ID.

Range: N/A

flavor_name

String

Definition: Resource flavor name.

Range: N/A

max_num

Integer

Definition: Maximum number of nodes supported by a flavor.

Range: N/A

flavor_type

String

Definition: Resource flavor type.

Range:

  • CPU

  • GPU

  • Ascend

billing

BillingInfo object

Definition: Billing information of a resource flavor.

flavor_info

FlavorInfoResponse object

Definition: Resource flavor details.

attributes

Map<String,String>

Definition: Other flavor attributes.

Range: N/A

Table 5 BillingInfo

Parameter

Type

Description

code

String

Definition: Billing code.

Range: N/A

unit_num

Integer

Definition: Billing unit.

Range: N/A

Table 6 FlavorInfoResponse

Parameter

Type

Description

max_num

Integer

Definition: Maximum number of nodes that can be selected. The value 1 indicates that the distributed mode is not supported.

Range: N/A

cpu

Cpu object

Definition: CPU specifications.

gpu

Gpu object

Definition: GPU specifications.

npu

Npu object

Definition: Ascend specifications.

memory

Memory object

Definition: Memory information.

disk

DiskResponse object

Definition: Disk information.

Table 7 Cpu

Parameter

Type

Description

arch

String

Definition: CPU architecture.

Range: N/A

core_num

Integer

Definition: Number of cores.

Range: N/A

Table 8 Gpu

Parameter

Type

Description

unit_num

Integer

Definition: Number of GPUs.

Range: N/A

product_name

String

Definition: Product name.

Range: N/A

memory

String

Definition: Memory.

Range: N/A

Table 9 Npu

Parameter

Type

Description

unit_num

String

Definition: Number of NPUs.

Range: N/A

product_name

String

Definition: Product name.

Range: N/A

memory

String

Definition: Memory.

Range: N/A

Table 10 Memory

Parameter

Type

Description

size

Integer

Definition: Memory size.

Range: N/A

unit

String

Definition: Number of memory units.

Range: N/A

Table 11 DiskResponse

Parameter

Type

Description

size

Integer

Definition: Disk size.

Range: N/A

unit

String

Definition: Unit of the disk size.

Range: N/A

Example Requests

The following shows how to query the public CPU resource flavors of training jobs in CN North-Beijing4.

GET https://endpoint/v2/{project_id}/training-job-flavors?flavor_type=CPU

Example Responses

Status code: 200

ok

{
  "total_count" : 2,
  "flavors" : [ {
    "flavor_id" : "modelarts.vm.cpu.2u",
    "flavor_name" : "Computing CPU(2U) instance",
    "flavor_type" : "CPU",
    "billing" : {
      "code" : "modelarts.vm.cpu.2u",
      "unit_num" : 1
    },
    "flavor_info" : {
      "max_num" : 1,
      "cpu" : {
        "arch" : "x86",
        "core_num" : 2
      },
      "memory" : {
        "size" : 8,
        "unit" : "GB"
      },
      "disk" : {
        "size" : 50,
        "unit" : "GB"
      }
    }
  }, {
    "flavor_id" : "modelarts.vm.cpu.8u",
    "flavor_name" : "Computing CPU(8U) instance",
    "flavor_type" : "CPU",
    "billing" : {
      "code" : "modelarts.vm.cpu.8u",
      "unit_num" : 1
    },
    "flavor_info" : {
      "max_num" : 16,
      "cpu" : {
        "arch" : "x86",
        "core_num" : 8
      },
      "memory" : {
        "size" : 32,
        "unit" : "GB"
      },
      "disk" : {
        "size" : 50,
        "unit" : "GB"
      }
    }
  } ]
}

Status Codes

Status Code

Description

200

ok

Error Codes

See Error Codes.