获取GPU集群拓扑
接口说明
为目标 ACK 集群安装组件后:
首先,初次纳管集群,会为集群当前包含的所有 ECS 安装组件(如果集群节点超过 50 台,第一批次只会安装 50 台);
其次,操作系统控制台会周期性的检查被纳管集群的扩缩容情况,一旦有新的 ECS 被添加到集群中,操作系统控制台会为其自动安装组件无需用户干预。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
请求语法
GET /api/v1/aiTopology/topology/clusterTopology HTTP/1.1
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| clusterId |
string |
是 |
集群名称,可以从 GetListGpuCluster 接口中获取的集群列表中选择集群 |
"cluster1" |
| startTime |
string |
否 |
查询指定时间戳,默认查询当前时间,要秒级时间戳 |
1709740800 |
| instanceIdList |
any |
否 |
查询指定实例列表的 GPU 拓扑信息 |
["instance1", "instance2","instance3"] |
| podList |
any |
否 |
查询指定 POD 列表的 GPU 拓扑信息 |
["pod1", "pod2","pod3"] |
| taskIdList |
any |
否 |
查询指定任务列表的 GPU 拓扑信息 |
["task1", "task2"] |
| communicationId |
string |
否 |
查看集合通信拓扑时使用,查看指定通信组 ID 的拓扑关系(如查看某通信组内各 rank 间通信拓扑,tree、ring 拓扑) 需要 channel_id、topo_type 一起使用 ⚠️使用 GetGpuClusterArgsOptions 接口 communication 过滤类型可获取 communication_id 列表 |
communicationId =0x412523235123 channelId=1 topoType=ring |
| channelId |
string |
否 |
查看集合通信拓扑时使用,指定通信组下,指定通道 ID 的拓扑关系(如查看某通信组内各 rank 间通信拓扑,tree、ring 拓扑) 需要 communication_id、topo_type 一起用 ⚠️GetGpuClusterArgsOptions 接口 channel 过滤参数可获取指定 communication_id 下的 channel_id 列表 |
communicationId =0x412523235123 channelId=1 topoType=ring |
| topoType |
string |
否 |
查看集合通信拓扑时使用,指定通信组下,指定通道 ID,指定拓扑类型的拓扑关系(如查看某通信组内各 rank 间通信拓扑,tree、ring 拓扑) 需要 communication_id、channel_id 参数一起使用 ⚠️使用 GetGpuClusterArgsOptions 接口的 topoType 过滤参数可获取指定 communication_id 下、指定 channel_id 的 topo_type 列表 |
communicationId =0x412523235123 channelId=1 topoType=ring |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
返回响应体 |
||
| code |
string |
code 为'Success'或'Sysom.ServerError'或 Sysom.InvalidParameter |
Fail/Success |
| data |
object |
接口返回数据 |
|
| data |
object |
集群拓扑数据结构 |
|
| edges |
any |
拓扑结构中边数据 |
"edges": [ { "type": "GPU", "src_id": "00534a88", "dst_id": "260525e9", "values": { "Exception": [ { "key": "NCCL HANG", "value": "error0" } ], "Metric": [ { "key": "a", "value": "372201199012283428" } ], "Basic": [ { "key": "NCCL Version", "value": "v2.22.3" } ] }, "style": { "lineWidth": "0.01", "opacity": "1", "selectedStyle": "\"{\\\"opacity\\\": 1, \\\"lineWidth\\\": 1}\"", "stroke": "#e94242\n" } } ] |
| nodes |
any |
拓扑数据中 node 节点数据 |
"nodes": [ { "id": "i-xxxxxx", "name": "i-xxxxxx", "gpu_list": [ { "id": "6cc37fbc", "name": "GPU0", "style": { "fill": "#e94242", "opacity": "0.1" }, "values": { "Metric": [ { "key": "0", "value": "gpu_util(%)" } ], "Basic": [ { "key": "1", "value": "Gpu Number" } ], "Exception": [ { "key": "NCCL HANG", "value": "error0" } ] } } ], "style": { "fillOpacity": "0.5", "fill": "#e94242" }, "values": { "Exception": [ { "key": "NCCL HANG", "value": "error0" } ], "Basic": [ { "key": "podList", "value": "podname1" } ], "Metric": [ { "key": "instance", "value": "i-xxxxxx" } ] } } ], |
| total |
integer |
返回 GPU 卡数 |
36 |
| message |
string |
code 不为'Success'时,message 为出错信息 |
some error msg if not success,“” if success |
| requestId |
string |
Id of the request |
return real request ID |
示例
正常返回示例
JSON格式
{
"code": "Fail/Success\n",
"data": {
"data": {
"edges": " \"edges\": [\n {\n \"type\": \"GPU\",\n \"src_id\": \"00534a88\",\n \"dst_id\": \"260525e9\",\n \"values\": {\n \"Exception\": [\n {\n \"key\": \"NCCL HANG\",\n \"value\": \"error0\"\n }\n ],\n \"Metric\": [\n {\n \"key\": \"a\",\n \"value\": \"372201199012283428\"\n }\n ],\n \"Basic\": [\n {\n \"key\": \"NCCL Version\",\n \"value\": \"v2.22.3\"\n }\n ]\n },\n \"style\": {\n \"lineWidth\": \"0.01\",\n \"opacity\": \"1\",\n \"selectedStyle\": \"\\\"{\\\\\\\"opacity\\\\\\\": 1, \\\\\\\"lineWidth\\\\\\\": 1}\\\"\",\n \"stroke\": \"#e94242\\n\"\n }\n }\n ]",
"nodes": "\"nodes\": [\n {\n \"id\": \"i-xxxxxx\",\n \"name\": \"i-xxxxxx\",\n \"gpu_list\": [\n {\n \"id\": \"6cc37fbc\",\n \"name\": \"GPU0\",\n \"style\": {\n \"fill\": \"#e94242\",\n \"opacity\": \"0.1\"\n },\n \"values\": {\n \"Metric\": [\n {\n \"key\": \"0\",\n \"value\": \"gpu_util(%)\"\n }\n ],\n \"Basic\": [\n {\n \"key\": \"1\",\n \"value\": \"Gpu Number\"\n }\n ],\n \"Exception\": [\n {\n \"key\": \"NCCL HANG\",\n \"value\": \"error0\"\n }\n ]\n }\n }\n ],\n \"style\": {\n \"fillOpacity\": \"0.5\",\n \"fill\": \"#e94242\"\n },\n \"values\": {\n \"Exception\": [\n {\n \"key\": \"NCCL HANG\",\n \"value\": \"error0\"\n }\n ],\n \"Basic\": [\n {\n \"key\": \"podList\",\n \"value\": \"podname1\"\n }\n ],\n \"Metric\": [\n {\n \"key\": \"instance\",\n \"value\": \"i-xxxxxx\"\n }\n ]\n }\n }\n ],"
},
"total": 36
},
"message": "some error msg if not success,“” if success",
"requestId": "return real request ID"
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | Sysom.ServerError | Server error, please correct the code according to the error message. %s. | 服务端错误,请根据错误提示信息修正代码 |
| 400 | Sysom.InvalidParameter | Invalid parameters passed when calling the interface. %s. | 调用接口时传递了无效参数 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。