昇腾多卡通信教程【配置网络检测对象IP】

无法通信会出现的错误如下

一、网络健康状态报错

命令原型

hccn_tool [-i %d] -netdetect -s [address %s]

命令功能
本功能支持用户执行命令获取网络健康状态(本端与所配置的检测IP之间的连通状态),用户可指定上报的状态信息名称。

状态信息:

0:Success;1:Socket fail;2:Receive timeout;3:Unreachable;4:Time exceeded;5:Fault;6:Init;7:Thread error;8:Detect ip set;其它:Unknown。

参数说明

参数说明
-i指定设备ID。取值范围:0~7。
-net_health指定网络健康状态属性。
-g获取属性。

使用样例

hccn_tool -i 1 -net_health -g

报错

net health status: Init

二、运行hccl_tools.py报错

根据RANK_TABLE_FILE准备----单机8卡
运行mindformers/tools/hccl_tools.py,生成RANK_TABLE_FILE文件

# 运行如下命令,生成当前机器的RANK_TABLE_FILE的json文件
python ./mindformers/tools/hccl_tools.py --device_num "[0,8)"

报错

start /home/HwHiAiUser/mindformers/./mindformers/tools/hccl_tools.py
visible_devices:['0', '1', '2', '3', '4', '5', '6', '7']
server_id:127.0.0.1
device_num_list: [0, 1, 2, 3, 4, 5, 6, 7]
Command execute failed!
Failed to call hccn_tool, try to read /etc/hccn.conf instead
Traceback (most recent call last):File "/home/HwHiAiUser/mindformers/./mindformers/tools/hccl_tools.py", line 163, in <module>main()File "/home/HwHiAiUser/mindformers/./mindformers/tools/hccl_tools.py", line 137, in maindevice_ip = device_ips[device_id]
KeyError: '0'

三、多卡推理报错

多卡推理baichuan2-13b,这个时候已经解决了上面的报错,但是这时多卡依然无法通信,报错EI0004,官网论坛以及昇思文档还有gitee都没有解决方案
报错

[WARNING] Distributed Communication has not been inited. Use default RANK_SIZE: 1
[WARNING] Distributed Communication has not been inited. Use default RANK_ID: 0
Traceback (most recent call last):File "/home/anaconda3/envs/sakura/lib/python3.9/site-packages/mindformers/core/context/build_context.py", line 95, in init_contextinit()File "/home/anaconda3/envs/sakura/lib/python3.9/site-packages/mindspore/communication/management.py", line 171, in initinit_hccl()
RuntimeError: Ascend collective communication initialization failed.----------------------------------------------------
- Ascend Error Message:
----------------------------------------------------
EI0004: The ranktable or rank is invalid,Reason:[The ranktable config devId is inconsistent with the local devId.]. Please check the configured ranktable. [{"server_count":"1","server_list":[{"device":[{"device_id":"0","device_ip":"192.168.2.60","rank_id":"0"},{"device_id":"1","device_ip":"192.168.3.60","rank_id":"1"},{"device_id":"2","device_ip":"192.168.4.60","rank_id":"2"},{"device_id":"3","device_ip":"192.168.5.60","rank_id":"3"},{"device_id":"4","device_ip":"192.168.6.60","rank_id":"4"},{"device_id":"5","device_ip":"192.168.7.60","rank_id":"5"},{"device_id":"6","device_ip":"192.168.8.60","rank_id":"6"},{"device_id":"7","device_ip":"192.168.9.60","rank_id":"7"}],"host_nic_ip":"reserve","server_id":"127.0.0.1"}],"status":"completed","version":"1.0"}]Solution: Try again with a valid cluster configuration in the ranktable file. Ensure that the configuration matches the operating environment.(Please search "Ascend Error Message" at https://www.mindspore.cn for error code description)----------------------------------------------------
- Framework Error Message: (For framework developers)
----------------------------------------------------
Init hccl graph adapter failed.
----------------------------------------------------
- C++ Call Stack: (For framework developers)
----------------------------------------------------
mindspore/ccsrc/plugin/device/ascend/hal/hardware/ascend_collective_comm_lib.cc:129 Initialize
mindspore/ccsrc/plugin/device/ascend/hal/hccl_adapter/hccl_adapter.cc:452 InitKernelInfoStoreDuring handling of the above exception, another exception occurred:Traceback (most recent call last):File "/home/HwHiAiUser/mindformers/research/baichuan2/run_baichuan2_pipeline.py", line 35, in <module>build_context(baichuan2_config)File "/home/anaconda3/envs/sakura/lib/python3.9/site-packages/mindformers/core/context/build_context.py", line 43, in build_contextlocal_rank, device_num = init_context(use_parallel=config.use_parallel,File "/home/anaconda3/envs/sakura/lib/python3.9/site-packages/mindformers/core/context/build_context.py", line 97, in init_contextraise RuntimeError("Notice: if you are trying to run with a single device, please set "
RuntimeError: Notice: if you are trying to run with a single device, please set use_parallel=False. If not, please check the error message above.

解决方案

第一步:编译HCCL

参考:昇腾社区—CANN社区版—开发工具—HCCL性能测试工具—工具编译

第二步:配置网卡

1、RoCE网卡IP地址和子网掩码

命令原型

hccn_tool [-i %d] -ip -s [address %s] [netmask %s]

命令功能
配置RoCE网卡的IP地址、子网掩码。

参数说明

参数说明
-i指定设备ID。取值范围:0~7。
-ip指定IP属性。
-s设置属性。
addressIP地址。
netmask子网掩码。

约束说明
该命令仅支持在物理机root用户下运行。

使用样例

hccn_tool -i 0 -ip -s address 192.168.10.61 netmask 255.255.255.0
hccn_tool -i 1 -ip -s address 192.168.10.62 netmask 255.255.255.0
hccn_tool -i 2 -ip -s address 192.168.10.63 netmask 255.255.255.0
hccn_tool -i 3 -ip -s address 192.168.10.64 netmask 255.255.255.0
hccn_tool -i 4 -ip -s address 192.168.10.65 netmask 255.255.255.0
hccn_tool -i 5 -ip -s address 192.168.10.66 netmask 255.255.255.0
hccn_tool -i 6 -ip -s address 192.168.10.67 netmask 255.255.255.0
hccn_tool -i 7 -ip -s address 192.168.10.68 netmask 255.255.255.0

注意事项
我的服务器IP是192.168.10.60,所以设置显卡ip需要以192.168.10为起始
针对AI Server上每个Device侧OS管理8块昇腾AI处理器,需要为每个OS上的8块网卡配置不同的IP。
首次配置IP时会出现15秒后link状态变为down,然后恢复up状态的情况。
192.168.1.X、192.168.2.192、192.168.2.196、192.168.3.193、192.168.3.197、192.168.4.194、192.168.4.198、192.168.5.195和192.168.5.199用于板内网络通信使用,不支持配置。

2、配置路由

hccn_tool -i 0 -gateway -s gateway 192.168.10.60
hccn_tool -i 1 -gateway -s gateway 192.168.10.60
hccn_tool -i 2 -gateway -s gateway 192.168.10.60
hccn_tool -i 3 -gateway -s gateway 192.168.10.60
hccn_tool -i 4 -gateway -s gateway 192.168.10.60
hccn_tool -i 5 -gateway -s gateway 192.168.10.60
hccn_tool -i 6 -gateway -s gateway 192.168.10.60
hccn_tool -i 7 -gateway -s gateway 192.168.10.60

3、配置NPU网口检测IP地址(网络检测对象IP)

命令原型

hccn_tool [-i %d] -netdetect -s [address %s]

命令功能
配置网络检测对象IP。该功能主要用于检测网络状态,当多台服务器进行分布式训练时,可将检测对象IP配置为网段内的网关地址,服务器会定时检测和网关地址通信是否正常,从而实现检测服务器参数面网络状态是否正常的效果。该功能需配合获取网络健康状态使用。

参数说明

参数说明
-i指定设备ID。取值范围:0~7。
-netdetect指定网络检测对象IP属性。
-s设置属性。
addressIP地址。

约束说明
该命令仅支持在物理机的root用户下运行。

使用样例

hccn_tool -i 0 -netdetect -s address 192.168.10.60
hccn_tool -i 1 -netdetect -s address 192.168.10.60
hccn_tool -i 2 -netdetect -s address 192.168.10.60
hccn_tool -i 3 -netdetect -s address 192.168.10.60
hccn_tool -i 4 -netdetect -s address 192.168.10.60
hccn_tool -i 5 -netdetect -s address 192.168.10.60
hccn_tool -i 6 -netdetect -s address 192.168.10.60
hccn_tool -i 7 -netdetect -s address 192.168.10.60

官网给的教程里ip地址要对应路由地址,对应网关地址,但是这样设置后会显示net health status: Receive timeout
我改完RoCE网卡IP地址后才会显示成功,也就是


hccn_tool -i 0 -netdetect -s address 192.168.10.61
hccn_tool -i 1 -netdetect -s address 192.168.10.62
hccn_tool -i 2 -netdetect -s address 192.168.10.63
hccn_tool -i 3 -netdetect -s address 192.168.10.64
hccn_tool -i 4 -netdetect -s address 192.168.10.65
hccn_tool -i 5 -netdetect -s address 192.168.10.66
hccn_tool -i 6 -netdetect -s address 192.168.10.67
hccn_tool -i 7 -netdetect -s address 192.168.10.68

设置完成后随意检查一块显卡的健康状态

hccn_tool -i 7 -net_health -g

返回Success即为成功,这样就解决了bug-1和bug-3

net health status: Success

以上操作参考Ascend Training Solution 23.0.RC3 组网指南 01

设置完成后运行hccl_tools.py

start /home/HwHiAiUser/mindformers/./mindformers/tools/hccl_tools.py
visible_devices:['0', '1', '2', '3', '4', '5', '6', '7']
server_id:127.0.0.1
device_num_list: [0, 1, 2, 3, 4, 5, 6, 7]
rank_id:0, device_id:0, device_ip:192.168.10.61
rank_id:1, device_id:1, device_ip:192.168.10.62
rank_id:2, device_id:2, device_ip:192.168.10.63
rank_id:3, device_id:3, device_ip:192.168.10.64
rank_id:4, device_id:4, device_ip:192.168.10.65
rank_id:5, device_id:5, device_ip:192.168.10.66
rank_id:6, device_id:6, device_ip:192.168.10.67
rank_id:7, device_id:7, device_ip:192.168.10.68
Completed: hccl file was save in : /home/HwHiAiUser/mindformers/hccl_8p_01234567_127.0.0.1.json

这样就算是成功了,bug-2就解决了

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/605410.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Javaweb之Mybatis的XML配置文件的详细解析

2. Mybatis的XML配置文件 Mybatis的开发有两种方式&#xff1a; 注解 XML 2.1 XML配置文件规范 使用Mybatis的注解方式&#xff0c;主要是来完成一些简单的增删改查功能。如果需要实现复杂的SQL功能&#xff0c;建议使用XML来配置映射语句&#xff0c;也就是将SQL语句写在…

kotlin的抽象类和抽象方法

在 Kotlin 中&#xff0c;抽象类和抽象方法是面向对象编程中的概念&#xff0c;用于实现抽象和多态性。以下是有关 Kotlin 抽象类和抽象方法的详细信息&#xff1a; 抽象类&#xff1a; 定义&#xff1a; 抽象类是用 abstract 关键字声明的类&#xff0c;不能直接实例化。它可…

从零开始构建区块链:我的区块链开发之旅

1.引言 1.区块链技术的兴起和重要性 区块链技术&#xff0c;作为数字化时代的一项颠覆性创新&#xff0c;已经成为当今世界最令人瞩目的技术之一。自比特币的问世以来&#xff0c;区块链技术已经从仅仅支持加密货币发展成为一种具有广泛应用前景的分布式账本技术。其核心优势…

顺序表的实现(C语言)

本文章主要对顺序表的介绍以及数据结构的定义,以及几道相关例题,帮助大家更好理解顺序表. 文章目录 前言 一、顺序表的静态实现 二、顺序表的动态实现 三.定义打印顺序表函数 四.定义动态增加顺序表长度函数 五.创建顺序表并初始化 六.顺序表的按位查找 七.顺序表的按值…

如何下载 GOES(Geostationary Operational Environmental Satellite)卫星数据

GOES是指地球静止轨道卫星&#xff08;Geostationary Operational Environmental Satellite&#xff09;系统&#xff0c;它是美国国家海洋和大气管理局&#xff08;NOAA&#xff09;和美国国家航空航天局&#xff08;NASA&#xff09;合作开发和运营的一系列气象卫星。这些卫星…

如何编写高效的正则表达式?

正则表达式&#xff08;Regular Expression&#xff0c;简称regex&#xff09;是一种强大的文本处理技术&#xff0c;广泛应用于各种编程语言和工具中。本文将从多个方面介绍正则表达式的原理、应用和实践&#xff0c;帮助你掌握这一关键技术。 正则可视化 | 一个覆盖广泛主题…

19、Kubernetes核心技术 - 资源限制

目录 一、概述 二、Kubernetes 中的资源单位 2.1、CPU资源单位 2.2、内存资源单位 三、Pod资源限制 四、namespace资源限制 4.1、为命名空间配置内存和 CPU 配额 4.2、为命名空间配置默认的内存请求和限制 4.3、为命名空间配置默认的CPU请求和限制 五、超过容器限制的…

240107-RHEL8+RHEL9配置安装:NVIDIA驱动(15步)+CUDA(4步)+CUDNN(5步)+GPU压力测试

Section 0: 基础知识 CUDA、cuDNN 和 PyTorch 版本的选择与搭配指南 安装优先级: 显卡驱动 → CUDA → CUDA Toolkit → cuDNN → Pytorch 即显卡驱动决定了CUDA版本&#xff0c;CUDA版本决定了CUDA Toolkit、cuDNN、Pytorch各自的版本提前下载 &#xff5c; CUDA提前下载 &am…

超自动化助力企业财务转型升级

在快节奏的财务规划与分析环境中&#xff0c;传统的预算方法虽长期以来一直是企业制定有效决策的支柱&#xff0c;但已不足以驾驭当今复杂的商业环境。不断的经济变化、市场的不确定性以及利益相关者的需求增加促使企业寻求更敏捷的解决方案。如今&#xff0c;部分企业开始尝试…

lc 140. 单词拆分 II

回溯算法查询匹配单词 class Solution { public:unordered_map<string, int> word_map;void mapping(vector<string>& wordDict){for(auto &a : wordDict)word_map[a];}vector<string> ret;// s: 原始字符串// tmp: 已查询到的单词// …

CSS 彩虹按钮效果

<template><view class"content"><button class"btn">彩虹按钮</button></view> </template><script></script><style>body{background-color: #000;}.content {margin-top: 300px;}.btn {width: 1…

Debian12使用Xshell连接失败解决办法详细

1、Debian开启ssh服务 sudo apt update -y sudo apt install ssh2、编辑配置文件 # 安装vim sudo apt install vimvim /etc/ssh/sshd_config3、将#PermitRootLogin prohibit-password的注释去掉&#xff0c;设置为yes 4、将#PasswordAuthentication no的注释去掉&#xff0c;…

JAVA------IO流复制总结

IO流复制文件 方法一 字符 注意点&#xff1a;写和读需要保持一致的编码形式。 public class eee {public static void main(String[] args) {FileInputStream in null;FileOutputStream out null;OutputStreamWriter outw null;InputStreamReader inr null;try{out new …

VX小程序Burp抓包

方法有很多&#xff0c;工具也各有差异&#xff0c;主要是学代理流量的思路 Burp流量代理工具小程序 一、Burp证书导入 1、开启代理 开启浏览器的代理&#xff0c;火狐推荐FoxyProxy&#xff0c;Google推荐SwitchyOmega&#xff0c;设置代理为127.0.0.1:8080。 2、下载证书…

Apache Doris (六十三): Spark Doris Connector - (3)-配置型及列映射关系

🏡 个人主页:IT贫道_大数据OLAP体系技术栈,Apache Doris,Clickhouse 技术-CSDN博客 🚩 私聊博主:加入大数据技术讨论群聊,获取更多大数据资料。 🔔 博主个人B栈地址:豹哥教你学编程的个人空间-豹哥教你学编程个人主页-哔哩哔哩视频 目录 1. Spark 操作Doris配置项…

2023量子科技十大人物(团队) | 光子盒年度系列

今年&#xff0c;是量子科学与技术的又一个丰收年&#xff0c;学术研究团体和科技公司纷纷庆祝在量子计算、量子通信和量子计量学以及基础量子科学方面取得的重大成就。面对如此多令人兴奋的进展&#xff0c;我们不能不为这些进展庆祝——而所有这些的一切&#xff0c;都离不开…

redis 中文存储的序列化配置

redis 中文存储的序列化配置 为了解决 Redis 中文存储时出现的乱码问题,通常需要设置合适的序列化器。在 Spring Boot 应用中,使用 Jackson2JsonRedisSerializer 或 GenericJackson2JsonRedisSerializer 作为序列化器是一种常见的做法。这两种序列化器都会使用 UTF-8 编码,从…

深入了解static关键字的作用和应用--java面向对象学习

Static修饰成员变量 Static是什么 叫静态&#xff0c;可以修饰成员变量&#xff0c;成员方法 成员变量按有无static修饰分俩种&#xff1a; 类变量&#xff1a;有static修饰&#xff0c;属于类&#xff0c;在计算机里只有一份&#xff0c;会被类的全部对…

ssm基于Vue.js的网上招聘系统设计与实现+vue论文

摘 要 计算机网络发展到现在已经好几十年了&#xff0c;在理论上面已经有了很丰富的基础&#xff0c;并且在现实生活中也到处都在使用&#xff0c;可以说&#xff0c;经过几十年的发展&#xff0c;互联网技术已经把地域信息的隔阂给消除了&#xff0c;让整个世界都可以即时通话…

小结:利用PostMessage实现Web中的跨文档通信

本周开发项目时&#xff0c;做了一个技术小结&#xff0c;帮助快速理解 & 使用 PostMessage。 PostMessage是通信API&#xff0c;它允许不同窗口之间进行跨文档通信&#xff0c;包括同源和跨源的通信。 基本使用方法 使用PostMessage非常简单&#xff0c;主要包括两个步…