QMCPACK / QMCPACK/qmcpack

VMC/DMC Force Transition to Batched Code

Open
#5,093 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
403
Forks
154
Avg merge
1d 13h
Merged PRs (30d)
90

Description

This is a very brief summary of what is needed to get VMC forces into the batched code, and what DMC forces beyond Reynolds approximation would look like.

VMC Forces

Main strategy for putting VMC Assaraf-Caffarel forces into the batched code was to:

  1. Create an "ACForce" estimator, derived from OperatorEstBase object, with helper classes for input.
  2. On the crowd objects, iterate through and call the single-walker API's to accumulate forces. ACForce would be responsible for calling QMCHamiltonian force routines and space warp related routines.
  3. Superficially, performance and output would be nearly identical to existing legacy code.

Main hurdles uncovered:

  1. Ion particle sets are passed in as arguments to all force related routines. This either requires some cloning of ion particle over crowds to get it to work correctly with batched implementation, or eliminating them as arguments. I pursued the latter strategy, since short of finite-differences (see rcclay/clean_force_apis and rcclay/batched_deriv_eval, there is actually virtually no interaction with the ion particle set. However, to maintain full functionality (i.e. single determinant + 1,2,3 body jastrows, space warp), the following dependencies needed to be resolved. Resolution of these dependencies also hits the major performance bottlenecks in the current code.
  • Implement analytic ion derivatives of three-body Jastrow factor. (Performance and Batched Transition)

    1. Need $\frac{d}{dR} J$, as well as $\frac{d}{dR} \nabla J$ and $\frac{d}{dR}\nabla^2 J$.
    2. Currently calculated with finite differences, but this is slow.
    3. Support for finite difference really complicates the transition to the batched code.
  • Implement analytic electron gradients of $E_L$ (Performance and Batched Transition)

    1. Need $\nabla_i \nabla^2 \ln \Psi$, $\nabla_i v(r)$, and non local pseudopotential.
    2. Currently calculated with finite differences, but this is slow.
    3. Support for finite difference really complicates the transition to the batched code.
  1. An alternate strategy is to confer with Ye to pursue the ion particle set cloning strategy, which would allow us to be able to do finite differences.

Performance Bottlenecks:

  • Finite difference J3 evaluation.
  • Finite difference space warp.
  • Current LCAO MO evaluation is $O(N)$. This NEEDS to be brought down to $O(1)$ for forces to scale like $O(N^3)$, otherwise they scale $O(N^4)$.

DMC Forces

Unchanged from Issue #4603 . To summarize though,

  1. For variational drift-diffusion approximation, walker histories need to be implemented, and derivatives of branching term need to be computed (trivial, already needed for VMC). Need major bullet point 1, and bullet point 3.1.
  2. For the rigorous DMC force estimator, we need major bullet points 1, 3, and 4. Major bullet point 2 is a validation step. Bullet points 3.2 and 3.3 are a major pain.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the existing OperatorEstBase and QMCHamiltonian force paths, then trace how crowd objects invoke the single-walker APIs. Use issue #4603 for the DMC requirements; done means the VMC force path and the specified DMC estimators work in batched code with analytic derivative support and equivalent output.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, hpc
Domain
hpc, performance
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.