Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
torchani
Commits
2dbfd835
Commit
2dbfd835
authored
May 30, 2025
by
zhanggezhong
Browse files
Update README.md
parent
2ba793e4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
71 additions
and
31 deletions
+71
-31
README.md
README.md
+71
-31
No files found.
README.md
View file @
2dbfd835
# <div align="center"><strong>Torchani</strong></div>
# <div align="center"><strong>Torchani</strong></div>
## 简介
## 简介
torchani 是一个基于 PyTorch 的神经网络势能(ANI)的开源实现。ANI 是一种利用深度学习模型来预测分子间相互作用力的方法,广泛应用于分子动力学模拟、化学反应路径探索等领域。torchani 的设计目标是提供一种高效、易于使用且高度可扩展的神经网络势能计算工具。
torchani 是一个基于 PyTorch 的神经网络势能(ANI)的开源实现。ANI 是一种利用深度学习模型来预测分子间相互作用力的方法,广泛应用于分子动力学模拟、化学反应路径探索等领域。torchani 的设计目标是提供一种高效、易于使用且高度可扩展的神经网络势能计算工具。
## 安装
## 安装
源码编译安装,该方式需要安装torch及fastpt工具包;注意使用fastpt包进行源码编译安装时,要严格匹配fastpt、torch、dtk之间的版本号,例如基于dtk2504编译,则fastpt、torch都必须是dtk2504的包,其中fastpt与torch对应的版本号关系为
组件支持组合
| | fastpt版本 | torch版本 | DTK版本 |
| - | -------- | ------- | ------------ |
| PyTorch版本 | fastpt版本 |torchani版本 | DTK版本 | Python版本 | 推荐编译方式 |
| 1 | 2.0.1+das.dtk2504 | v2.4.1 | dtk2504|
| ----------- | ----------- | ----------- | ------------------------ | -----------------| ------------ |
| 1 | 2.1.0+das.dtk2504 | v2.5.1 | dtk2504|
| 2.5.1 | 2.1.0 |2.2.4 | >= 25.04 | 3.8、3.10、3.11 | fastpt不转码 |
| 1 | 2.0.1+das.dtk25041 | v2.4.1 | dtk25041|
| 2.4.1 | 2.0.1 |2.2.4 | >= 25.04 | 3.8、3.10、3.11 | fastpt不转码 |
| 1 | 2.1.0+das.dtk25041 | v2.5.1 | dtk25041|
+
pytorch版本大于2.4.1 && dtk版本大于25.04 推荐使用fastpt不转码编译。
## 编译流程
```
### 1、使用pip方式安装
pip3 install pytest
torchani whl包下载目录:
[
光和开发者社区
](
https://download.sourcefind.cn:65024/4/main/
)
,选择对应的pytorch版本和python版本下载对应torchani的whl包
pip3 install wheel
```
shell
pip3 isntall ase
pip
install
torch
*
(
下载torch的whl包
)
pip3 install fastpt-2.0.1+das.dtk2504-py3-none-any.whl #以torch2.4.1,dtk2504为例
pip
install
fastpt
*
--no-deps
(
下载fastpt的whl包
)
git clone https://developer.sourcefind.cn/codes/OpenDAS/torchani.git
source
/usr/local/bin/fastpt
-E
cd torchani
pip
install
torchani
*
(
下载的torchani-fastpt的whl包
)
git checkout * #切换到相应分支
source /usr/local/bin/fastpt -c
python3 setup.py bdist_wheel --cuaev# 该指令用于编译whl包,执行该指令时不必执行前两个指令
```
## 验证安装
```
```
pip3 list | grep torchani
### 2、使用源码编译方式安装
python3
import torchani
#### 编译环境准备
torchani.__version__
提供基于fastpt不转码编译:
#返回版本号
1.
基于光源pytorch基础镜像环境:镜像下载地址:
[
光合开发者社区
](
https://sourcefind.cn/#/image/dcu/pytorch
)
,根据pytorch、python、dtk及系统下载对应的镜像版本。
2.
基于现有python环境:安装pytorch,fastpt whl包下载目录:
[
光合开发者社区
](
https://sourcefind.cn/#/image/dcu/pytorch
)
,根据python、dtk版本,下载对应pytorch的whl包。安装命令如下:
```
shell
pip3
install
pytest
pip3
install
wheel
pip3 isntall ase
pip
install
torch
*
(
下载torch的whl包
)
pip
install
fastpt
*
--no-deps
(
下载fastpt的whl包, 安装顺序,先安装torch,后安装fastpt
)
pip
install
setuptools
==
59.5.0 wheel
```
```
## 测试
执行测试前需要执行download.sh脚本下载所需数据
#### 源码编译安装
-
代码下载
```
shell
git clone http://developer.sourcefind.cn/codes/OpenDAS/torchani.git
# 根据编译需要切换分支
```
```
source /usr/local/bin/fastpt -e
-
提供2种源码编译方式(进入torchani目录):
cd tests
```
pytest vs
1. 设置不转码编译环境变量
source /usr/local/bin/fastpt -C
2. 编译whl包并安装
python3 setup.py -v bdist_wheel -cuaev
pip install dist/torchani*
3. 源码编译安装
python3 setup.py install -cuaev
```
#### 注意事项
+
若使用pip install下载安装过慢,可添加pypi清华源:-i https://pypi.tuna.tsinghua.edu.cn/simple/
+
ROCM_PATH为dtk的路径,默认为/opt/dtk
+
在pytorch2.5.1环境下编译需要支持c++17语法,打开setup.py文件,把文件中的 -std=c++14 修改为 -std=c++17
## 验证
```
```
python3
Python 3.10.12 (main, Feb 4 2025, 14:57:36) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torchani
>>> torchani.__version__
'2.2.4'
>>>
```
版本号与官方版本同步,查询该软件的版本号,例如2.2.4;
## Known Issue
-
无
## 参考资料
-
[
README_ORIGIN
](
README_ORIGIN.md
)
-
[
README_zh-CN
](
README_zh-CN.md
)
-
[
https://github.com/aiqm/torchani
](
https://github.com/aiqm/torchani
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment