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

Optimize memory usage of pycbc_fit_sngls_split_binned #4543

Merged
merged 5 commits into from
Nov 1, 2023

Conversation

spxiwh
Copy link
Contributor

@spxiwh spxiwh commented Oct 25, 2023

pycbc_fit_sngls_split_binned can be a real issue with memory usage. A recent example at production scale reported 200GB of RAM usage. If we decide that we can ignore triggers with single ranking less than (say) 5.5 this can be greatly reduced .... and if you want all the triggers, you can still use the 200GB!

This optimizes the memory usage based on how many triggers are needed. This is now based on stat-threshold and the new option plot-lower-stat-limit. If we could solve #4524 it would simplify the implementation here. I've tested this on a large example and the output plots are indistinguishable to me ... They wouldn't be if I'd messed up the new "idx_map" thing.

@spxiwh spxiwh added the v23_release_branch PRs applied to the v2.3.X release branch or to be cherry-picked if merging to master label Oct 25, 2023
Copy link
Contributor

@GarethCabournDavies GarethCabournDavies left a comment

Choose a reason for hiding this comment

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

This all looks sensible to me, a couple of minor comments

Index juggling is always a bit of a headache, but I've tried to follow it through and it looks right. The proof is in the pudding through so if you could add some before / after plots that would be great

bin/all_sky_search/pycbc_fit_sngls_split_binned Outdated Show resolved Hide resolved
mask_start_idx = np.zeros_like(boundaries)
mask_end_idx = np.zeros_like(boundaries)
for idx_start in sorted_boundary_list:
boundary_idx = np.argmax(boundaries == idx_start)
Copy link
Contributor

Choose a reason for hiding this comment

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

Would you be able to do an argsort on boundaries above, and then translate between the two orders more easily?

@tdent
Copy link
Contributor

tdent commented Oct 31, 2023

@spxiwh have you pushed the actual changes to the PR branch?

@spxiwh
Copy link
Contributor Author

spxiwh commented Oct 31, 2023

No, sorry, had a bunch of students show up in the middle of responding. I also noticed that the tests failed, so am following up on that ... will post when branch is updated.

@spxiwh
Copy link
Contributor Author

spxiwh commented Oct 31, 2023

I've pushed the comment changes. I understand the test failure (it will fail again), but need to check with @GarethCabournDavies what to do here.

@spxiwh
Copy link
Contributor Author

spxiwh commented Oct 31, 2023

From my perspective this should be good now (if tests pass). The example doesn't actually test this code at present ... I'll leave turning that on to a different PR.

Copy link
Contributor

@tdent tdent left a comment

Choose a reason for hiding this comment

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

Approve, assuming it works, modulo an optional comment-shortening and the question about not using zeros_like

@spxiwh
Copy link
Contributor Author

spxiwh commented Oct 31, 2023

Comment merged and question replied to! Thanks.

@spxiwh spxiwh merged commit 7fb6d91 into gwastro:master Nov 1, 2023
31 checks passed
@spxiwh spxiwh deleted the pr_optimize_sngls_split_binned branch November 1, 2023 09:17
spxiwh added a commit to spxiwh/pycbc that referenced this pull request Nov 2, 2023
* Optimize memory usage of pycbc_fit_sngls_split_binned

* Need add option here

* Comments on PR

* Example doesn't use code being edited!

* Update bin/all_sky_search/pycbc_fit_sngls_split_binned

Co-authored-by: Thomas Dent <[email protected]>

---------

Co-authored-by: Thomas Dent <[email protected]>
spxiwh added a commit that referenced this pull request Nov 3, 2023
* Read DQ flags with finer time resolution (#4547)

* Read DQ flags with finer time resolution

* No default sample rate for dq flags

* No default sample rate for dq

* Add type for frequency command line option

* Optimize memory usage of pycbc_fit_sngls_split_binned (#4543)

* Optimize memory usage of pycbc_fit_sngls_split_binned

* Need add option here

* Comments on PR

* Example doesn't use code being edited!

* Update bin/all_sky_search/pycbc_fit_sngls_split_binned

Co-authored-by: Thomas Dent <[email protected]>

---------

Co-authored-by: Thomas Dent <[email protected]>

* Non-coinc ifos in minifollowup trig plots (#4548)

* Update get.sh (#4532)

---------

Co-authored-by: maxtrevor <[email protected]>
Co-authored-by: Thomas Dent <[email protected]>
Co-authored-by: Shichao Wu <[email protected]>
PRAVEEN-mnl pushed a commit to PRAVEEN-mnl/pycbc that referenced this pull request Nov 3, 2023
* Optimize memory usage of pycbc_fit_sngls_split_binned

* Need add option here

* Comments on PR

* Example doesn't use code being edited!

* Update bin/all_sky_search/pycbc_fit_sngls_split_binned

Co-authored-by: Thomas Dent <[email protected]>

---------

Co-authored-by: Thomas Dent <[email protected]>
@spxiwh spxiwh removed the v23_release_branch PRs applied to the v2.3.X release branch or to be cherry-picked if merging to master label Nov 15, 2023
maxtrevor pushed a commit to maxtrevor/pycbc that referenced this pull request Dec 11, 2023
* Optimize memory usage of pycbc_fit_sngls_split_binned

* Need add option here

* Comments on PR

* Example doesn't use code being edited!

* Update bin/all_sky_search/pycbc_fit_sngls_split_binned

Co-authored-by: Thomas Dent <[email protected]>

---------

Co-authored-by: Thomas Dent <[email protected]>
bhooshan-gadre pushed a commit to bhooshan-gadre/pycbc that referenced this pull request Dec 19, 2023
* Optimize memory usage of pycbc_fit_sngls_split_binned

* Need add option here

* Comments on PR

* Example doesn't use code being edited!

* Update bin/all_sky_search/pycbc_fit_sngls_split_binned

Co-authored-by: Thomas Dent <[email protected]>

---------

Co-authored-by: Thomas Dent <[email protected]>
bhooshan-gadre pushed a commit to bhooshan-gadre/pycbc that referenced this pull request Mar 4, 2024
* Optimize memory usage of pycbc_fit_sngls_split_binned

* Need add option here

* Comments on PR

* Example doesn't use code being edited!

* Update bin/all_sky_search/pycbc_fit_sngls_split_binned

Co-authored-by: Thomas Dent <[email protected]>

---------

Co-authored-by: Thomas Dent <[email protected]>
lpathak97 pushed a commit to lpathak97/pycbc that referenced this pull request Mar 13, 2024
* Optimize memory usage of pycbc_fit_sngls_split_binned

* Need add option here

* Comments on PR

* Example doesn't use code being edited!

* Update bin/all_sky_search/pycbc_fit_sngls_split_binned

Co-authored-by: Thomas Dent <[email protected]>

---------

Co-authored-by: Thomas Dent <[email protected]>
acorreia61201 pushed a commit to acorreia61201/pycbc that referenced this pull request Apr 4, 2024
* Optimize memory usage of pycbc_fit_sngls_split_binned

* Need add option here

* Comments on PR

* Example doesn't use code being edited!

* Update bin/all_sky_search/pycbc_fit_sngls_split_binned

Co-authored-by: Thomas Dent <[email protected]>

---------

Co-authored-by: Thomas Dent <[email protected]>
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.

3 participants