Skip to content

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.

2 participants