StarNet -- An Inference method for Population III star formation and feedback#377
Draft
WillHicks96 wants to merge 41 commits intoenzo-project:mainfrom
Draft
StarNet -- An Inference method for Population III star formation and feedback#377WillHicks96 wants to merge 41 commits intoenzo-project:mainfrom
WillHicks96 wants to merge 41 commits intoenzo-project:mainfrom
Conversation
Not working fully -- get NaNs and segfaults
…e in StarFind and FBNet, along with txt files containing distribution functions relevent to FBNet that were generated using the PHX simulations
…lso introduced EnzoObjectFeedbackSphere class to store positions, radii, metal_yields, etc. for SN remnants
…e feedbackspheres are only sent to blocks that contribute to the level array
… to EnzoSimulation object
…blocks aren't calling compute_done()
Multiplying radius by factor of 0.2 to correct for overestimations from PHX Tweaked metallicity scaling
Not seeding RNG before every call to rand() anymore so that it doesn't just return the same number over and over again Added another filtering criterion that checks the mean overdensity of the block, rather than cell-wise overdensity
…der, regardless of the order of Group:inference:field_list
…es to EnzoObjectFeedbackSphere and remnant particles. Fixed stellar mass sum
Contributor
|
I'm definitely happy to help with CMake.
The key point is that libtorch installations come with a cmake "config-file". We should be able to use that (rather than creating a |
Contributor
|
@WillHicks96 would you mind bringing this branch up-to-date with the main branch of Enzo-E? There are a bunch of conflicts that have to be resolved. Thank you! |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This WIP PR builds off of PR #274, and adds the ability to call pre-trained StarNet models using the C++ frontend of PyTorch (https://pytorch.org/cppdocs/frontend.html) to predict the locations of Pop III stars within an evolving cosmological simulation, as well as the cumulative feedback effects once all stars within a given Pop III association die.
There are a number of changes:
Torchlibrary at compile time by specifying-DUSE_TORCH=ONand-DTorch_ROOT=${TORCH_DIR}CMAKE parameters.EnzoMethodInferenceunder the comment that reads "ADD DEEP LEARNING INFERENCE HERE". The added code here deserializes pre-trained StarNet checkpoints, accesses the relevant fields for making predictions, rescales the fields, packages them into atorch::Tensorobject, forwards thetorch::Tensorobject to the pre-trained models, interprets the results to identify cells within an inference block that are flagged for star formation, computes population statistics, and finally predicts the size of the conglomerate supernova remnant and metal yields. A tracer particle of typepopIIIremnantis added onto the mesh at the center of mass of each predicted star-forming region, which contains information about the population statistics, yields, etc. The thought here is that these particles can be analyzed in post to connect Pop III metals with their progenitor stellar populations.EnzoMethodInferencetoo much to the point that it can't be used for other inference models in the future, I have added theEnzoMethodFBNetDepositmethod to handle the actual deposition Pop III metals and updates to various fields associated with the feedback. Metals are deposited into separate fields based on supernova type (Type II SNe, HNe, or PISNe).EnzoStarNetUtilsandEnzoObjectFeedbackSphereclasses to help out with the calculations and data manipulation mentioned above.StarNet was originally developed and trained in classic Enzo using its inline python capabilities (for more info, see Wells & Norman (2021), Wells & Norman (2022a), and Wells & Norman (2022b)).
PR Checklist
This is a WIP PR is contingent on:
Here's is an image from a 512^3 simulation I ran that shows StarNet in action (publication in progress!):
This is at z=11. Pop III feedback is the only source of metal enrichment in this simulation, so the metal bubbles are all coming from StarNet. The box length is 5 Mpc. The zoomed-in images show density and metallicity slices of the two most massive halos (Mvir = 1e9 Msun roughly).