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

iQMC Batch Method #223

Merged
merged 25 commits into from
Aug 22, 2024
Merged

iQMC Batch Method #223

merged 25 commits into from
Aug 22, 2024

Conversation

spasmann
Copy link
Collaborator

@spasmann spasmann commented Aug 9, 2024

Description

The primary goals of this PR are to i) implement a randomized-QMC batching method for eigenvalue calculations ii) continue to increase the readability and maintainability of iQMC. Users can now specify an iQMC run mode with mode='fixed' or mode='batched' in the iQMC input settings, which toggles between the fixed seed and randomized-QMC batch methods. Additionally, the user can specify the sample_method and choose between either 'halton' or 'random'. Both sample methods can be used in either fixed seed or batched mode. halton refers to the halton sequence (standard and randomized) random refers to typical prng samples, which are currently generated with numpy.

The randomized-QMC batching method uses the randomized halton sequence to accumulate batch statistics in much the same way as batched Monte Carlo eigenvalue calculations. In fixed seed mode the change in the source strength every iteration comes only from convergence towards the solution. Whereas in batched mode the change in source strength is due to convergence towards the solution and some stochastic noise introduced from randomizing the samples. As a result, iQMC tallies now have a mean, sdev, and bin components like standard Monte Carlo tallies.

Additional Changes:

  • Removed nested power iteration capabilities, the flattened power iteration is now the only iQMC eigenmode solver.
  • Reorganization of iqmc_kernel.py and iqmc_loop.py, grouping functions by operation.
  • Renaming of a several variables which had shorthand names to longer and more detailed names to increase readability.
  • Addition of a iqmc_validate_inputs() function to validate the iQMC input settings.
  • allreduce_array() function added to kernel.py
  • Moved make_type_score() to be a global function in type_.py to be accesses by both Monte Carlo and iQMC scores.
  • Updated iQMC regression test and examples input decks to reflect the new changes.

Planned Work

  • Add batch method regression tests.
  • Remove "iqmc_" prefix from iqmc_kernel.py functions.
  • Replace numpy prng sampling, used when sample_method='random', with MCDC's rng functionality.

@spasmann spasmann added the enhancement New feature or request label Aug 9, 2024
@spasmann spasmann marked this pull request as draft August 9, 2024 17:45
Copy link
Collaborator

@jpmorgan98 jpmorgan98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't speak to the methods themselves, but I think these changes make the code substantially more readable and will eventually look great in the rendered scheme. On the front of documentation there is a page in the theory guide for iqmc that is currently empty. Eventually adding to that would also go a long way in documenting what you've got here (not urgent tho)

@ilhamv
Copy link
Collaborator

ilhamv commented Aug 13, 2024

In fixed source mode the change in the source strength every iteration comes only from convergence towards the solution. Whereas in batched mode the change in source strength is due to convergence towards the solution and some stochastic noise introduced from randomizing the samples. As a result, iQMC tallies now have a mean, sdev, and bin components like standard Monte Carlo tallies.

Do you mean "fixed seed mode", @spasmann?

@ilhamv ilhamv self-requested a review August 13, 2024 14:07
@spasmann
Copy link
Collaborator Author

Thank you @jpmorgan98 ! I've added the theory guide to my todo list.

Yes, fixed seed not fixed source. Thanks, @ilhamv.

@spasmann
Copy link
Collaborator Author

All tests passing! @ilhamv

@ilhamv ilhamv marked this pull request as ready for review August 22, 2024 04:04
@ilhamv ilhamv merged commit 9754cbe into CEMeNT-PSAAP:dev Aug 22, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants