---
title: local_comm_res
description: "| 产品 | 是否支持 |"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/hixlug/llmprv2_42_0024.html
sourcePath: /source/zh/canncommercial/900/API/hixlug/llmprv2_42_0024.html
indexId: 9299c3dd4ef6dc177247a68b1a63e4807a9eee9844632ec92c279fef5b8abfa561
---
# local_comm_res

#### 产品支持情况

| 产品 | 是否支持 |
| --- | --- |
| Atlas 350 加速卡 | x |
| Atlas A3 训练系列产品 / Atlas A3 推理系列产品 | √ |
| Atlas A2 训练系列产品 / Atlas A2 推理系列产品 | √ |
| Atlas 200I/500 A2 推理产品 | x |
| Atlas 推理系列产品 | x |
| Atlas 训练系列产品 | x |


说明：针对 Atlas A2 训练系列产品 / Atlas A2 推理系列产品 ，仅支持Atlas 800I A2 推理服务器、A200I A2 Box 异构组件。


#### 函数功能

用于配置本地通信资源。


#### 函数原型

```
local_comm_res(local_comm_res)
```


#### 参数说明

| 参数名称 | 数据类型 | 取值说明 |
| --- | --- | --- |
| local\_comm\_res | str | 配置本地通信资源信息，格式是json的字符串。 若未配置enable\_cache\_manager和enable\_remote\_cache\_accessible参数，在配置了当前option后，这两个参数默认为True。 |


Atlas A2 训练系列产品 / Atlas A2 推理系列产品 场景下，仅需配置ranktable中当前llm datadist所使用Device信息，无需配置ranktable中的server_count和rank_id字段。ranktable具体信息请参见《HCCL集合通信库(https://www.hiascend.com/document/detail/zh/canncommercial/900/API/hcclug/hcclug_000001.html)》。配置示例如下。

```
{
"server_list": [
{
"device": [
{
"device_id": "0",
"device_ip": "x.x.x.x"
},
],
"server_id": "xxxx"
}
],
"status": "completed",
"version": "1.0"
}
```

该字段可以配置为空，示例如下。

```
local_comm_res = ""
```

Atlas A3 训练系列产品 / Atlas A3 推理系列产品 场景下，仅需配置ranktable中当前llm datadist所使用Device信息，无需配置ranktable中的server_count和rank_id字段。ranktable具体信息请参见《HCCL集合通信库(https://www.hiascend.com/document/detail/zh/canncommercial/900/API/hcclug/hcclug_000001.html)》。配置示例如下。

```
{
"server_list": [
{
"device": [
{
"device_id": "0",
"device_ip": "x.x.x.x"
},
],
"server_id": "xxxx"
}
],
"status": "completed",
"version": "1.0"
}
```


该字段可以配置为空，示例如下。

```
local_comm_res = ""
```

#### 调用示例

```
from llm_datadist import LLMConfig
llm_config = LLMConfig()
llm_config.local_comm_res = '''{
    "status": "completed",
    "version": "1.0",
    "server_list": [
        {
            "server_id": "node_0",
            "device": [
                {
                    "device_id": "0",
                    "device_ip": "x.x.x.x"
                }
            ]
        }
    ]
}'''
```


#### 返回值

正常情况下无返回值。

参数错误可能抛出TypeError或ValueError。


#### 约束说明

配置了该option后，存在如下约束。

- 调用  link_clusters
或  unlink_clusters
时，如果local_comm_res不为空，则不需要配置“clusters”参数中的“append_local_ip_info”信息。如果local_comm_res为空，则需要配置“clusters”参数中的“append_local_ip_info”信息。
- 当前不支持  enable_cache_manager
和  enable_remote_cache_accessible
配置为“False”的场景。
