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

[GSF tracking] Add full Sylvester criterion for positive definite check #39656

Merged
merged 2 commits into from
Oct 8, 2022

Conversation

swagata87
Copy link
Contributor

PR description:

This PR proposes to add a more strict check of positive definiteness in order to avoid GSF crashes observed recently at HLT as discussed in this issue #39570.

PR validation:

runTheMatrix.py -l 12434.0 ran fine.

In order to check if this PR would affect HLT electron efficiency, I reran HLT on EGamma RAW data, before and after this PR, and checked trigger decisions for 1000 events. HLT menu /online/collisions/2022/2e34/v1.4/HLT/V2 was run on /eos/cms/tier0/store/data/Run2022E/EGamma/RAW/v1/000/359/871/00000/fcf81596-54ed-45d3-9dee-32dec392f246.root. Trigger result was same, before and after this PR. For example:

HLT name | nEventPassed before PR | nEventPassed after PR
HLT_Ele32_WPTight_Gsf_v17 | 376 | 376
HLT_Ele23_Ele12_CaloIdL_TrackIdL_IsoVL_DZ_v21 | 30 | 30

The PR test can be done preferably by enabling profiling to see if there is any extra CPU cost for the computation of determinants of sub-matrices.

If this fix is accepted, then a backport to data-taking release cycle would be nice.

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 6, 2022

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-39656/32457

  • This PR adds an extra 12KB to repository

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 6, 2022

A new Pull Request was created by @swagata87 (Swagata Mukherjee) for master.

It involves the following packages:

  • TrackingTools/GsfTracking (reconstruction)

@cmsbuild, @mandrenguyen, @clacaputo can you please review it and eventually sign? Thanks.
@VourMa, @bellan, @felicepantaleo, @GiacomoSguazzoni, @JanFSchulte, @rovere, @VinInn, @missirol, @ebrondol, @lecriste, @gpetruc, @mmusich, @mtosi, @dgulhan this is something you requested to watch as well.
@perrotta, @dpiparo, @rappoccio you are the release manager for this.

cms-bot commands are listed here

@slava77
Copy link
Contributor

slava77 commented Oct 6, 2022

type tracking,egamma

Comment on lines 34 to 42
double det = 0;
double det22 = 0;
double det33 = 0;
double det44 = 0;
if (updatedTSOS.isValid() && updatedTSOS.localError().valid() && updatedTSOS.localError().posDef() &&
(updatedTSOS.curvilinearError().matrix().Sub<AlgebraicSymMatrix22>(0, 0).Det(det22) && det22 > 0) &&
(updatedTSOS.curvilinearError().matrix().Sub<AlgebraicSymMatrix33>(0, 0).Det(det33) && det33 > 0) &&
(updatedTSOS.curvilinearError().matrix().Sub<AlgebraicSymMatrix44>(0, 0).Det(det44) && det44 > 0) &&
(updatedTSOS.curvilinearError().matrix().Det2(det)) && det > 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 simplify this to

Suggested change
double det = 0;
double det22 = 0;
double det33 = 0;
double det44 = 0;
if (updatedTSOS.isValid() && updatedTSOS.localError().valid() && updatedTSOS.localError().posDef() &&
(updatedTSOS.curvilinearError().matrix().Sub<AlgebraicSymMatrix22>(0, 0).Det(det22) && det22 > 0) &&
(updatedTSOS.curvilinearError().matrix().Sub<AlgebraicSymMatrix33>(0, 0).Det(det33) && det33 > 0) &&
(updatedTSOS.curvilinearError().matrix().Sub<AlgebraicSymMatrix44>(0, 0).Det(det44) && det44 > 0) &&
(updatedTSOS.curvilinearError().matrix().Det2(det)) && det > 0) {
if (double det;
updatedTSOS.isValid() && updatedTSOS.localError().valid() && updatedTSOS.localError().posDef() &&
(det = 0., updatedTSOS.curvilinearError().matrix().Sub<AlgebraicSymMatrix22>(0, 0).Det(det) && det > 0) &&
(det = 0., updatedTSOS.curvilinearError().matrix().Sub<AlgebraicSymMatrix33>(0, 0).Det(det) && det > 0) &&
(det = 0., updatedTSOS.curvilinearError().matrix().Sub<AlgebraicSymMatrix44>(0, 0).Det(det) && det > 0) &&
(det = 0., updatedTSOS.curvilinearError().matrix().Det2(det) && det > 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.

thanks Andrea, now implemented

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 7, 2022

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-39656/32479

  • This PR adds an extra 12KB to repository

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 7, 2022

Pull request #39656 was updated. @cmsbuild, @mandrenguyen, @clacaputo can you please check and sign again.

@mandrenguyen
Copy link
Contributor

please test

@swagata87
Copy link
Contributor Author

A timing measurement for HLT was done in cms-hlt-gpu.cern.ch in CMSSW_12_4_9 comparing Base vs Base+this PR.
(#jobs, #threads, #streams)=(8, 8, 0), and nEvents=10000.
The results are given below.

Base

DST_Run3_PFScoutingPixelTracking_v : 167.6 ms

Base+this PR

DST_Run3_PFScoutingPixelTracking_v : 170.4 ms

FYI: @cms-sw/hlt-l2

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 8, 2022

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-66bf4a/28123/summary.html
COMMIT: fae4959
CMSSW: CMSSW_12_6_X_2022-10-07-2300/el8_amd64_gcc10
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/39656/28123/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

@slava77 comparisons for the following workflows were not done due to missing matrix map:

  • /data/cmsbld/jenkins/workspace/compare-root-files-short-matrix/data/PR-66bf4a/41834.0_TTbar_14TeV+2026D94+TTbar_14TeV_TuneCP5_GenSimHLBeamSpot14+DigiTrigger+RecoGlobal+HARVESTGlobal

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 49
  • DQMHistoTests: Total histograms compared: 3391103
  • DQMHistoTests: Total failures: 0
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3391081
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 48 files compared)
  • Checked 204 log files, 49 edm output root files, 49 DQM output files
  • TriggerResults: no differences found

@mandrenguyen
Copy link
Contributor

enable profiling
(apologies, missed this request in the PR description)

@mandrenguyen
Copy link
Contributor

please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 8, 2022

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-66bf4a/28125/summary.html
COMMIT: fae4959
CMSSW: CMSSW_12_6_X_2022-10-07-2300/el8_amd64_gcc10
Additional Tests: PROFILING
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/39656/28125/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

@slava77 comparisons for the following workflows were not done due to missing matrix map:

  • /data/cmsbld/jenkins/workspace/compare-root-files-short-matrix/data/PR-66bf4a/41834.0_TTbar_14TeV+2026D94+TTbar_14TeV_TuneCP5_GenSimHLBeamSpot14+DigiTrigger+RecoGlobal+HARVESTGlobal

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 9 differences found in the comparisons
  • DQMHistoTests: Total files compared: 49
  • DQMHistoTests: Total histograms compared: 3391103
  • DQMHistoTests: Total failures: 9
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3391072
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 48 files compared)
  • Checked 204 log files, 49 edm output root files, 49 DQM output files
  • TriggerResults: no differences found

@mandrenguyen
Copy link
Contributor

+1
it seems there is a small increase in time to
CkfTrackCandidateMakerBase::produceBase
but that the total change of CPU is within the margin of error for the profiling.

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 8, 2022

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 will now be reviewed by the release team before it's merged. @perrotta, @dpiparo, @rappoccio (and backports should be raised in the release meeting by the corresponding L2)

@perrotta
Copy link
Contributor

perrotta commented Oct 8, 2022

+1

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.

6 participants