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

Speed up pattern recognition in Pixels by implementing a 5 sigma compatibility window in TkPixelMeasurementDet #18408

Merged
merged 6 commits into from May 2, 2017

Conversation

VinInn
Copy link
Contributor

@VinInn VinInn commented Apr 19, 2017

implement a 5 sigma compatibility window in TkPixelMeasurementDet
(once cluster has been sorted in x)

produces a speed up of 10% in pattern recognition (for instance initialStepTrackCandidates)
for PU50

expect negligible regressions

The usual suspects: electron, photon, muon, cosmics are left unchanged
see #14467 #12846 for what can happen in messing with those...

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 19, 2017

A new Pull Request was created by @VinInn (Vincenzo Innocente) for master.

It involves the following packages:

RecoLocalTracker/SiPixelClusterizer
RecoTracker/MeasurementDet

@perrotta, @cmsbuild, @slava77, @davidlange6 can you please review it and eventually sign? Thanks.
@ghellwig, @makortel, @felicepantaleo, @GiacomoSguazzoni, @rovere, @VinInn, @mschrode, @dkotlins, @gpetruc, @ebrondol, @threus, @dgulhan this is something you requested to watch as well.
@Muzaffar, @davidlange6, @smuzaffar you are the release manager for this.

cms-bot commands are listed here

@VinInn
Copy link
Contributor Author

VinInn commented Apr 19, 2017

910_pre2 perf report

   - 6.21% GroupedCkfTrajectoryBuilder::rebuildSeedingRegion                                                                                                                                              ▒
      - 5.05% GroupedCkfTrajectoryBuilder::rebuildSeedingRegion                                                                                                                                           ▒
         - 4.96% GroupedCkfTrajectoryBuilder::groupedLimitedCandidates                                                                                                                                    ▒
            - 4.81% GroupedCkfTrajectoryBuilder::advanceOneLayer                                                                                                                                          ▒
               - 4.17% TrajectorySegmentBuilder::segments                                                                                                                                                 ▒
                  - 3.02% LayerMeasurements::groupedMeasurements                                                                                                                                          ▒
                     + 1.58% TkPixelMeasurementDet::measurements                                                                                                                                          ▒
                     + 0.92% GeometricSearchDet::groupedCompatibleDets                                                                                                                                    ▒
                     + 0.34% TkGluedMeasurementDet::measurements                                                                                                                                          ▒
                  + 1.00% TrajectorySegmentBuilder::addGroup                                                                                                                                              ▒
               + 0.29% BaseCkfTrajectoryBuilder::findStateAndLayers                                                                                                                                       ▒
      + 1.06% GroupedCkfTrajectoryBuilder::backwardFit    

and

   - 3.06% TkPixelMeasurementDet::measurements                                                                                                                                                            ▒
      - 2.64% TkPixelMeasurementDet::recHits                                                                                                                                                              ▒
         - 2.49% TkPixelMeasurementDet::buildRecHit                                                                                                                                                       ▒
            - 2.29% PixelCPEBase::getParameters                                                                                                                                                           ▒
               + 1.58% PixelCPEGeneric::localPosition                                                                                                                                                     ▒
                 0.15% _ZNK12PixelCPEBase27computeAnglesFromTrajectoryERKNS_8DetParamERNS_12ClusterParamERK25LocalTrajectoryParameters@plt                                                                ▒
                 0.11% PixelCPEGeneric::localError                                                                                                                                                        ▒
                 0.11% _ZNK12PixelCPEBase9setTheCluERKNS_8DetParamERNS_12ClusterParamE@plt                                                                                                                ▒
                 0.11% _ZdlPvm@plt                                                                                                                                                                        ▒
        0.30% Chi2MeasurementEstimator::estimate   

@VinInn
Copy link
Contributor Author

VinInn commented Apr 19, 2017

this PR

   - 4.26% GroupedCkfTrajectoryBuilder::rebuildSeedingRegion                                                                                                                                                                            ▒
      - 3.10% GroupedCkfTrajectoryBuilder::rebuildSeedingRegion                                                                                                                                                                         ▒
         - 3.00% GroupedCkfTrajectoryBuilder::groupedLimitedCandidates                                                                                                                                                                  ▒
            - 2.82% GroupedCkfTrajectoryBuilder::advanceOneLayer                                                                                                                                                                        ▒
               - 2.19% TrajectorySegmentBuilder::segments                                                                                                                                                                               ▒
                  - 1.47% LayerMeasurements::groupedMeasurements                                                                                                                                                                        ▒
                     - 0.67% GeometricSearchDet::groupedCompatibleDets                                                                                                                                                                  ▒
                        + 0.31% TBLayer::groupedCompatibleDetsV                                                                                                                                                                         ▒
                        + 0.30% PixelForwardLayerPhase1::groupedCompatibleDetsV                                                                                                                                                         ▒
                     + 0.33% TkPixelMeasurementDet::measurements                                                                                                                                                                        ▒
                     + 0.31% TkGluedMeasurementDet::measurements                                                                                                                                                                        ▒
                  + 0.55% TrajectorySegmentBuilder::addGroup                                                                                                                                                                            ▒
               + 0.26% BaseCkfTrajectoryBuilder::findStateAndLayers                                                                                                                                                                     ▒
      + 1.07% GroupedCkfTrajectoryBuilder::backwardFit               

and

   - 0.75% TkPixelMeasurementDet::measurements                                                                                                                                                                                          ▒
      - 0.63% TkPixelMeasurementDet::compHits                                                                                                                                                                                           ▒
         - 0.43% TkPixelMeasurementDet::buildRecHit                                                                                                                                                                                     ▒
            - 0.39% PixelCPEBase::getParameters                                                                                                                                                                                         ▒
               - 0.28% PixelCPEGeneric::localPosition                                                                                                                                                                                   ▒
                    0.10% _ZN15SiPixelGenError4qbinEiffffRfS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_@plt                                                                                                                                     ▒

@VinInn
Copy link
Contributor Author

VinInn commented Apr 19, 2017

@cmsbuild , please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 19, 2017

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/19264/console Started: 2017/04/19 17:57

@cmsbuild
Copy link
Contributor

-1

Tested at: 4aec9c5

You can see the results of the tests here:
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-18408/19264/summary.html

I found follow errors while testing this PR

Failed tests: RelVals

  • RelVals:

When I ran the RelVals I found an error in the following worklfows:
4.22 step2

runTheMatrix-results/4.22_RunCosmics2011A+RunCosmics2011A+RECOCOSD+ALCACOSD+SKIMCOSD+HARVESTDC/step2_RunCosmics2011A+RunCosmics2011A+RECOCOSD+ALCACOSD+SKIMCOSD+HARVESTDC.log

@cmsbuild
Copy link
Contributor

Comparison not run due to runTheMatrix errors (RelVals and Igprof tests were also skipped)

@slava77
Copy link
Contributor

slava77 commented Apr 19, 2017

@cmsbuild please test

the last one was a file read error, possibly transient

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 19, 2017

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/19273/console Started: 2017/04/19 19:49

@cmsbuild
Copy link
Contributor

yl = 5.f*std::sqrt(yl);

// do not apply for iteration not cutting on propagation
if (est.maxSagitta() <0 ) {
Copy link
Contributor

Choose a reason for hiding this comment

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

You can probably squeeze cpu a bit more if you compute x1 and y1 above only if (est.maxSagitta() >= 0 )

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the compiler will take care AND est.maxSagitta() <0 is NOT the main use case

Copy link
Contributor

Choose a reason for hiding this comment

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

For my own education: how can the compiler know that "if (est.maxSagitta() <0 )" it can avoid making all computations from L38 to L48?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

L38 and L39 most probably will be invoked anyhow as they are not inlined and may have side effects: this is true.
the rest is fully inlined and the minimum one can expect from a compiler is to optimize conditional assignment....

in any case: est.maxSagitta() <0 is "unlikely".

fabs(sqrt(1.3 * 1.3 + 1.9 * 1.9 * jetZOverRho * jetZOverRho));
if (expSizeY < 1) expSizeY = 1.;
float expSizeX = 1.5;
std::sqrt((1.3f*1.3f) + (1.9f*1.9f) * jetZOverRho*jetZOverRho);
Copy link
Contributor

Choose a reason for hiding this comment

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

std::sqrt(1.69f+ 3.61f* jetZOverRhojetZOverRho); \ std::sqrt((1.3f1.3f) + (1.9f1.9f) * jetZOverRhojetZOverRho);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

do not understand the comment: as I sais this class needs anyhow a major cleanup

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the compiler takes care of proper folding constants...

Copy link
Contributor

Choose a reason for hiding this comment

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

right...

@perrotta
Copy link
Contributor

perrotta commented May 2, 2017

@VinInn I'm fine with this PR now: some little regression still visible, as expected, but all macroscopic effects potentially affecting physics performance have disappeared with the latest tunes. As a result of that tuning, improvements in cpu and perf do not seem as relevant as before: anyhow, some little cpu reduction is still visible for a few modules.
I found a couple of places in the code where probably some little more cpu can be further eroded (see review above): do you think it may be worth doing it?

@cmsbuild
Copy link
Contributor

cmsbuild commented May 2, 2017

Pull request #18408 was updated. @perrotta, @cmsbuild, @slava77, @davidlange6 can you please check and sign again.

@VinInn
Copy link
Contributor Author

VinInn commented May 2, 2017

@cmsbuild, please test

@cmsbuild
Copy link
Contributor

cmsbuild commented May 2, 2017

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/19492/console Started: 2017/05/02 10:47

@cmsbuild
Copy link
Contributor

cmsbuild commented May 2, 2017

@cmsbuild
Copy link
Contributor

cmsbuild commented May 2, 2017

Comparison job queued.

@perrotta
Copy link
Contributor

perrotta commented May 2, 2017

+1
Some little regression still visible, as expected, but all macroscopic effects potentially affecting physics performance have disappeared with the latest tunes. As a result of that tuning, improvements in cpu and perf do not seem as relevant as before: anyhow, some cpu reduction is still visible for a few modules, as shown in #18408 (comment)

@cmsbuild
Copy link
Contributor

cmsbuild commented May 2, 2017

This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request requires discussion in the ORP meeting before it's merged. @davidlange6, @smuzaffar

@cmsbuild
Copy link
Contributor

cmsbuild commented May 2, 2017

Comparison is ready
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-18408/19492/summary.html

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 3853 differences found in the comparisons
  • DQMHistoTests: Total files compared: 23
  • DQMHistoTests: Total histograms compared: 1778687
  • DQMHistoTests: Total failures: 21071
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 1757443
  • DQMHistoTests: Total skipped: 173
  • DQMHistoTests: Total Missing objects: 0
  • Checked 94 log files, 14 edm output root files, 23 DQM output files

@davidlange6
Copy link
Contributor

+1

@cmsbuild cmsbuild merged commit 9b7f92a into cms-sw:master May 2, 2017
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.

None yet

6 participants