forked from pyscf/gpu4pyscf
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
1,073 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
name: CI | ||
|
||
on: [push] | ||
on: #[push] | ||
|
||
jobs: | ||
build: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a single version of Python | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | ||
|
||
name: self hosted CI | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
pull_request: | ||
branches: [ "master" ] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: self-hosted | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install dependencies | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
pip3 install flake8 pytest coverage | ||
- name: Build GPU4PySCF | ||
run: | | ||
export CUDA_HOME=/usr/local/cuda | ||
export PATH=${CUDA_HOME}/bin:${PATH} | ||
export LD_LIBRARY_PATH=${CUDA_HOME}/lib64:$LD_LIBRARY_PATH | ||
sh build.sh | ||
- name: Test with pytest | ||
run: | | ||
echo $GITHUB_WORKSPACE | ||
export PYTHONPATH="${PYTHONPATH}:$GITHUB_WORKSPACE" | ||
coverage run -m pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Contributing Guidelines | ||
|
||
We welcome contributions from everyone. Please follow the guidelines below when | ||
adding features to the library for PySCF functions running on GPU devices. | ||
|
||
## Principles | ||
|
||
* Functions in GPU4PySCF are meant to be performance-optimized versions of | ||
the features implemented in PySCF. The primary focus of this library is on | ||
performance. It is understandable and acceptable to have some API differences | ||
and incompatibilities with the PySCF CPU code. | ||
|
||
* GPU4PySCF functions may process input data or objects created by PySCF. It is | ||
important to consider this possibility and perform necessary data type | ||
conversions in GPU4PySCF functions. However, the data or objects produced by | ||
GPU4PySCF do not need to be directly consumed by PySCF functions. In other | ||
words, you only need to ensure that GPU4PySCF supports PySCF functions and not | ||
the other way around. | ||
|
||
* GPU4PySCF uses CuPy arrays as the default array container. Please ensure that | ||
functions in GPU4PySCF can handle any possible mixing of CuPy and NumPy | ||
arrays, as many NumPy ufunc operations do not support this mixing. | ||
|
||
## Naming Conventions | ||
|
||
* If the GPU module has a corresponding one in PySCF, please consider using | ||
the same function names and similar function signatures. | ||
|
||
## Additional Suggestions | ||
|
||
* If applicable, Please consider providing the `to_cpu` method to convert the | ||
GPU4PySCF object to the corresponding PySCF object, and also providing the | ||
`to_gpu` method in the corresponding classes in PySCF. | ||
|
||
* Inheriting classes from the corresponding classes in PySCF is not required. | ||
If you choose to inherit classes from PySCF, please mute the unsupported | ||
methods. You can overwrite the unsupported methods with a dummy method that | ||
raise a `NotImplementedError`. Alternatively, you can assign the Python | ||
keyword `None` or `NotImplemented` to these methods. | ||
|
||
* When writing unit tests, please consider including tests: | ||
- To verify the values returned by the functions against the corresponding values in PySCF. | ||
- To ensure proper handling of data conversions for those produced by PySCF CPU code. | ||
|
||
* While examples or documentation are not mandatory, it is highly recommended to | ||
include examples of how to invoke the new module. | ||
|
||
* CUDA compute capability 70 (sm_70) is required. Please avoid using features | ||
that are only available on CUDA compute capability 80 or newer. The CUDA code | ||
should be compiled and run using CUDA 11 and CUDA 12 toolkits. | ||
|
||
Thank you for your contributions! |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Copyright 2023 The GPU4PySCF Authors. All Rights Reserved. | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
import numpy as np | ||
import pyscf | ||
from gpu4pyscf.cc import ccsd_incore | ||
|
||
mol = pyscf.M( | ||
atom = 'Vitamin_C.xyz', | ||
basis = 'cc-pvdz', | ||
verbose=5) | ||
|
||
mf = mol.RHF().run() | ||
mf.with_df = None | ||
e_tot = ccsd_incore.CCSD(mf).kernel() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.