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

perf: Optimize Eigen usage in covariance engine #1183

Merged
merged 2 commits into from
Mar 18, 2022

Conversation

stephenswat
Copy link
Member

This commit optimizes some of the Eigen usage in the covariance engine, specifically in the critical path for the propagation examples. The first optimisation we make is to introduce a tiled matrix multiplication method, which takes 2i×2j matrices, and performs four i×j multiplications instead, which Eigen can optimize far more easily. Secondly, we reduce the number of floating point operations performed by working with smaller submatrices wherever possible.

On my machine, the following performance is achieved in the propagation example before this patch: 53.555595 ms/event. After this patch, we take 43.750143 ms/event. This performance gain is independent from the performance gain of #1181.

@stephenswat stephenswat added Component - Core Affects the Core module Impact - Minor Nuissance bug and/or affects only a single module Improvement Changes to an existing feature labels Mar 3, 2022
@stephenswat stephenswat added this to the next milestone Mar 3, 2022
@codecov
Copy link

codecov bot commented Mar 3, 2022

Codecov Report

Merging #1183 (057000a) into main (3b264d7) will not change coverage.
The diff coverage is 0.00%.

@@           Coverage Diff           @@
##             main    #1183   +/-   ##
=======================================
  Coverage   47.81%   47.81%           
=======================================
  Files         360      360           
  Lines       18591    18591           
  Branches     8769     8769           
=======================================
  Hits         8890     8890           
  Misses       3649     3649           
  Partials     6052     6052           
Impacted Files Coverage Δ
Core/src/Propagator/detail/CovarianceEngine.cpp 52.06% <0.00%> (ø)

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@paulgessinger
Copy link
Member

On my end I see wall-time for the generic propagation example go from ~26s to 22s for 500 events. Good stuff!

@stephenswat stephenswat added the 🚧 WIP Work-in-progress label Mar 4, 2022
This commit optimizes some of the Eigen usage in the covariance engine,
specifically in the critical path for the propagation examples. The
first optimisation we make is to introduce a tiled matrix multiplication
method, which takes 2i×2j matrices, and performs four i×j
multiplications instead, which Eigen can optimize far more easily.
Secondly, we reduce the number of floating point operations performed by
working with smaller submatrices wherever possible.

On my machine, the following performance is achieved in the propagation
example before this patch: 53.555595 ms/event. After this patch, we take
43.750143 ms/event. This performance gain is independent from the
performance gain of acts-project#1181.
@stephenswat stephenswat removed the 🚧 WIP Work-in-progress label Mar 15, 2022
@stephenswat
Copy link
Member Author

This is now ready to go in.

@kodiakhq kodiakhq bot merged commit 6969a87 into acts-project:main Mar 18, 2022
@paulgessinger paulgessinger modified the milestones: next, v18.0.0 Apr 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Component - Core Affects the Core module Impact - Minor Nuissance bug and/or affects only a single module Improvement Changes to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants