下载
中文
注册
多机无法拉起DeepSeek-R1模型,服务器NPU通信问题

多机无法拉起DeepSeek-R1模型,服务器NPU通信问题

2025/03/07

816

暂无评分
我要评分

问题信息

问题来源产品大类关键字
现网模型推理TLS,HCCL,AllReduce,通信,DeepSeek,推理

问题现象描述

  1. 启动任务时,任务无法拉起。
  2. 任务执行时,突然中断或服务突然终止。

原因分析

NPU网络通信存在问题。

解决措施

  1. 查看防火墙是否关闭。
    firewall-cmd –state
    • 已关闭显示如下:

      放大

    • 未关闭执行如下命令:

      systemctl stop firewalld

  1. 检测卡状态。
    for i in {0..7}; do hccn_tool -i $i -link -g ; done
    • 显示up为正常

      放大

    • 其他状态可以通过如下命令重启卡(-i 后面填写卡的ID)

      npu-smi set -t reset -i {RankId} -c 0 -m 1

  1. 检测卡的IP是否配置。

    for i in {0..7}; do hccn_tool -i $i -ip -g ; done

    放大

  1. 检测多节点的每个卡TLS开关是否一致。

    for i in {0..7}; do hccn_tool -i $i -tls -g ; done | grep switch

    • 所有机器的所有卡要么为1,要么为0。建议修改为0进行关闭

      放大

    • TLS关闭方法(-i 后面填写卡的ID)

      hccn_tool -i {RankId} -tls -s enable 0

  2. 本机卡间通信检测。
    • 进入任意目录创建一个 test.py文件
    • 文件加入如下脚本:
      import subprocess
      ip_list = []
      for i in range(8):
          try:
              cmd = ['hccn_tool', '-i', str(i), '-ip', '-g']
              res = subprocess.run(cmd, capture_output=True, text=True, check=True)
              res_str = res.stdout.strip()
              if 'ipaddr' in res_str:
                  ip_list.append(res_str.split('\n')[0].split(':')[1])
          except subprocess.CalledProcessError as e:
              print(e)
      for i in range(8):
          for other_ip in ip_list:
              try:
                  cmd = ['hccn_tool', '-i', str(i), '-ping', '-g', 'address', str(other_ip), 'pkt', '3']
                  res = subprocess.run(cmd, capture_output=True, text=True, check=True)
                  print(ip_list[i], '==>', res.stdout.strip())
              except subprocess.CalledProcessError as e:
                  print(e)
          print(f'========{ip_list[i]} is OK========')
      print(f'========ALL is OK========')
    • 在当前目录执行脚本

    python test.py

    • 出现ALL is OK 代表本机所有卡通讯正常

    放大

  3. 检测无误后,重新执行AI任务。

本页内容