Skip to content

Cleanout v1p0 flatparams diffstarpop flatparams - #96

Merged
aphearin merged 30 commits into
mainfrom
cleanout_v1p0_flatparams_diffstarpop_flatparams
Oct 1, 2025
Merged

Cleanout v1p0 flatparams diffstarpop flatparams#96
aphearin merged 30 commits into
mainfrom
cleanout_v1p0_flatparams_diffstarpop_flatparams

Conversation

@aphearin

@aphearin aphearin commented Sep 30, 2025

Copy link
Copy Markdown
Contributor

This PR updates the repo for the v1.0.0 release of diffstar. Changes summarized below:

  1. The physical formulation of diffstar has changed from the model introduced in Alarcon+22. There is no longer a convolution kernel between the gas mass accretion and the gas consumption timescale, and dMstar/dt is no longer proportional to dMhalo/dt, but is instead proportional to Mhalo(t) via a newly formulated star formation efficiency function. The new formulation improves the flexibility of the model, and dramatically improves performance (see figure below). Further information about the new model formulation will be summarized in a forthcoming paper, Alarcon+25, in prep.
  2. The parameters of diffstar are now encoded as a flat namedtuple with 8 entries. This is distinct from the original formulation of the parameters, which were encoded as a nested namedtuple, diffstar_params.ms_params and diffstar_params.q_params, each of which had 4 parameters.
  3. There is a new sub-package, diffstarpop, which brings in a population-level model of SFHs. The diffstarpop model was previously developed in a separate repo, ArgonneCPAC/diffstarpop, which is now deprecated. The parameters of diffstarpop are now formulated as a flat namedtuple.

The figure below shows results from a simple timing test I ran on a single CPU on my laptop. The upshot is that there is a 10x memory footprint reduction, and additionally, 10x per-galaxy speedup.

diffstar_v1 0_performance_comparison

aphearin and others added 30 commits September 26, 2025 10:38
Almost all tests pass, except for 4 that are all due to the fact that namedtuple_utils_mgash.py has not yet been updated.
I have a (strong) hunch that we can entirely delete the whole pytree registration altogether.
I tried to do something more passive than that, and just modify the code so that the flattening is trivial.
But I failed to do that on my first try, and it wasn't clear how to resolve.

@alexalar I am not so sure how to fix this because I have never used the pytree registry.
You may be able to resolve these last lingering failures (much) more quickly than me. Could you take a look? If not, I can try to resolve.
…an older version wrt to diffstarpop/loss_kernels/mstar_ssfr_loss_mgash_anyz.py
@aphearin

aphearin commented Oct 1, 2025

Copy link
Copy Markdown
Contributor Author

Proceeding to merge this into main now that there is a working branch of diffsky that is compatible with this new code.

@aphearin
aphearin merged commit b632785 into main Oct 1, 2025
6 of 7 checks passed
@aphearin
aphearin deleted the cleanout_v1p0_flatparams_diffstarpop_flatparams branch October 1, 2025 16:57
@aphearin aphearin mentioned this pull request Oct 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants