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

Suggest a value for frames_per_block if the memory is insufficient #582

Open
wants to merge 10 commits into
base: dev
Choose a base branch
from

Conversation

ptim0626
Copy link
Contributor

@ptim0626 ptim0626 commented Sep 11, 2024

This PR aims to provide a conservative value for the parameter frames_per_block if the block cannot be fitted into the current GPU memory.

It is more helpful for PtyPy to provide a value for frames_per_block as most of the users do not have any idea what a sensible value should be. The ideal way is to provide an option such as frames_per_block='auto' so the user can forget about it but the memory estimation happens after the data is loaded alongside with other stuff and it also depends on the algorithm. As a result it is not possible to achieve this as it is wished here.

When the block is too big, it prints out a message similar to this:

Cannot fit memory into device, if possible reduce frames per block. Exiting...
Your current 'frames_per_block' is 2000.
With current reconstruction parameters and computing resources, you can try setting 'frames_per_block' to 721.
This would divide your reonstruction into 3 blocks.
ptypy has been exited.

This is only relevant for any _Block model.

This also fixes a small bug by removing self.context in the CuPy's EPIE engine.

@ptim0626 ptim0626 self-assigned this Sep 11, 2024
@ptim0626 ptim0626 marked this pull request as ready for review November 22, 2024 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant