hdk:25.5.0
cann:8.3.RC1
python:3.10
torch:2.6.0
torch-npu:2.6.0git clone https://atomgit.com/AI4Science/esm3.git
cd esm31.创建虚拟环境
conda create -n Esm3 python=3.10 -y
conda activate Esm32.安装依赖
# 安装项目基础依赖包
pip install esm
pip uninstall triton
pip install torch==2.6.0 torch_npu==2.6.0 pyyaml cloudpickle ml-dtypes psutil tornado absl-py httpx
pip install "huggingface-hub>=0.24.0,<1.0" -Upython3 -c "import torch;import torch_npu; a = torch.randn(3, 4).npu(); print(a + a);"若输出类似以下信息,说明安装成功:
tensor([[-0.6066, 6.3385, 0.0379, 3.3356],
[ 2.9243, 3.3134, -1.5465, 0.1916],
[-2.1807, 0.2008, -1.1431, 2.1523]], device='npu:0')若报错,排查顺序:
下载huggingface上的全部内容,放到/root/.cache/torch/hub/checkpoints/esm3-sm-open-v1目录下
https://huggingface.co/EvolutionaryScale/esm3-sm-open-v1/tree/mainexport CPU_AFFINITY_CONF=1
export TASK_QUEUE_ENABLE=2# source cann
source /usr/local/Ascend/ascend-toolkit/set_env.sh
# 指定可见 NPU 卡(0,1,2,3)
export ASCEND_RT_VISIBLE_DEVICES=0
# 运行
python test-esm3.py已预置 Conda 运行环境、模型权重、esm3源码,开箱即用,可快速部署运行。
# 拉取镜像
sudo docker pull swr.cn-north-4.myhuaweicloud.com/ascend_ai4s/esm3:v1