Skip to main content

简介

hccl在未做适配前需要配置/etc/hccl_rootinfo.json文件才能运行,该文件中包含

  1. NPU的地址信息
  2. 拓扑文件路径,拓扑文件中描述了NPU之间的互联关系

安装

在线安装

python3 -m pip install unofficial-ascend-tools

本地安装

下载好whl软件包

python3 -m pip install ./<软件包文件>.hwl

从源码构建

首先进入源码目录(指包含setup.py的目录)

python3 -m pip install setuptools wheel   #安装构建工具
python3 ./setup.py bdist_wheel   # 构建安装包
python3 -m pip install dist/*.whl  #  安装

安装可能遇到的问题

1. 使用代理时报证书相关错误

原因:代理软件可能无法正确处理证书

解决方法:

  1. 使用--trusted-host参数指定不校验正式,详细用法请查看pip的参数说明

  2. 配置pip使用http源

2.操作系统报错可能破坏系统依赖

报错信息类似

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.

    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.

    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.

    See /usr/share/doc/python3.11/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

原因是,部分python软件包存在两种os源和pip源两种安装方式,当使用pip源安装时可能会破坏os源安装的软件包,因此os提示危险操作

解决方法:

1.使用virtualenv方式,例如python自带的venv或者conda均可,以venv为例

python3 -m venv  myenv
source myenv/bin/activate
#激活虚拟环境后再安装即可

2.不推荐,添加--break-system-packages选项强制安装

3. OS缺乏pip、venv等工具

原因 操作系统中相关软件包没有安装

解决办法:

1.yum包管理器,适用与openeuler等os

yum makecache
yum install python3-pip python3-venv

2.apt包管理器,适用于ubuntu、debian等os

apt-get update
apt-get install python3-pip python3-venv

使用工具生成/etc/hccl_rootinfo.json

备份之前的文件(可选)

检查/etc/hccl_rootinfo.json 文件是否存在, 如果存在,建议备份

生成rootinfo文件

mindcluster-tools rootinfo -o /etc/hccl_rootinfo.json

如果不指定-o参数, 工具会在执行命令的当前目录生产new_hccl_rootinfo.json文件, 需要手动将文件拷贝到/etc/hccl_rootinfo.json

注意: 由于机型较多,部分未适配机型可能报错,如果报错,需要手动指定topo文件,详见下一个章节

手动指定拓扑文件

mindcluster-tools rootinfo -t <path_to_topo_file> -o /etc/hccl_rootinfo.json

注意: <path_to_topo_file> 要替换成拓扑文件的绝对路径

Metadata

Release files for unofficial-ascend-tools 0.0.8.post10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for unofficial-ascend-tools 0.0.8.post10
File Interpreter ABI Platform
unofficial_ascend_tools-0.0.8.post10-py3-none-any.whl Python 3 none any Details

Release files / unofficial_ascend_tools-0.0.8.post10-py3-none-any.whl

Download URL unofficial_ascend_tools-0.0.8.post10-py3-none-any.whl
Size 56.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
38357fa2011d5e286b50f525d6d049544e559d74d4bf7e073a44243fb3ac19ee
BLAKE2b-256 checksum
How to use checksums
3ec6d599334d623fc97bd88f8fbdd380a0d83cedea08d0f7bdacc9999a96a1c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release history Release notifications | RSS feed

0.0.11

1 release file

0.0.10

1 release file

0.0.9

1 release file

This release

0.0.8.post10 This release

1 release file

0.0.8

1 release file

0.0.7

1 release file

0.0.5

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page