-
Notifications
You must be signed in to change notification settings - Fork 677
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
Add distopia! #3914
Add distopia! #3914
Conversation
Codecov ReportBase: 93.52% // Head: 93.53% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## develop #3914 +/- ##
========================================
Coverage 93.52% 93.53%
========================================
Files 190 191 +1
Lines 25037 25062 +25
Branches 3543 3547 +4
========================================
+ Hits 23417 23442 +25
Misses 1099 1099
Partials 521 521
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Do we have ASV benchmarks that could show the before/after? |
I'll run them today. :) |
I was more thinking about having a benchmark for |
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.
I assume this is in the works since it's WIP, but since discussion is happening:
Needs:
- A CI runner (can just use extra conda deps argument to add a py3.10 runner with distopia)
- My view is that we don't need to do a full sweep here, distopia already tests relevant OS/Python versions, so it shouldn't be needed here.
- Docs
See discussion on the distopia issue about whether it should be drop in replacement or selectable backend. |
@richardjgowers, @orbeckst I have run some timings comparing distopia, MDA bindings to distopia and also to MDTraj/freud. First thing to clear up is Richard and I had a discussion about checking the overhead of the TLDR of this whole thing:
Here is a comparison showing the time required to calculate N distances (x axis), fully complying to our API which takes # need explicit branch on backend to prepare input types correctly
# must assign to result to get correct reference on memview
bondlengths = _run("calc_bonds_ortho_float",
args=(coords1, coords2, box[:3]),
kwargs={'results': bondlengths.astype(np.float32)},
backend=backend)
# upcast is currently required
bondlengths = bondlengths.astype(np.float64) we can see that the MDA distopia bindings (purple) are far off its theoretical peak (blue) primarily due to the input and output casting required. What happens if we remove the output cast which is an API break for MDA (guarantees We can see that the performance is a lot better. While we can remove the input cast due to distopia requiring consistent precision, we can subtract its approximate overhead With overhead of casting approximately removed (brown line) we are very close to the distopia-only maximum speed. Hopefully this all makes sense. My main proposal is we remove the guarantee that results are returned as |
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.
LGTM. Looking forward to going single precision in 3.0 for these reasons
Issue raised #3927 |
Co-authored-by: Irfan Alibay <IAlibay@users.noreply.github.com>
Hang on some issues with passing through args and returning the right thing |
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.
Some initial comments.
Btw, we don't have to follow the black
part of darken, it's more of an aid than anything else.
Co-authored-by: Irfan Alibay <IAlibay@users.noreply.github.com>
I think this should be good for re-review |
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.
aside from the one thing that I'm not sure if it got resolved - lgtm! (sorry about the delay here)
Fixes #3783
Following bump of conda-forge feedstock of
distopia
to 0.2.0, including the inplace API we can now integrate distopia into MDAnalysis.Changes made in this Pull Request:
PR Checklist