-
Notifications
You must be signed in to change notification settings - Fork 94
Make some computations in DFTK GPU-compatible #712
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
Merged
Merged
Changes from 93 commits
Commits
Show all changes
98 commits
Select commit
Hold shift + click to select a range
e17fb59
LOBPCG with GPU support (CUDA). Does not yet support preconditionning
GVigne e80f5b6
Merge branch 'master' into gpu_hpc
GVigne ed15b32
MWE for self_consistent_field with GPU support (CUDA). Only works wit…
GVigne 19bfa69
Fix package version conflicts while merging
GVigne f4748ac
Stop using BlockArrays and use a custom BlockVector for GPU compatibi…
GVigne 94f1d2a
GPU support for AtomicLocal term
GVigne 60d8041
First GPU implementation of the non local term + LOBPCG enhancement
GVigne fb6484a
Merge branch 'master' into gpu_hpc
GVigne cf1dc3c
add timed examples
mfherbst 11b85f0
Change some code organisation after PR's feedback
GVigne abb99f4
Code organisation and performance optimisation after PR's feedback
GVigne a89171a
Code refactoring following PR's feedback
GVigne 44bcb61
PWB is now parametric on the array type: this also fixes type issues
GVigne 646b44c
Update workarounds: remove iszero and isone, add eigen
GVigne 76c697d
Rename block_mul into * + build e on GPU
GVigne bd684d7
Modify the change of basis functions to be GPU compatible
GVigne f02c954
Merge branch 'master' into gpu_hpc
GVigne 15d1324
Keep this branch synced with LOBPCG_GPU
GVigne 62d9f79
Add the Hartree term
GVigne 19100cf
Remove CUDA dependency from ortho_qr
GVigne 1184ec1
Bugfix when plotting bandstructure + typo fixes
GVigne 833928b
Make all mixings except Chi0 mixing GPu compatible
GVigne e12f35b
Prettier way to overload eigen for CuArrays
GVigne a0c4066
Update comments + remove unnecessary code
GVigne 9cdff93
Update the GPU example
GVigne 20b7b10
Put the Gvectors for each kpoint on the GPU
GVigne a2d811b
Bugfix after launching the tests
GVigne 8ee55a4
Put the occupation on GPU
GVigne 7909720
Merge branch 'master' into gpu_hpc
GVigne b700d1c
GPU compatibility for Anderson acceleration
GVigne 981e7a1
Remove unnecessary dependencies
GVigne 272ff85
Merge commit '7bd07e3cbbe847ad71eb2f7f2524d1ff70e47b5b' into gpu_hpc
GVigne c8af93d
Merge commit 'b83c3cc3c3b3f551970aa8bda1379203f6797669' into gpu_hpc
GVigne acd4bef
Merge commit '3448b533d3486278bda44689963c72d5168e83fa' into gpu_hpc
GVigne 06b07cc
Merge commit 'a96f551ed78a47f6cbd5280fedf08f6a7443d31e' into gpu_hpc
GVigne 8b294da
Merge commit 'd28391e6ffb366168fc43ea61e5cac9d04b252e3' into gpu_hpc
GVigne b5b0d09
Merge commit '3ce3b2c5e84f728d12b8e74792ecd31c24ddd5e0' into gpu_hpc
GVigne 9177e8b
Merge commit '353c11f1871adffae8bcbad9aadb95faa929f718' into gpu_hpc
GVigne 5c3b620
Crude bugfix for the nbands algorithm
GVigne bf77db2
Less CPU-GPU transfers in guess_density + whitespaces
GVigne ce05d66
Merge branch 'master' into gpu_hpc
GVigne 0c8067e
Whitespaces, typos + stick to the same conventions
GVigne 95fe043
Merge branch 'master' into gpu_hpc
GVigne b511225
Removed unnecessary imports
GVigne 28e05e7
WIP: solve dependency issues
GVigne 1c5a5b5
Adapt the workarounds for forward differentiation to the new API
GVigne 06eb5b6
WIP: remove TaskLocalRNG for julia versions < 1.6
GVigne de28ac4
Better fallback for TaskLocalRng for Julia < 1.6
GVigne 866d6bf
Change build_fft_plans in fft_generic.jl to take arrays as arguments
GVigne 2008199
Merge branch 'master' into gpu_hpc
GVigne 7ad1744
Fixes
mfherbst 278a001
Merge commit '175937aaff610da98b5606f06dbaf62029af31e0' into gpu_hpc
GVigne a3e9acc
Merge commit '9381bf4e250f633673958e9f90c47faffc8a7144' into gpu_hpc
GVigne 682dbde
Merge commit '3b1bffff7f116ad239fbea17cae1acc150213736' into gpu_hpc
GVigne ca75332
Merge commit '5f24d3dbde5aa71f4c3367f0ba5558fefd22dada' into gpu_hpc
GVigne f6e45b9
Fix tests
GVigne bd4e315
Update examples/gpu.jl
mfherbst a339a4d
Fix CPU performance bug when using FFTs
GVigne 695263a
WIP: remove the AT type in PWB
GVigne 7afc5fd
WIP: copy_like also takes Type arguments
GVigne 2563c58
Remove AT parameter from PWB
GVigne 2d17ebc
Merge commit '6e6d523b4780f43cc534153bd1de929907295bf4' into gpu_hpc
GVigne 8088d67
Merge branch 'master' into gpu_hpc
GVigne d9d9da1
Add Kpoints's array type as a parametric type in PWB
GVigne 0a69e2c
Fix serialization test
GVigne b4e6fd5
Merge branch 'master' into gpu_hpc
mfherbst ecfd306
Fix example
mfherbst 3401d79
Merge branch 'master' into gpu_hpc
mfherbst 4c45977
Simplify coordinate transformation routines
mfherbst 5e4d37a
More refactoring ... barely tested, might fail
mfherbst 6dc6c82
Fixes
mfherbst a6fe22b
Remove array_type and use AbstractArchitecture structure instead
GVigne 6e12d3a
Merge branch 'master' into gpu_hpc
GVigne 866598c
Fixes
GVigne 0bcd3d1
Fix failing tests
GVigne d13fa56
Code clarification and better comments
GVigne 085ca99
Refactoring/code cleanup
GVigne 9d72ba0
Merge branch 'master' into gpu_hpc
GVigne 8c6ac54
Replace sum(abs2(...)) by norm2 function
GVigne a02cd21
Bugfix: extend norm2 to any array
GVigne 0d845fc
Merge branch 'master' into gpu_hpc
GVigne 349b8f1
Remove convert_like and add to_device
GVigne 778712d
Update comments and docstring
GVigne c39ee19
Enforce the use of to_cpu instead of Array when doing GPU-CPU transfers
GVigne 4501bd9
Small polishing
mfherbst 60506b9
Formatting, updating comments and small nits
GVigne 147c81d
Remove architecture argument from G_vectors + infer type in kinetic_e…
GVigne da1ac09
Merge branch 'gpu_hpc' of github.com:GVigne/DFTK.jl into gpu_hpc
GVigne 8a40af5
Inline _closure_matmatmul
GVigne 5ee546b
Rename closures and small changes to ortho_qr and build_kpoints
GVigne b7b611a
Hard-code CPU architecture
mfherbst fbe675d
Merge branch 'master' into gpu_hpc
mfherbst d7be3a6
Reformat basis
mfherbst 482d3b2
Docs concurrency
mfherbst 7070487
Value type instead of real type.
mfherbst cf3fbf8
Minor nits: broadcast norm2, more type inference
GVigne dec0653
Merge branch 'gpu_hpc' of github.com:GVigne/DFTK.jl into gpu_hpc
GVigne ff0d9b0
Update xc.jl
mfherbst File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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,19 @@ | ||
using DFTK | ||
using CUDA | ||
|
||
a = 10.26 # Silicon lattice constant in Bohr | ||
lattice = a / 2 * [[0 1 1.]; | ||
[1 0 1.]; | ||
[1 1 0.]] | ||
Si = ElementPsp(:Si, psp=load_psp("hgh/lda/Si-q4")) | ||
atoms = [Si, Si] | ||
positions = [ones(3)/8, -ones(3)/8] | ||
model = model_DFT(lattice, atoms, positions, []; temperature=1e-3) | ||
|
||
# If available, use CUDA to store DFT quantities and perform main computations | ||
architecture = has_cuda() ? DFTK.GPU(CuArray) : DFTK.CPU() | ||
|
||
basis = PlaneWaveBasis(model; Ecut=30, kgrid=(1, 1, 1), architecture) | ||
scfres = self_consistent_field(basis; tol=1e-3, | ||
solver=scf_damping_solver(), | ||
mixing=KerkerMixing()) |
This file contains hidden or 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
This file contains hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.