Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge updates from main #131

Merged
merged 72 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
9057f50
Fix dataset notebook link
awf Sep 19, 2023
de05e39
Merged files, removed pmap_experimental.
Sep 19, 2023
f03fef3
Moving main back into function so CLI pass.
Sep 19, 2023
39ee61f
Update README.md
awf Sep 19, 2023
6d8cbd2
Fixing import.
Sep 19, 2023
9ab5853
Fixing another import.
Sep 19, 2023
50d1bae
Fixing import; only import tesselate stuff if user uses backend=ipu a…
Sep 19, 2023
8556353
Update nanoDFT.py
AlexanderMath Sep 19, 2023
c1c3561
Fixing another import.
Sep 19, 2023
63a494f
Merge branch 'merge_nanoDFT' of github.com:graphcore-research/pyscf-i…
Sep 19, 2023
372744f
Fixing import
Sep 19, 2023
da38195
Adding contribution guide and enable copyright checks as a pre-commit…
hatemhelal Sep 19, 2023
055c6c9
Update nanoDFT.py
AlexanderMath Sep 20, 2023
543d126
Update nanoDFT.py
AlexanderMath Sep 20, 2023
58c7110
Update nanoDFT.py
AlexanderMath Sep 20, 2023
5f30f11
Fixing merge of E_J and E_K into E_diff_JK
Sep 20, 2023
4fadcd8
Merge pull request #97 from graphcore-research/merge_nanoDFT
AlexanderMath Sep 20, 2023
0aa0794
Notebook for SPICE nao_nr() stats
paolot-gc Sep 20, 2023
3dba5f1
Adding fullerene c20, c100 and c180.
Sep 20, 2023
fb4e143
Initial refactor on grad.py
Sep 20, 2023
cb8306e
simplified python grad code calling libcint.
Sep 20, 2023
323ad04
Adding draft for forces.
Sep 20, 2023
f7a692c
Merge pull request #103 from graphcore-research/add_fullerene
AlexanderMath Sep 21, 2023
916ab41
Merge pull request #102 from graphcore-research/SPICE-nao_nr
AlexanderMath Sep 21, 2023
610d64f
work
Sep 21, 2023
93cc525
adding all integrals
Sep 21, 2023
a3208e2
Refactor notebook (#90)
awf Sep 21, 2023
1c1d762
Configure pytest to show stdout and use verbose outputs (#99)
hatemhelal Sep 21, 2023
61d7839
Configure additional linters as pre-commit checks (#106)
hatemhelal Sep 22, 2023
83eaf65
Swap links
awf Sep 22, 2023
549e9e8
Work on libcint.c
Sep 22, 2023
4839e73
Merge pull request #96 from graphcore-research/awf/README
mihaipgc Sep 22, 2023
a5fc8f5
work on integrals.
Sep 25, 2023
8edf73d
Add copyright check as separate step (#108)
hatemhelal Sep 25, 2023
9fc56f0
compile script for cpp compile; both c++ and c compiles.
Sep 25, 2023
8b8b931
Adding support for float32 through #define dtype float/double.
Sep 25, 2023
6bbbf7e
adding tools for plotting with py3dmol (#109)
hatemhelal Sep 27, 2023
ec94c8b
Add function decorator for comparing fp64 to fp32 (#110)
hatemhelal Sep 27, 2023
91f5ee2
All one electron integrals passing for C++, IPU_model and IPU for H2 …
Sep 29, 2023
4538635
Got ERI to pass. Next is eri_grad. After this, will have to fix a bun…
Sep 30, 2023
023e114
Refactoring special function implementations (#112)
hatemhelal Sep 30, 2023
77175ed
Got derivative of ERI.
Sep 30, 2023
bc71a2d
Cleaning up folder and test cases.
Sep 30, 2023
575dedf
Cleaned a few things.
Sep 30, 2023
0571e79
Prettified test cases and put output in readme.
Sep 30, 2023
53c07ca
Changing name to popcint.
Sep 30, 2023
9cf216f
changing folder name
Sep 30, 2023
6c18443
Update readme.MD
AlexanderMath Sep 30, 2023
b92cbf2
Update readme.MD
AlexanderMath Sep 30, 2023
8ce74ac
Adding python suppor/test to help with tilemapping.
Oct 1, 2023
20f62ea
adding single ipu profiling to direct.sh script.
Oct 1, 2023
46a26f7
Fixed bug in script to run test cases.
Oct 1, 2023
187e308
Adding quick test case with all cpu using -skipipu. Neat for quickly …
Oct 1, 2023
c94b49d
Merge branch 'main' into libcint
Oct 1, 2023
3f18d5e
use 2d pos if 3d pos not found
Oct 3, 2023
a833f50
Update pyscf_ipu/electron_repulsion/direct.sh
AlexanderMath Oct 4, 2023
dbf4e92
add num_error visualisation on demand
akrzgc Oct 6, 2023
33506f0
Merge pull request #115 from graphcore-research/bb/pubchem_2d_positions
blazejba Oct 9, 2023
9ca8e13
Series implementation of auxiliary gamma function (#119)
hatemhelal Oct 9, 2023
8b0ee07
Reorganise unit tests to better match source layout (#122)
hatemhelal Oct 10, 2023
5d1e67e
sparse grid ao along (0,2) axes
Oct 3, 2023
cd2b2d5
print sparsity llevels before deleting elements
Oct 9, 2023
39527d5
Merge pull request #114 from graphcore-research/bb/low-hanging-sparse…
blazejba Oct 10, 2023
9a1e9b3
Add binom factor notebook (#123)
awf Oct 10, 2023
bd5c7ff
Merge pull request #118 from graphcore-research/visualise_num_error
akrzgc Oct 10, 2023
6adaf39
Merge branch 'libcint' of github.com:graphcore-research/pyscf-ipu int…
Oct 12, 2023
6909bb6
Removing fixed sizes by using InOut instead of Input. Added TODO expl…
Oct 12, 2023
2fb81a0
Fixed kinetic grad and added a todo.
Oct 12, 2023
083f762
Changed so re-use same graph for nuc/kin/ovlp (similar for grad versi…
Oct 12, 2023
c21b92b
Merge pull request #113 from graphcore-research/libcint
AlexanderMath Oct 13, 2023
0e986f6
Update basisset to use numpy over jax.numpy (#126)
hatemhelal Oct 17, 2023
141a281
Add function for computing the nuclear repulsion energy (#127)
hatemhelal Oct 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[flake8]
max-line-length = 88
extend-ignore = E203

copyright-check = True
copyright-author = Graphcore Ltd
14 changes: 14 additions & 0 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Pre-Commit Checks

on:
pull_request:
push:
branches: [main]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pre-commit/[email protected]
2 changes: 1 addition & 1 deletion .github/workflows/unittest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ jobs:
JAX_IPU_MODEL_NUM_TILES: 46
JAX_PLATFORMS: cpu,ipu
run: |
pytest -s .
pytest .
2 changes: 2 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[settings]
profile=black
37 changes: 37 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: end-of-file-fixer
files: (^pyscf_ipu/experimental/)|(^test/)|(\.(cfg|txt|flake8|ini))
- id: trailing-whitespace
files: (^pyscf_ipu/experimental/)|(^test/)

- repo: https://github.com/psf/black
rev: 23.9.1
hooks:
- id: black-jupyter
files: (^pyscf_ipu/experimental/)|(^test/)
name: Format code

- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
files: (^pyscf_ipu/experimental/)|(^test/)
name: Sort imports

- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
hooks:
- id: flake8
files: (^pyscf_ipu/experimental/)|(^test/)
name: Check PEP8

- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
hooks:
- id: flake8
args: [--select=C]
additional_dependencies: [flake8-copyright]
name: copyright check
2 changes: 2 additions & 0 deletions .pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[pytest]
addopts = -s -v --durations=10
91 changes: 91 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Contributing to pyscf-ipu

This project is still evolving but at the moment is focused around a high-performance and easily hackable implementation of Gaussian basis set DFT.
We hope this is useful for the generation of large-scale datasets needed
for training machine-learning models. We are interested in hearing any and
all feedback so feel free to raise any questions, bugs encountered, or enhancement requests as [Issues](https://github.com/graphcore-research/pyscf-ipu/issues).

## Setting up a development environment
We recommend using the conda package manager as this can automatically enable
the Graphcore Poplar SDK. This is particularly useful in VS Code which can automatically
activate the conda environment in a variety of scenarios:
* visual debugging
* running quick experiments in an interactive Jupyter window
* using VS code for Jupyter notebook development.

The following assumes that you have already set up an install of conda and that
the conda command is available on your system path. Refer to your preferred conda
installer:
* [miniforge installation](https://github.com/conda-forge/miniforge#install)
* [conda installation documentation](https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html).

1. Create a new conda environment with the same python version as required by the Poplar SDK.
For example, on ubuntu 20 use `python=3.8.10`
```bash
conda create -n pyscf-ipu python=3.8.10
```

2. Confirm that you have the Poplar SDK installed on your machine and store the location
in a temporary shell variable. The following will test that the SDK is found and
configured correctly:
```bash
TMP_POPLAR_SDK=/path/to/sdk
source $TMP_POPLAR_SDK/enable
gc-monitor

3. Activate the environment and make POPLAR_SDK a persistent environment variable.
```bash
conda activate pyscf-ipu
conda env config vars set POPLAR_SDK=$TMP_POPLAR_SDK
```

4. You have to reactivate the conda environment to use the `$POPLAR_SDK`
variable in the environment.
```bash
conda deactivate
conda activate pyscf-ipu
```

5. Setup the conda environment to automatically enable the Poplar SDK whenever
the environment is activated.
```bash
mkdir -p $CONDA_PREFIX/etc/conda/activate.d
echo "source $POPLAR_SDK/enable" > $CONDA_PREFIX/etc/conda/activate.d/enable.sh
```

6. Check that everything is working by once reactivating the pyscf-ipu
environment _in a new shell_ and calling `gc-monitor`:
```bash
conda deactivate
conda activate pyscf-ipu
gc-monitor

7. Install all required packages for developing JAX DFT:
```bash
pip install -e ".[ipu,test]"
```

8. Install the pre-commit hooks
```bash
pre-commit install
```

9. Create a feature branch, make changes, and when you commit them the
pre-commit hooks will run.
```bash
git checkout -b feature
...
git push --set-upstream origin feature
```
The last command will prints a link that you can follow to open a PR.


## Testing
Run all the tests using `pytest`
```bash
pytest
```
We also use the nbmake package to check our notebooks work in the `IpuModel` environment. These checks can also be run on IPU hardware equiped machines e.g.:
```bash
pytest --nbmake --nbmake-timeout=3000 notebooks/nanoDFT-demo.ipynb
```
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[![notebook-tests](https://github.com/graphcore-research/pyscf-ipu/actions/workflows/notebooks.yaml/badge.svg)](https://github.com/graphcore-research/pyscf-ipu/actions/workflows/notebooks.yaml)
[![nanoDFT CLI](https://github.com/graphcore-research/pyscf-ipu/actions/workflows/cli.yaml/badge.svg)](https://github.com/graphcore-research/pyscf-ipu/actions/workflows/cli.yaml)
[![unit tests](https://github.com/graphcore-research/pyscf-ipu/actions/workflows/unittest.yaml/badge.svg)](https://github.com/graphcore-research/pyscf-ipu/actions/workflows/unittest.yaml)
[![pre-commit checks](https://github.com/graphcore-research/pyscf-ipu/actions/workflows/pre-commit.yaml/badge.svg)](https://github.com/graphcore-research/pyscf-ipu/actions/workflows/pre-commit.yaml)

[**Installation guide**](#installation)
| [**Example DFT Computations**](#example-dft-computations)
Expand Down Expand Up @@ -31,7 +32,7 @@ To generate datasets based on the paper __Repurposing Density Functional Theory

To run the notebook on Graphcore IPU hardware on Paperspace:

[![Run on Gradient](https://assets.paperspace.io/img/gradient-badge.svg)](https://ipu.dev/ipobmC)
[![Run on Gradient](https://assets.paperspace.io/img/gradient-badge.svg)](https://ipu.dev/YX0jlK)

### For DFT teaching and learning: nanoDFT

Expand All @@ -43,6 +44,7 @@ To run the notebook on Graphcore IPU hardware on Paperspace:
[![Run on Gradient](https://assets.paperspace.io/img/gradient-badge.svg)](https://ipu.dev/ipobmC)



Additional notebooks in [notebooks](notebooks) demonstrate other aspects of the computation.

## Installation
Expand Down
Loading