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

Create batch versions of multiple evaluation functions #199

Merged
merged 5 commits into from
Dec 4, 2024

Conversation

jeremykubica
Copy link
Contributor

Closes #192

Allow a GraphState with multiple samples to be passed to PhysicalModel.evaluate() and PhysicalModel.get_band_fluxes(). In the process update Passband.fluxes_to_bandflux() so that it can also process a batch of samples at once.

Copy link

github-actions bot commented Dec 2, 2024

Before [817d06f] After [c34d845] Ratio Benchmark (Parameter)
711±500μs 1.43±0.8ms ~2.01 benchmarks.TimeSuite.time_fnu_to_flam
4.44±0.4ms 6.32±0.8ms ~1.42 benchmarks.TimeSuite.time_chained_evaluate
8.43±0.4ms 10.3±0.4ms 1.22 benchmarks.TimeSuite.time_evaluate_salt3_model
4.59±0.09ms 4.99±0.08ms 1.09 benchmarks.TimeSuite.time_evaluate_salt3_passbands
1.36±0.06ms 1.46±0.05ms 1.07 benchmarks.TimeSuite.time_apply_passbands
27.1±0.4μs 27.6±0.4μs 1.02 benchmarks.TimeSuite.time_make_new_salt3_model
8.85±0.05ms 8.94±0.1ms 1.01 benchmarks.TimeSuite.time_load_passbands
1.34±0.01s 1.35±0.01s 1.01 benchmarks.TimeSuite.time_make_x1_from_hostmass
122±1μs 124±1μs 1.01 benchmarks.TimeSuite.time_sample_x0_from_distmod
16.1±0.3μs 16.2±0.2μs 1.01 benchmarks.TimeSuite.time_sample_x1_from_hostmass

Click here to view all benchmarks.

Copy link
Member

@OliviaLynn OliviaLynn left a comment

Choose a reason for hiding this comment

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

Looks good!

src/tdastro/astro_utils/passbands.py Outdated Show resolved Hide resolved
src/tdastro/sources/physical_model.py Outdated Show resolved Hide resolved
@jeremykubica jeremykubica merged commit 5ab23f3 into main Dec 4, 2024
5 checks passed
@jeremykubica jeremykubica deleted the batch_evaluate branch December 4, 2024 13:13
@jeremykubica jeremykubica restored the batch_evaluate branch December 4, 2024 13:13
@jeremykubica jeremykubica deleted the batch_evaluate branch December 4, 2024 13:13
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.

Allow batching for evaluate and get_band_fluxes
2 participants