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

performance improvements #4089

Merged
merged 12 commits into from
Mar 30, 2023
Merged

performance improvements #4089

merged 12 commits into from
Mar 30, 2023

Conversation

shaivimalik
Copy link
Contributor

@shaivimalik shaivimalik commented Mar 23, 2023

Fixes #2063

Changes made in this Pull Request:

  • improves performance as discussed in Numpy Performance Improvements #2063

PR Checklist

  • Tests?
  • Docs?
  • CHANGELOG updated?
  • Issue raised/referenced?

📚 Documentation preview 📚: https://readthedocs-preview--4089.org.readthedocs.build/en/4089/

@codecov
Copy link

codecov bot commented Mar 23, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.01 ⚠️

Comparison is base (628e0f7) 93.59% compared to head (174a3cc) 93.59%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4089      +/-   ##
===========================================
- Coverage    93.59%   93.59%   -0.01%     
===========================================
  Files          192      192              
  Lines        25135    25133       -2     
  Branches      4056     4056              
===========================================
- Hits         23525    23523       -2     
  Misses        1092     1092              
  Partials       518      518              
Impacted Files Coverage Δ
package/MDAnalysis/analysis/bat.py 94.57% <100.00%> (ø)
package/MDAnalysis/core/groups.py 97.51% <100.00%> (ø)
package/MDAnalysis/core/topologyattrs.py 96.12% <100.00%> (ø)
package/MDAnalysis/lib/transformations.py 78.49% <100.00%> (-0.07%) ⬇️

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 in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@shaivimalik
Copy link
Contributor Author

@richardjgowers @orbeckst Hello! Can anybody review my PR?

Copy link
Member

@hmacdope hmacdope left a comment

Choose a reason for hiding this comment

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

Seems reasonable! Would you be able to see if this makes a change to the benchmarks?

See: https://github.com/MDAnalysis/mdanalysis/blob/develop/benchmarks/README.rst

@shaivimalik
Copy link
Contributor Author

shaivimalik commented Mar 26, 2023

@hmacdope Yes. I will get back to you with the result.

@shaivimalik
Copy link
Contributor Author

@hmacdope I ran the benchmarks 3 times and got the following results:
Screenshot 2023-03-27 at 12 27 06 AM
Screenshot 2023-03-26 at 10 32 19 PM
Screenshot 2023-03-27 at 5 28 30 AM

@shaivimalik shaivimalik requested a review from hmacdope March 27, 2023 10:57
@shaivimalik
Copy link
Contributor Author

shaivimalik commented Mar 27, 2023

Hi, @hmacdope I made changes to more files where using np.einsum in place of np.sum seemed logical on a different branch and got the following benchmark results:
Screenshot 2023-03-27 at 10 57 50 PM
Screenshot 2023-03-28 at 12 37 24 AM
If these results are up to the mark, I will make these changes to the current PR branch.

@hmacdope
Copy link
Member

The decrease in performance in some cases is unexpected. Did you have stuff running in the background at the same time @g2707 ?

@shaivimalik
Copy link
Contributor Author

@hmacdope No, I did not start any new applications during the benchmark.

@hmacdope
Copy link
Member

@g2707 I can try on my computer tonight

@shaivimalik
Copy link
Contributor Author

shaivimalik commented Mar 27, 2023

@hmacdope Should I add the new file changes before tonight?

@hmacdope
Copy link
Member

Yep!

@github-actions
Copy link

github-actions bot commented Mar 27, 2023

Linter Bot Results:

Hi @g2707! Thanks for making this PR. We linted your code and found the following:

Some issues were found with the formatting of your code.

Code Location Outcome
main package ⚠️ Possible failure
testsuite ✅ Passed

Please have a look at the darker-main-code and darker-test-code steps here for more details: https://github.com/MDAnalysis/mdanalysis/actions/runs/4561242103/jobs/8047069296


Please note: The black linter is purely informational, you can safely ignore these outcomes if there are no flake8 failures!

@shaivimalik
Copy link
Contributor Author

Hi! @hmacdope Did you get a chance to run the benchmarks?

@hmacdope
Copy link
Member

@g2707 yes I did thanks! Performance improvements look good! 2x runs shown below!

Screenshot from 2023-03-30 10-37-09
Screenshot from 2023-03-30 11-41-02

Copy link
Member

@hmacdope hmacdope left a comment

Choose a reason for hiding this comment

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

You will need a CHANGELOG entry (newest first), to add yourself to AUTHORS and as I think you are a new contributor we ask you to introduce yourself on the developer mailing list. ! Other than that looks good and all tests pass, just a few nitpicks.

package/MDAnalysis/core/topologyattrs.py Outdated Show resolved Hide resolved
package/MDAnalysis/lib/transformations.py Outdated Show resolved Hide resolved
package/MDAnalysis/analysis/bat.py Outdated Show resolved Hide resolved
@shaivimalik shaivimalik requested a review from hmacdope March 30, 2023 02:34
package/AUTHORS Outdated Show resolved Hide resolved
@shaivimalik shaivimalik requested a review from hmacdope March 30, 2023 03:25
Copy link
Member

@hmacdope hmacdope left a comment

Choose a reason for hiding this comment

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

Looks good to me! Introduce yourself on the developer mailing list and then I can merge. :)

https://groups.google.com/g/mdnalysis-devel

@shaivimalik
Copy link
Contributor Author

@hmacdope Done!

@hmacdope hmacdope merged commit bdb1352 into MDAnalysis:develop Mar 30, 2023
@shaivimalik shaivimalik deleted the improv branch March 31, 2023 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Numpy Performance Improvements
3 participants