Skip to main content

unofficial-ascend-tools

Project description

简介

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> 要替换成拓扑文件的绝对路径

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

unofficial_ascend_tools-0.0.8.post5-py3-none-any.whl (55.5 kB view details)

Uploaded Python 3

File details

Details for the file unofficial_ascend_tools-0.0.8.post5-py3-none-any.whl.

File metadata

File hashes

Hashes for unofficial_ascend_tools-0.0.8.post5-py3-none-any.whl
Algorithm Hash digest
SHA256 8c7e5ef5b8028663cbb7b49579d6a547f7940060f2f35d1ff58a9af5129a38e7
MD5 231284f5f637a9979fdeeb1300d1fbe8
BLAKE2b-256 16b8abf7819f99422861f017f04919be6e075ab15d5386400fd13d2bd2d266ba

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page