表 1 版本配套表
| 配套 | 版本 | 环境准备指导 |
|---|---|---|
| Python | 3.11.10 | - |
| torch | 2.1.0 | - |
# 增加软件包可执行权限,{version}表示软件版本号,{arch}表示CPU架构,{soc}表示昇腾AI处理器的版本。
chmod +x ./Ascend-cann-toolkit_{version}_linux-{arch}.run
chmod +x ./Ascend-cann-kernels-{soc}_{version}_linux.run
chmod +x ./Ascend-cann-nnal_{version}_linux-{arch}.run (若使用稀疏FA)
# 校验软件包安装文件的一致性和完整性
./Ascend-cann-toolkit_{version}_linux-{arch}.run --check
./Ascend-cann-kernels-{soc}_{version}_linux.run --check
./Ascend-cann-nnal{version}_linux-{arch}.run --check (若使用稀疏FA)
# 安装
./Ascend-cann-toolkit_{version}_linux-{arch}.run --install
./Ascend-cann-kernels-{soc}_{version}_linux.run --install
./Ascend-cann-nnal{version}_linux-{arch}.run --torch_atb --install (若使用稀疏FA)
# 设置环境变量
source /usr/local/Ascend/ascend-toolkit/set_env.sh
source /usr/local/Ascend/nnal/atb/set_env.shpip3 install -r requirements.txt# 增加软件包可执行权限,{version}表示软件版本号,{arch}表示CPU架构。
chmod +x ./Ascend-mindie_${version}_linux-${arch}.run
./Ascend-mindie_${version}_linux-${arch}.run --check
# 方式一:默认路径安装
./Ascend-mindie_${version}_linux-${arch}.run --install
# 设置环境变量
cd /usr/local/Ascend/mindie && source set_env.sh
# 方式二:指定路径安装
./Ascend-mindie_${version}_linux-${arch}.run --install-path=${AieInstallPath}
# 设置环境变量
cd ${AieInstallPath}/mindie && source set_env.sh下载 pytorch_v{pytorchversion}_py{pythonversion}.tar.gz
tar -xzvf pytorch_v{pytorchversion}_py{pythonversion}.tar.gz
# 解压后,会有whl包
pip install torch_npu-{pytorchversion}.xxxx.{arch}.whl# 若环境镜像中没有gcc、g++,请用户自行安装
yum install gcc
yum install g++
# 导入头文件路径
export CPLUS_INCLUDE_PATH=/usr/include/c++/12/:/usr/include/c++/12/aarch64-openEuler-linux/:$CPLUS_INCLUDE_PATH注:若使用openeuler镜像,需要配置gcc、g++环境,否则会导致fatal error: 'stdio.h' file not found
| 模型 | 链接 |
|---|---|
| HunyuanWorld-Voyager | huggingface |
| 模型 | 链接 |
|---|---|
| HunyuanWorld-Voyager | Modelscope |
git clone https://modelers.cn/MindIE/HunyuanWorld-Voyager.git将上一步下载的权重放在ckpts路径下
ln -s /XX/HunyuanWorld-Voyager/* ckpts/优化点:LA
执行命令:run.sh
export PYTORCH_NPU_ALLOC_CONF='expandable_segments:True'
export TASK_QUEUE_ENABLE=2
export CPU_AFFINITY_CONF=1
export TOKENIZERS_PARALLELISM=false
export ALGO=1
python3 sample_image2video.py \
--model HYVideo-T/2 \
--input-path "examples/case1" \
--prompt "An old-fashioned European village with thatched roofs on the houses." \
--i2v-stability \
--infer-steps 50 \
--flow-reverse \
--flow-shift 7.0 \
--seed 0 \
--embedded-cfg-scale 6.0 \
--save-path ./results参数说明:
优化点:LA、Attention cache、USP+Ring、VAE并行等
执行命令:run_mul.sh
export PYTORCH_NPU_ALLOC_CONF='expandable_segments:True'
export TASK_QUEUE_ENABLE=2
export CPU_AFFINITY_CONF=1
export TOKENIZERS_PARALLELISM=false
export ALGO=1
torchrun --master_port=2031 --nproc_per_node=8 \
sample_image2video.py \
--model HYVideo-T/2 \
--input-path "examples/case1" \
--prompt "An old-fashioned European village with thatched roofs on the houses." \
--i2v-stability \
--infer-steps 50 \
--flow-reverse \
--flow-shift 7.0 \
--seed 0 \
--embedded-cfg-scale 6.0 \
--save-path ./results \
--ulysses-degree 8 \
--ring-degree 1 \
--use_attentioncache \
--vae-parallel参数说明:
优化点:LA、Attention cache、USP+Ring、VAE并行等
执行命令:run_mul_node1.sh、run_mul_node2.sh
| 模型 | 分辨率 | 帧数 | 迭代次数 | 卡数 | E2E耗时 |
|---|---|---|---|---|---|
| HunyuanWorld-Voyager | 512×768 | 49 | 50 | 8 | 116.5s |
Directory operation failed. Reason: Directory [/usr/local/Ascend/mindie/latest/mindie-rt/aoe] does not exist,请设置环境变量unset TUNE_BANK_PATHfatal error: 'stdio.h' file not found,请参考1.6 gcc、g++安装Failed to bind the IP port. Reason: The IP address and port have been bound already.
HCCL function error :HcclGetRootInfo(&hcclID), error code is 7: 请配置export HCCL_HOST_SOCKET_PORT_RANGE="auto"不指定端口
HCCL function error :HcclGetRootInfo(&hcclID), error code is 11: 请配置sysctl -w net.ipv4.ip_local_reserved_ports=60000-60015预留端口