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

Structure creation on GPU #175

Merged
merged 20 commits into from
Sep 18, 2023
Merged

Structure creation on GPU #175

merged 20 commits into from
Sep 18, 2023

Conversation

TomTomRixRix
Copy link
Collaborator

Solves issue #166

The structures are now created using PyTorch instead of NumPy. Therefore, the input values were converted into torch tensors with float32 precision. NB: NumPys default precision was float64.
For compatibility reasons each structure generator still returns a Numpy array.

Depending on the user settings and hardware availability processing is done on GPU or CPU, as described in #169

@TomTomRixRix TomTomRixRix changed the base branch from main to develop September 26, 2022 14:36
Copy link
Collaborator

@kdreher kdreher left a comment

Choose a reason for hiding this comment

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

Currently, after the adapter is done with the volume creation, the space on the GPU that was needed for all the tensors is not freed again. The memory is still allocated until the whole script is ended. Only then, is it freed up again.

@TomTomRixRix
Copy link
Collaborator Author

I'm not calling torch.cuda.empty_cache() at the end of volume creation. Furthermore, no tensors are saved in structure params anymore as this caused blocking of some GPU memory because they were still referenced in structure objects.

I've also fixed a bug in the vessel structure caused by random variable drawing. This only occurred in random occasions that's probably why it wasn't detected before.

@TomTomRixRix TomTomRixRix self-assigned this Mar 29, 2023
Copy link
Collaborator

@kdreher kdreher 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 to me

@kdreher kdreher merged commit 4ebc093 into develop Sep 18, 2023
12 checks passed
@kdreher
Copy link
Collaborator

kdreher commented Sep 20, 2023

closes #166

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.

2 participants