acts icon indicating copy to clipboard operation
acts copied to clipboard

refactor!: Switch SourceLink to container

Open paulgessinger opened this issue 3 years ago • 1 comments

This PR changes the SourceLink back from a base class to a concrete type without inheritance. It now contains a type erased upstream sourcelink (right now implement by std::any, but we can change this to use something with small buffer optimization).

Contains #1512 at the moment.

paulgessinger avatar Oct 24 '22 15:10 paulgessinger

@tboldagh what do you think?

paulgessinger avatar Oct 24 '22 15:10 paulgessinger

Codecov Report

Merging #1616 (fe4a168) into main (275ef67) will increase coverage by 0.01%. The diff coverage is 65.11%.

@@            Coverage Diff             @@
##             main    #1616      +/-   ##
==========================================
+ Coverage   49.20%   49.21%   +0.01%     
==========================================
  Files         398      398              
  Lines       21815    21827      +12     
  Branches     9902     9904       +2     
==========================================
+ Hits        10733    10742       +9     
- Misses       4215     4216       +1     
- Partials     6867     6869       +2     
Impacted Files Coverage Δ
...ude/Acts/SpacePointFormation/SpacePointBuilder.hpp 50.00% <ø> (ø)
...de/Acts/TrackFinding/CombinatorialKalmanFilter.hpp 31.72% <0.00%> (-0.26%) :arrow_down:
Core/include/Acts/TrackFitting/KalmanFitter.hpp 45.06% <33.33%> (-0.31%) :arrow_down:
...s/SpacePointFormation/detail/SpacePointBuilder.ipp 47.14% <50.00%> (ø)
Core/include/Acts/EventData/MultiTrajectory.hpp 71.35% <57.14%> (+0.27%) :arrow_up:
...e/include/Acts/EventData/VectorMultiTrajectory.hpp 58.20% <60.00%> (ø)
Core/include/Acts/EventData/Measurement.hpp 80.00% <66.66%> (-6.37%) :arrow_down:
Core/include/Acts/EventData/SourceLink.hpp 75.00% <73.33%> (-25.00%) :arrow_down:
Core/include/Acts/EventData/MultiTrajectory.ipp 57.89% <100.00%> (+0.75%) :arrow_up:
Core/src/EventData/VectorMultiTrajectory.cpp 78.67% <100.00%> (+1.47%) :arrow_up:
... and 3 more

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov[bot] avatar Oct 24 '22 17:10 codecov[bot]

:bar_chart: Physics performance monitoring for fe4a1683cdf1d2ca8bb75cd5f3d3574b27ac901e

Full report Seeding: seeded, truth estimated, orthogonal CKF: seeded, truth smeared, truth estimated, orthogonal IVF: seeded, truth smeared, truth estimated, orthogonal Ambiguity resolution: seeded, orthogonal Truth tracking Truth tracking (GSF)

Vertexing

Vertexing vs. mu
IVF seeded

IVF truth_smeared

IVF truth_estimated

IVF orthogonal

Seeding

Seeding seeded

Seeding truth_estimated

Seeding orthogonal

CKF

CKF seeded

CKF truth_smeared

CKF truth_estimated

CKF orthogonal

Ambiguity resolution

seeded

Truth tracking (Kalman Filter)

Truth tracking

Truth tracking (GSF)

Truth tracking

github-actions[bot] avatar Oct 25 '22 13:10 github-actions[bot]

Ok, the orthogonal seeding test and the ExaTrkX compilation still need fixes here.

paulgessinger avatar Oct 31 '22 15:10 paulgessinger

This still carries a slowdown of about 10%. I'm trying to optimize the type erasure mechanism to be more efficient.

paulgessinger avatar Nov 23 '22 17:11 paulgessinger

I made some performance comparisons here on 20 events, 100 runs in each config. perf_Algorithm_AmbiguityResolutionAlgorithm perf_Algorithm_DigitizationAlgorithm perf_Algorithm_FatrasSimulation perf_Algorithm_IterativeVertexFinder perf_Algorithm_ParticleSelector perf_Algorithm_SeedingAlgorithm perf_Algorithm_SpacePointMaker perf_Algorithm_TrackFindingAlgorithm perf_Algorithm_TrackParamsEstimationAlgorithm perf_Algorithm_TrackSelector perf_Algorithm_TruthSeedSelector perf_Reader_EventGenerator

paulgessinger avatar Nov 24 '22 14:11 paulgessinger

I need to unblock this from the Any developments (#1695). Can we move ahead with this with std::any, and accept that the overhead we incur is slightly larger than we would/will until the Any type with SBO lands?

Opinions? @asalzburger @andiwand @benjaminhuth ?

paulgessinger avatar Nov 25 '22 11:11 paulgessinger

makes sense to me as the performance seems to be mostly lost in the ambi resolution which is not optimal anyway

andiwand avatar Nov 25 '22 11:11 andiwand

Yeah sounds good. And I think Acts::Any will land quite soon, right?

benjaminhuth avatar Nov 25 '22 12:11 benjaminhuth

There are 100 million edge cases so no ETA on Acts::Any yet.

paulgessinger avatar Nov 25 '22 13:11 paulgessinger

Inclusively, a 20 event ODD job goes from about 10.0s to about 11.2s on -O3.

Also in this case the largest part seems to indeed be from the Ambiguity resolution. Space point creation and track selection is also slower, but those are generally not very slow to begin with, so it's a smaller effect.

perf_Algorithm_SpacePointMaker perf_Algorithm_TrackSelector perf_Algorithm_AmbiguityResolutionAlgorithm

Track finding is not strongly affected (likely dominated by math anyway): perf_Algorithm_TrackFindingAlgorithm

paulgessinger avatar Nov 25 '22 16:11 paulgessinger

I think this is ready for review. @benjaminhuth, @andiwand @asalzburger ?

paulgessinger avatar Nov 29 '22 08:11 paulgessinger

@andiwand can you have another quick look and reapprove?

paulgessinger avatar Dec 09 '22 17:12 paulgessinger