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

Caching image_response.contents in data interface for deconvolution #255

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

augustus-thomas
Copy link

Description of Change

The data interface class for DC2 (DataIF_COSI_DC2 inheriting from ImageDeconvolutionDataInterfaceBase) now has attribute image_response_contents initialized to image_response.contents. In this way we no longer retrieve image_response.contents every iteration in the following deconvolution methods:

  • calc_T_product (MStep)
  • calc_expectation (post_processing)

Significance

These changes result in a 10x speedup in image_deconvolution. Instead of retrieving image_response.contents before every tensordot, we now only retrieve it once during initialization.

Profiling "no save" (before this change) versus "save" (after this change)

ImageResponseSavingProfiling

Other Considerations

This could also be solved by setting track_overflow=False on the image_response matrix using histpy==1.1.4

Change does not increase RAM usage. We had previously already allocated memory to the contents during deconvolution.

Copy link

codecov bot commented Oct 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.32%. Comparing base (d02846a) to head (bf79422).
Report is 36 commits behind head on develop.

Files with missing lines Coverage Δ
cosipy/image_deconvolution/dataIF_COSI_DC2.py 90.90% <100.00%> (+0.06%) ⬆️

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.

1 participant