Then install cutensor and cupy for acceleration (please switch the versions according to your runtime CUDA environment!)
pip3 install cutensor-cu12 cupy-cuda12x
There shouldn’t be cupy or cutensor compilation during pip install process. If you see the following warning at the beginning of a gpu4pyscf job, it implies problems with cupy and cutensor installation (likely a version mismatch, or multiple versions of same package installed).
<repo_path>/gpu4pyscf/lib/cutensor.py:<line_number>: UserWarning: using cupy as the tensor contraction engine.
Features
Density fitting scheme and direct SCF scheme;
SCF, analytical gradient, and analytical Hessian calculations for Hartree-Fock and DFT;
LDA, GGA, mGGA, hybrid, and range-separated functionals via libXC;
Spin-conserved and spin-flip TDA and TDDFT for excitated states;
Geometry optimization and transition state search via geomeTRIC;
@misc{li2024introducting,
title={Introducing GPU-acceleration into the Python-based Simulations of Chemistry Framework},
author={Rui Li and Qiming Sun and Xing Zhang and Garnet Kin-Lic Chan},
year={2024},
eprint={2407.09700},
archivePrefix={arXiv},
primaryClass={physics.comp-ph},
url={https://arxiv.org/abs/2407.09700},
}
@misc{wu2024enhancing,
title={Enhancing GPU-acceleration in the Python-based Simulations of Chemistry Framework},
author={Xiaojie Wu and Qiming Sun and Zhichen Pu and Tianze Zheng and Wenzhi Ma and Wen Yan and Xia Yu and Zhengxiao Wu and Mian Huo and Xiang Li and Weiluo Ren and Sheng Gong and Yumin Zhang and Weihao Gao},
year={2024},
eprint={2404.09452},
archivePrefix={arXiv},
primaryClass={physics.comp-ph},
url={https://arxiv.org/abs/2404.09452},
}
GPU plugin for PySCF
Installation
To check your installed CUDA Toolkit version, run
Then, install the appropriate package based on your CUDA version:
pip3 install gpu4pyscf-cuda11xpip3 install cutensor-cu11pip3 install gpu4pyscf-cuda12xpip3 install cutensor-cu12pip3 install gpu4pyscf-cuda13xpip3 install cutensor-cu13The versions of CuPy and cuTENSOR are strongly interdependent and should not be combined arbitrarily. The recommended combinations include:
Using other versions or combinations may lead to failures in functionality. We recommend creating a dedicated environment using:
This ensures compatibility and reproducibility, especially since this configuration is used in our nightly benchmarks.
Compilation
To compile the package, run the following commands:
Then install cutensor and cupy for acceleration (please switch the versions according to your runtime CUDA environment!)
There shouldn’t be cupy or cutensor compilation during pip install process. If you see the following warning at the beginning of a gpu4pyscf job, it implies problems with cupy and cutensor installation (likely a version mismatch, or multiple versions of same package installed).
Features
The following features are still in the experimental stage
Limitations
Examples
Find more examples in gpu4pyscf/examples
Benchmarks
Speedup with GPU4PySCF v0.6.0 on A100-80G over Q-Chem 6.1 on 32-cores CPU (density fitting, SCF, def2-tzvpp, def2-universal-jkfit, B3LYP, (99,590))
Find more benchmarks in gpu4pyscf/benchmarks
References