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

More AMVF performance upgrades #277

Merged

Conversation

baschlag
Copy link
Contributor

This PR removes the estimateDeltaZ function (which contributed 5.5% to the overall AMVF timing, see below) and replaces it with a simple z position diff check which is way less expensive and gives the same outputs.

Screenshot 2020-06-23 at 14 20 35

@baschlag baschlag added Component - Core Affects the Core module Improvement Changes to an existing feature and removed Triage labels Jun 23, 2020
@baschlag
Copy link
Contributor Author

Somebody wants to review this small PR, @asalzburger, @robertlangenberg ?

@baschlag baschlag added this to the v0.27.00 milestone Jun 23, 2020
@robertlangenberg
Copy link
Contributor

Did you do a proper test with >100 vertices to see if the reduction in physics performance is negligible?

@baschlag
Copy link
Contributor Author

baschlag commented Jun 23, 2020

Did you do a proper test with >100 vertices to see if the reduction in physics performance is negligible?

Yes, I checked on 300 events (i.e. 10536 vertices). The average time for running the AMVF decreased from 124ms to 120ms and the resulting vertex x,y,z positions, covariance matrices and number of tracks match 100%.
Also, the estimateDeltaZ method and the new calculation seem to give matching numbers for the z difference. And yes, I'm sure that I'm comparing the right things 😃 doing one more cross-check now... hang on

@codecov
Copy link

codecov bot commented Jun 23, 2020

Codecov Report

Merging #277 into master will increase coverage by 3.54%.
The diff coverage is 52.46%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #277      +/-   ##
==========================================
+ Coverage   44.84%   48.38%   +3.54%     
==========================================
  Files         376      318      -58     
  Lines       18866    16357    -2509     
  Branches     8970     7580    -1390     
==========================================
- Hits         8461     7915     -546     
+ Misses       4905     3180    -1725     
+ Partials     5500     5262     -238     
Impacted Files Coverage Δ
...e/include/Acts/EventData/SingleTrackParameters.hpp 75.00% <ø> (+2.14%) ⬆️
...Acts/EventData/detail/initialize_parameter_set.hpp 81.81% <ø> (ø)
...include/Acts/TrackFinder/CKFSourceLinkSelector.hpp 46.37% <ø> (-1.45%) ⬇️
Core/include/Acts/Utilities/Helpers.hpp 58.90% <ø> (ø)
...clude/Acts/Vertexing/AdaptiveMultiVertexFinder.hpp 78.57% <ø> (ø)
...nclude/Acts/Vertexing/TrackDensityVertexFinder.hpp 75.00% <ø> (ø)
Core/src/Geometry/CutoutCylinderVolumeBounds.cpp 40.29% <0.00%> (ø)
Core/src/Material/SurfaceMaterialMapper.cpp 10.20% <0.00%> (ø)
Core/src/Material/VolumeMaterialMapper.cpp 11.69% <0.00%> (ø)
...lude/Acts/Visualization/EventDataVisualization.hpp 40.00% <30.00%> (-2.47%) ⬇️
... and 78 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4acad15...54d4d12. Read the comment docs.

@baschlag
Copy link
Contributor Author

Did you do a proper test with >100 vertices to see if the reduction in physics performance is negligible?

Just to clarify: The part

1. / std::tan(th) * (X * std::cos(phi) + Y * std::sin(phi))

is basically always 0 (order 1e-17 or smaller) and therefore negligible. That's why I'm seeing the same physics results with less CPU time.

Copy link
Contributor

@robertlangenberg robertlangenberg left a comment

Choose a reason for hiding this comment

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

As discussed, removed part never exceeds 10e-16 in test with 10000 vertices, shouldn't influence end result.

@robertlangenberg robertlangenberg merged commit 3b91d59 into acts-project:master Jun 23, 2020
paulgessinger pushed a commit to paulgessinger/acts that referenced this pull request Jul 13, 2020
* replace estimateDeltaZ method in AMVF by simple z0 diff check

* replace z0 diff check by z position diff check in AMVF

* fix format
@baschlag baschlag deleted the more_amvf_performance_upgrades branch May 19, 2021 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component - Core Affects the Core module Improvement Changes to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants