MatthewRHermes / mrh

MRH's research code
Other
18 stars 30 forks source link

LASSIS memory management #90

Open MatthewRHermes opened 5 months ago

MatthewRHermes commented 5 months ago

Overall, LASSIS does not have good memory management, because of the ad hoc way it was put together.

In LASSIS, the same fragment basis functions appears at multiple rootspace addresses, and to save memory one can just make a view instead of a copy. However, right at the end of lassis.prepare_states, this line https://github.com/MatthewRHermes/mrh/blob/ab148b28e24f2722f0fc86225f24f84e4ac88c05/my_pyscf/lassi/lassis.py#L328 throws it all away because spaces._spin_shuffle_ci_ was written conservatively to combine multiple possibly non-orthogonal spin-shuffle references, which requires making copies and not references.

MatthewRHermes commented 5 months ago

The dev branch should have much less CI-vector copying now due to _spin_shuffle_ci_, but I'm leaving this up until we have actual memory checks.