Skip to content

Commit

Permalink
added option to store AO grid in fp16 to reduce memory
Browse files Browse the repository at this point in the history
  • Loading branch information
mihaipgc committed Nov 8, 2023
1 parent c6f98b9 commit d94c88c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pyscf_ipu/nanoDFT/nanoDFT.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,10 @@ def init_dft_tensors_cpu(mol, opts, DIIS_iters=9):
else:
grid_coords = grids.coords
density_matrix = pyscf.scf.hf.init_guess_by_minao(mol) # (N,N)=(66,66) for C6H6.

if opts.fp16_grid:
# reduce grid_AO memory by half
grid_AO = grid_AO.astype(np.float16)

# TODO(): Add integral math formulas for kinetic/nuclear/O/ERI.
kinetic = mol.intor_symmetric('int1e_kin') # (N,N)
Expand Down Expand Up @@ -619,7 +623,8 @@ def nanoDFT_options(
vis_num_error: bool = False,
molecule_name: str = None,
screen_tol: float = 1e-9,
fast_shells: bool = False
fast_shells: bool = False,
fp16_grid: bool = False
):
"""
nanoDFT
Expand Down

0 comments on commit d94c88c

Please sign in to comment.