-
Notifications
You must be signed in to change notification settings - Fork 42
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
Performance Optimizations for Tape Operations #154
Conversation
. use emplace_back for efficient checkpoint and statement insertion . implement move semantics for adjoint reset operations
- it should use const refernce to avoid copies but apparently it cant be build on other compilers
perf: optimize' callback insertion and adjoint reset operations
Pull Request Test Coverage Report for Build 12105754388Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also please update the description of the pull request please? Thanks.
done |
Hi @rghouzra , Thank you for this PR and for your effort in contributing to the project - it's great to see your interest in improving the codebase! After reviewing the changes, I noticed:
Given these points, I don’t think merging this particular PR would benefit the repository right now. However, we truly appreciate your enthusiasm, and there are several open issues in the repo where your skills and ideas could make a significant impact. I’d love for you to take a look and see if anything catches your interest: https://github.com/auto-differentiation/xad/issues. Thanks again for your contribution, and I hope to see more of your work in the future! Let me know if you have any questions or would like guidance on specific issues. |
Hi @auto-differentiation-dev |
Title
Optimize memory usage in Tape operations
Description
While profiling our tape operations, I noticed some opportunities to reduce memory allocations and copying. This PR makes targeted optimizations to callback handling and adjoint resets without changing the core behavior.
What Changed
insertCallback()
to useemplace_back()
to construct elements in-placegetAndResetOutputAdjoint()
to use move semantics for derivative transfersWhy
The previous implementation was doing unnecessary memory allocations during callback insertions and making copies of derivative values where moves would suffice. These changes should help reduce memory