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

Removed time consuming performGC call #10

Merged
merged 1 commit into from
Feb 23, 2015
Merged

Removed time consuming performGC call #10

merged 1 commit into from
Feb 23, 2015

Conversation

pmlodawski
Copy link
Contributor

Hi!
Regarding to AccelerateHS/accelerate#227 and my answer here http://stackoverflow.com/a/28084927/1641629 accelerate is working slow under ghci because of performGC call, which from my tests takes more than 130ms. I think we can relay on ghc garbage collector to clean memory on its own and we should not force it to do it on cleanup.

@mchakravarty
Copy link
Member

Good catch — thank you!

IIRC the performGC call is there, because we currently don't have any dedicated GC for GPU arrays, but rely on finalisers attached to CPU arrays to deallocate the associated GPU arrays. So, the performGC tries to ensure that memory is freed as quickly as possible. This strategy to managing GPU memory has, however, proved to be insufficient anyway and @robeverest is currently working on a proper solution to reclaiming GPU memory — see AccelerateHS/accelerate#240.

With @robeverest's improvements, the performGC is definitely a waste of effort.

@robeverest Could you maybe merge this pull request into your code for adding GPU GC?

@robeverest
Copy link
Member

Sorry about the delayed reply on this. I've just added support for a dedicated GC for the GPU that doesn't depend on GHC's GC. I would still consider it experimental at this stage, but it's safe to remove the performGC. This pull request can be merged.

robeverest added a commit that referenced this pull request Feb 23, 2015
Removed time consuming performGC call
@robeverest robeverest merged commit 8bc2976 into AccelerateHS:master Feb 23, 2015
tmcdonell pushed a commit to tmcdonell/accelerate-cuda that referenced this pull request Oct 15, 2015
Removed time consuming performGC call
tmcdonell added a commit to tmcdonell/accelerate-llvm that referenced this pull request Feb 4, 2016
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.

3 participants