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

[SYSTEMML-1325] Bugfix for GPU memory manager clear temporary memory #839

Closed
wants to merge 1 commit into from

Conversation

thomas9t
Copy link
Contributor

In GPUMemoryManager.clearTemporaryMemory() we deallocate pointers but do not set the corresponding Pointer slots to null in the associated GPUObject instances. This can lead to attempted double-freeing of Pointers which results in an exception. This PR fixes this issue by creating a list of GPU objects associated with Pointers that have been freed as part of clearTemporaryMemory() and setting the corresponding pointer slots to null. This PR also addresses a minor issue with cleanup in JMLC which was causing Pointers for pinned data to be improperly cleared. Note this PR will reduce performance of GPUMemoryManager.clearTemporaryMemory() because it is now necessary to search through the list of managed GPUObjects to find the ones corresponding to pointers being freed. However, this method is only called once at the end of script invocation and so the performance cost will be small.

@niketanpansare can you please take a look and let me know what you think?

@niketanpansare
Copy link
Contributor

Looks good to me. Thanks @thomas9t 👍

@thomas9t
Copy link
Contributor Author

thomas9t commented Nov 2, 2018

@niketanpansare - anything else we need to do here?

@asfgit asfgit closed this in cc7ec76 Nov 3, 2018
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