-
Notifications
You must be signed in to change notification settings - Fork 0
Port to nanobind and restructure for performance #71
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
Open
janbridley
wants to merge
207
commits into
main
Choose a base branch
from
nanobind4
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Closed
Collaborator
|
Impressive work!! |
Collaborator
|
Can you revert my change to removing specialized windows testing? It seems we might need that back .... If you can't find it in the sea of commits here, I can do that when I get to reviewing this. It seems that rerun failures wasn't the source of the problems after all. We will have to investigate that issue further at some point, on a Windows machine... |
…e standard testing approach" This reverts commit 0af8be7.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This is a combination rewrite/refactor that aims to (1) replace pybind11 code with nanobind and (2) restructure data types and the code layout to interface better with cymmetry (upcoming library & publication) and new optimizer developments.
The biggest change is a separation of python interfaces from c++ source code -- bindings are consolidated to separate files, and much of the library is now available as headers for use in other tools. The area of the interface is also reduced, with nanobind's ndarray replacing python exports for Vec3 and Quaternion types exported in previous versions. Finally, the data classes (PGOP- and BOOSOPStore) have been removed. These adapters were added in previous versions for performance reasons, but nanobind allows for copy-free array translation that removes this necessity. These changes, combined with a few other optimizations, result in a 400-500% performance increase across the board.
Changed
pgop.py::BOOSOPcode is now in separate fileboosop.py.std::vector<std::vector<...>>are now vectors of pointers, allowing for copy- and move- free access to python data. Matrix elements are accessed withstd::spanand cast to statically-allocated types for performance.py::arrayare now replaced withstd::vectorortype*pointersstd::vector<double>) is nowtypedef RotationMatrix = std::array<double, 9>Removed
Added
m_group_sizesclass method for PGOP, which stores the size of each group (currently, (group order - 1) * 9). Previous code used vector.size, which requires copies and allocations for both individual elements and entire groups.-DENABLE_PROFILINGflag to allow for easy profilingBenchmarking
Before this PR
Compute PGOP for mesh of 600 points, computed for an icosahedron (N=12, N_query=1):
After this PR
Compute PGOP for mesh of 600 points, computed for an icosahedron (N=12, N_query=1):
Motivation and Context
Resolves: #???
How Has This Been Tested?
Checklist: