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

Working example of CUDA-fied settler_cover() #747

Merged
merged 5 commits into from
May 2, 2024

Conversation

ConnectedSystems
Copy link
Collaborator

@ConnectedSystems ConnectedSystems commented May 2, 2024

See changes.

I've changed the benchmark approach to simulate 75 time steps to better reflect use case (and align with the mock example shown previously).

Timings:

image

~10.9x faster compared to CPU but orders of magnitude slower than the mock example in #739.

Note the number of allocations explode when using the GPU approach. There's some memory allocations that could be avoided by either making a GPU-specific recruitment_rate() or pre-allocating arrays as necessary.

Note: In the code I comment that "recruitment_rate() takes < 1ms" but I'm not sure about that any more. Suspect there are additional memory allocations occurring.

Incidentally, in recruitment_rate() this line (growth.jl:658):

sd = replace(settler_density.(α, β, larval_pool), Inf => 0.0, NaN => 0.0) .* A

I suspect the use of replace() is no longer necessary as we should always be passing in values for locations that are > 0.0

PS: Please follow style guide - space indentation instead of tab indentation for one.

@ConnectedSystems ConnectedSystems requested a review from arlowhite May 2, 2024 13:36
@arlowhite arlowhite merged commit 505728c into cuda_settler_cover May 2, 2024
@ConnectedSystems ConnectedSystems deleted the cuda-working-example branch May 2, 2024 23:34
@ConnectedSystems
Copy link
Collaborator Author

@arlowhite we have our dedicated remote desktop with a GPU. You just didn't have access to it because someone else was using it at the time.

@arlowhite arlowhite mentioned this pull request Aug 14, 2024
4 tasks
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