local_comm_res
产品支持情况
产品 |
是否支持 |
---|---|
√ |
|
√ |
|
x |
|
x |
|
x |
|
x |
函数功能
用于配置本地通信资源。
函数原型
1 | local_comm_res(local_comm_res) |
参数说明
参数名称 |
数据类型 |
取值说明 |
---|---|---|
local_comm_res |
str |
配置本地通信资源信息,格式是json的字符串。仅需配置ranktable中当前llm datadist所使用Device信息,无需配置ranktable中的server_count和rank_id字段。ranktable具体信息请参见《HCCL集合通信库用户指南》中的“通信功能开发 > 集群信息配置 > rank table文件配置资源信息“章节。配置示例如下。 { "server_list": [ { "device": [ { "device_id": "0", "device_ip": "x.x.x.x" }, ], "server_id": "xxxx" } ], "status": "completed", "version": "1.0" } 若未配置enable_cache_manager和enable_remote_cache_accessible参数,在配置了当前option后,这两个参数默认为True。 说明:
该字段可以配置为空,示例如下。 local_comm_res = "" |
调用示例
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | 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”的场景。
父主题: LLMConfig