Skip to content

Conversation

@BenYang2002
Copy link
Contributor

Supersedes

This PR supersedes #841.

The previous pull request contained too many auto-generated or formatting-related file changes, which made it difficult to review effectively. This PR presents a cleaner version of the same core changes, with unnecessary noise removed, and incorporates the feedback provided in #841.

Related Issues

Closes #131
Closes #821
Closes #825

Description

This PR completes the integration of GPU memory management operations — copyFromGPU and deallocateGPUMemory — into the OperationManager framework, extending the pattern previously established with copyToGPU. All GPU operations are now standardized as std::function<void()> callbacks registered during class construction. This change eliminates hardcoded call chains in GPUModel, centralizes GPU logic dispatch, and improves modularity and maintainability.

Key changes include:

  • Refactored copyFromGPU and deallocateGPUMemory to take no parameters
  • Registered operations using OperationManager::execute(...)
  • Moved operational context into class member variables
  • Added #ifdef USE_GPU guards where appropriate
  • Preserved consistency with the previously refactored copyToGPU logic

@BenYang2002 BenYang2002 self-assigned this Jun 4, 2025
@stiber stiber self-requested a review June 12, 2025 17:22
Copy link
Contributor

@stiber stiber left a comment

Choose a reason for hiding this comment

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

Not sure if this is ready for review, as no request was made. I will point out some things:

  • Make sure that GPU regression tests have been run manually and note that in the conversation.
  • This PR can't be simply merged. Checking the different branches, it appears that it is three commits behind SharedDevelopment. Follow our SWE process and merge SharedDevelopment into this branch, re-test it and ensure it works, then request again that it be reviewed.

@stiber stiber requested a review from NicolasJPosey June 23, 2025 17:54
@NicolasJPosey
Copy link
Contributor

@NicolasJPosey to run GPU regression and report back on pass/fail status.

stiber
stiber previously approved these changes Jun 23, 2025
Copy link
Contributor

@stiber stiber left a comment

Choose a reason for hiding this comment

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

Pending GPU testing and approval by @NicolasJPosey, this looks good to go!

This was moved out of GPU model and into AllSpikingNeurons_d.cpp a while back.
@NicolasJPosey
Copy link
Contributor

@stiber I am not sure how it got through, but a device side function that was previously in GPUModel.cpp was causing a compile error. This was moved into the AllSpikingNeurons_d.cpp a while back so I just removed it from GPUModel. The medium connected dataset passed regression testing and the large long dataset ran to completion without any errors so I will approve the PR. Since I committed a new change, you may have to re-approve.

Copy link
Contributor

@NicolasJPosey NicolasJPosey left a comment

Choose a reason for hiding this comment

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

GPU regression test-medium-connected and test-large-long both pass.

@stiber stiber self-requested a review June 30, 2025 16:39
@stiber stiber merged commit 945ccda into SharedDevelopment Jun 30, 2025
2 checks passed
@stiber stiber deleted the BenMerge branch June 30, 2025 16:40
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.

4 participants